]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/vier/theme.php
Merge remote-tracking branch 'refs/remotes/friendica/develop' into develop
[friendica.git] / view / theme / vier / theme.php
index 8be91220afcc815f0d468f860e7df5afe5464350..a35afa719bd5cd3207cef574f26ab8a756147c59 100644 (file)
@@ -13,7 +13,7 @@ require_once("include/plugin.php");
 require_once("include/socgraph.php");
 require_once("mod/proxy.php");
 
-function vier_init(App &$a) {
+function vier_init(App $a) {
 
        $a->theme_events_in_profile = false;
 
@@ -29,44 +29,43 @@ function vier_init(App &$a) {
                $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()
@@ -76,22 +75,17 @@ function hideThread(id) {
        $("#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){
@@ -104,13 +98,13 @@ if ($a->is_mobile || $a->is_tablet){
        });
 </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) {
@@ -142,7 +136,7 @@ function vier_community_info() {
        $aside['$url'] = $url;
 
        // comunity_profiles
-       if($show_profiles) {
+       if ($show_profiles) {
 
                $r = suggestion_query(local_user(), 0, 9);
 
@@ -166,7 +160,7 @@ function vier_community_info() {
        }
 
        // last 9 users
-       if($show_lastusers) {
+       if ($show_lastusers) {
                $publish = (get_config('system','publish_all') ? '' : " AND `publish` = 1 ");
                $order = " ORDER BY `register_date` DESC ";
 
@@ -215,11 +209,11 @@ function vier_community_info() {
        }
 
        //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
@@ -229,7 +223,7 @@ function vier_community_info() {
                $total = count($contacts);
                $visible_forums = 10;
 
-               if(count($contacts)) {
+               if (count($contacts)) {
 
                        $id = 0;
 
@@ -267,7 +261,7 @@ function vier_community_info() {
        //END Community Page
 
        //helpers
-       if($show_helpers) {
+       if ($show_helpers) {
                $r = array();
 
                $helperlist = get_config("vier", "helperlist");