require_once("include/socgraph.php");
require_once("mod/proxy.php");
-function vier_init(&$a) {
+function vier_init(App $a) {
$a->theme_events_in_profile = false;
$a->page['htmlhead'] .= '<meta name=viewport content="width=device-width, initial-scale=1">'."\n";
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="view/theme/vier/mobile.css" media="screen"/>'."\n";
}
- // deactivated since it doesn't work with desktop browsers at the moment (To-Do)
- //$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="view/theme/vier/mobile.css" media="screen and (max-width: 1000px)"/>'."\n";
+ /// @todo deactivated since it doesn't work with desktop browsers at the moment
+ //$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="view/theme/vier/mobile.css" media="screen and (max-width: 1000px)"/>'."\n";
-$a->page['htmlhead'] .= <<< EOT
+ $a->page['htmlhead'] .= <<< EOT
<link rel='stylesheet' type='text/css' href='view/theme/vier/narrow.css' media='screen and (max-width: 1100px)' />
<script type="text/javascript">
-function insertFormatting(comment,BBcode,id) {
-
- var tmpStr = $("#comment-edit-text-" + id).val();
- if(tmpStr == comment) {
- tmpStr = "";
- $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
- $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
- openMenu("comment-edit-submit-wrapper-" + id);
- $("#comment-edit-text-" + id).val(tmpStr);
- }
+function insertFormatting(BBcode, id) {
+ var tmpStr = $("#comment-edit-text-" + id).val();
+ if (tmpStr == "") {
+ $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+ $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+ openMenu("comment-edit-submit-wrapper-" + id);
+ }
textarea = document.getElementById("comment-edit-text-" +id);
if (document.selection) {
textarea.focus();
selected = document.selection.createRange();
- if (BBcode == "url"){
+ if (BBcode == "url") {
selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
- } else
- selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+ } else {
+ selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+ }
} else if (textarea.selectionStart || textarea.selectionStart == "0") {
var start = textarea.selectionStart;
var end = textarea.selectionEnd;
- if (BBcode == "url"){
+ if (BBcode == "url") {
textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
- } else
- textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+ } else {
+ textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+ }
}
+
return true;
}
-
function showThread(id) {
$("#collapsed-comments-" + id).show()
$("#collapsed-comments-" + id + " .collapsed-comments").show()
$("#collapsed-comments-" + id + " .collapsed-comments").hide()
}
-
function cmtBbOpen(id) {
$("#comment-edit-bb-" + id).show();
}
function cmtBbClose(id) {
$("#comment-edit-bb-" + id).hide();
}
-
-
-
</script>
EOT;
-
-if ($a->is_mobile || $a->is_tablet){
- $a->page['htmlhead'] .= <<< EOT
+ if ($a->is_mobile || $a->is_tablet){
+ $a->page['htmlhead'] .= <<< EOT
<script>
$(document).ready(function() {
$(".mobile-aside-toggle a").click(function(e){
});
</script>
EOT;
-}
-
+ }
// Hide the left menu bar
if (($a->page['aside'] == "") AND in_array($a->argv[0], array("community", "events", "help", "manage", "notifications",
- "probe", "webfinger", "login", "invite", "credits")))
+ "probe", "webfinger", "login", "invite", "credits"))) {
$a->page['htmlhead'] .= "<link rel='stylesheet' href='view/theme/vier/hide.css' />";
+ }
}
function get_vier_config($key, $default = false, $admin = false) {
$aside['$url'] = $url;
// comunity_profiles
- if($show_profiles) {
+ if ($show_profiles) {
$r = suggestion_query(local_user(), 0, 9);
}
// last 9 users
- if($show_lastusers) {
+ if ($show_lastusers) {
$publish = (get_config('system','publish_all') ? '' : " AND `publish` = 1 ");
$order = " ORDER BY `register_date` DESC ";
}
//Community_Pages at right_aside
- if($show_pages AND local_user()) {
+ if ($show_pages AND local_user()) {
require_once('include/ForumManager.php');
- if(x($_GET['cid']) && intval($_GET['cid']) != 0)
+ if (x($_GET['cid']) && intval($_GET['cid']) != 0)
$cid = $_GET['cid'];
//sort by last updated item
$total = count($contacts);
$visible_forums = 10;
- if(count($contacts)) {
+ if (count($contacts)) {
$id = 0;
//END Community Page
//helpers
- if($show_helpers) {
+ if ($show_helpers) {
$r = array();
$helperlist = get_config("vier", "helperlist");