]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/diabook/theme.php
update diabook-theme
[friendica.git] / view / theme / diabook / theme.php
index 6a1109118412105a0330980d384c27dd35606a40..b5fd4cc438b6b75e39bb8a4df7141a8e59070cb5 100644 (file)
@@ -2,14 +2,11 @@
 
 /*
  * Name: Diabook
- * Description: Diabook: report bugs and request here: http://pad.toktan.org/p/diabook or contact me : thomas_bierey@friendica.eu
+ * Description: Diabook: report bugs and request here: http://pad.toktan.org/p/diabook or http://bugs.friendica.com/view_all_bug_page.php
  * Version: (Version: 1.027)
  * Author:
  */
 
-$a = get_app();
-set_template_engine($a, 'smarty3');
-
 function get_diabook_config($key, $default = false) {
        if (local_user()) {
                $result = get_pconfig(local_user(), "diabook", $key);
@@ -26,6 +23,8 @@ function get_diabook_config($key, $default = false) {
 
 function diabook_init(&$a) {
 
+set_template_engine($a, 'smarty3');
+
 //print diabook-version for debugging
 $diabook_version = "Diabook (Version: 1.027)";
 $a->page['htmlhead'] .= sprintf('<META NAME=generator CONTENT="%s"/>', $diabook_version);
@@ -46,7 +45,6 @@ $close_friends    = get_diabook_config( "close_friends", 0 );
 $close_lastusers  = get_diabook_config( "close_lastusers", 0 );
 $close_lastphotos = get_diabook_config( "close_lastphotos", 0 );
 $close_lastlikes  = get_diabook_config( "close_lastlikes", 0 );
-$close_twitter    = get_diabook_config( "close_twitter", 1 );
 $close_mapquery   = get_diabook_config( "close_mapquery", 1 );
 
 //get resolution (wide/normal)
@@ -71,6 +69,18 @@ if ($color=="pink") $color_path = "/diabook-pink/";
 if ($color=="green") $color_path = "/diabook-green/";
 if ($color=="dark") $color_path = "/diabook-dark/";
 
+       // remove doubled checkboxes at contacts-edit-page
+       if ($a->argv[0] === "contacts" && $a->argv[1] != NULL && local_user()){
+       $a->page['htmlhead'] .= '
+       <script>
+        $(document).ready(function() {
+               $("span.group_unselected").attr("style","display: none;");
+               $("span.group_selected").attr("style","display: none;");
+               $("input.unticked.action").attr("style","float: left; margin-top: 5px;");
+               $("li.menu-profile-list").attr("style","min-height: 22px;");
+       });
+       </script>';
+       }
 
        //build personal menue at lefthand-col (id="profile_side") and boxes at right-hand-col at networkpages
        if ($a->argv[0] === "network" && local_user()){
@@ -103,9 +113,9 @@ if ($color=="dark") $color_path = "/diabook-dark/";
 
        }
 
-       $ccCookie = $close_pages + $close_mapquery + $close_profiles + $close_helpers + $close_services + $close_friends + $close_twitter + $close_lastusers + $close_lastphotos + $close_lastlikes;
+       $ccCookie = $close_pages + $close_mapquery + $close_profiles + $close_helpers + $close_services + $close_friends + $close_lastusers + $close_lastphotos + $close_lastlikes;
        //if all boxes closed, dont build right-hand-col and dont use special css
-       if($ccCookie != "10") {
+       if($ccCookie != "9") {
        // COMMUNITY
        diabook_community_info();
 
@@ -119,7 +129,7 @@ if ($color=="dark") $color_path = "/diabook-dark/";
 
        //build boxes at right_aside at profile pages
        if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname']){
-       if($ccCookie != "10") {
+       if($ccCookie != "9") {
        // COMMUNITY
        diabook_community_info();
 
@@ -138,17 +148,13 @@ if ($color=="dark") $color_path = "/diabook-dark/";
        $imageresizeJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.ae.image.resize.min.js";
        $a->page['htmlhead'] .= sprintf('<script type="text/javascript" src="%s" ></script>', $imageresizeJS);
        //load jquery.ui.js
-       if($ccCookie != "10") {
+       if($ccCookie != "9") {
        $jqueryuiJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery-ui-1.8.20.custom.min.js";
        $a->page['htmlhead'] .= sprintf('<script type="text/javascript" src="%s" ></script>', $jqueryuiJS);
        $jqueryuicssJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/jquery-ui-1.8.20.custom.css";
        $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $jqueryuicssJS);
        }
-       //load jquery.twitter.search.js
-       if($close_twitter != "1") {
-       $twitterJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.twitter.search.js";
-       $a->page['htmlhead'] .= sprintf('<script type="text/javascript" src="%s" ></script>', $twitterJS);
-       }
+       
        //load jquery.mapquery.js
        if($close_mapquery != "1") {
        $mqtmplJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.tmpl.js";
@@ -170,10 +176,9 @@ if ($color=="dark") $color_path = "/diabook-dark/";
        $a->page['htmlhead'] .= '
        <script>
         $(function() {
-               $("a.lightbox").fancybox(); // Select all links with lightbox class
-               $("a#twittersettings-link").fancybox({onClosed: function() { $("#twittersettings").attr("style","display: none;");}} );
-          $("a#mapcontrol-link").fancybox({onClosed: function() { $("#mapcontrol").attr("style","display: none;");}} );
-          $("a#closeicon").fancybox({onClosed: function() { $("#boxsettings").attr("style","display: none;");}} );
+               $("a.lightbox").colorbox({maxHeight:"90%"}); // Select all links with lightbox class
+               $("a#mapcontrol-link").colorbox({inline:true,onClosed: function() { $("#mapcontrol").attr("style","display: none;");}} );
+               $("a#closeicon").colorbox({inline:true,onClosed: function() { $("#boxsettings").attr("style","display: none;");}} );
                });
 
         $(window).load(function() {
@@ -235,25 +240,7 @@ if ($color=="dark") $color_path = "/diabook-dark/";
                };
                </script>';
        }
-       //check if twitterbox is active and print
-       if($close_twitter != "1") {
-               $TSearchTerm = get_diabook_config( "TSearchTerm", "friendica" );
-               $a->page['htmlhead'] .= '
-               <script>
-               $(function() {
-               $("#twitter").twitterSearch({
-               term: "'.$TSearchTerm.'",
-               animInSpeed: 250,
-               bird:    false,
-               avatar:  false,
-               colorExterior: "#fff",
-               timeout: 10000          });
-               });
-               function open_twittersettings() {
-               $("div#twittersettings").attr("style","display: block;");
-               };
-               </script>';}
-
+       
        //check if community_home-plugin is activated and change css.. we need this, that the submit-wrapper doesn't overlay the login-panel if communityhome-plugin is active
        $nametocheck = "communityhome";
        $r = q("select id from addon where name = '%s' and installed = 1", dbesc($nametocheck));
@@ -293,7 +280,7 @@ if ($color=="dark") $color_path = "/diabook-dark/";
        });
        </script>';
 
-       if($ccCookie != "10") {
+       if($ccCookie != "9") {
        $a->page['htmlhead'] .= '
        <script>
        $("right_aside").ready(function(){
@@ -328,11 +315,6 @@ if ($color=="dark") $color_path = "/diabook-dark/";
                document.getElementById( "close_friends" ).style.display = "none";
                        };
 
-       if('.$close_twitter.')
-               {
-               document.getElementById( "close_twitter" ).style.display = "none";
-                       };
-
        if('.$close_lastusers.')
                {
                document.getElementById( "close_lastusers" ).style.display = "none";
@@ -377,7 +359,6 @@ if ($color=="dark") $color_path = "/diabook-dark/";
        $close_lastusers  = get_diabook_config( "close_lastusers", 0 );
        $close_lastphotos = get_diabook_config( "close_lastphotos", 0 );
        $close_lastlikes  = get_diabook_config( "close_lastlikes", 0 );
-       $close_twitter    = get_diabook_config( "close_twitter", 1 );
        $close_mapquery   = get_diabook_config( "close_mapquery", 1 );
 
        // comunity_profiles
@@ -393,9 +374,9 @@ if ($color=="dark") $color_path = "/diabook-dark/";
                        $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
                        $entry = replace_macros($tpl,array(
                                '$id' => $rr['id'],
-                               '$profile-link' => zrl($rr['url']),
+                               '$profile_link' => zrl($rr['url']),
                                '$photo' => $rr[$photo],
-                               '$alt-text' => $rr['name'],
+                               '$alt_text' => $rr['name'],
                        ));
                        $aside['$comunity_profiles_items'][] = $entry;
                }
@@ -422,9 +403,9 @@ if ($color=="dark") $color_path = "/diabook-dark/";
                        $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
                        $entry = replace_macros($tpl,array(
                                '$id' => $rr['id'],
-                               '$profile-link' => $profile_link,
+                               '$profile_link' => $profile_link,
                                '$photo' => $a->get_cached_avatar_image($rr[$photo]),
-                               '$alt-text' => $rr['name'],
+                               '$alt_text' => $rr['name'],
                        ));
                        $aside['$lastusers_items'][] = $entry;
                }
@@ -501,9 +482,9 @@ if ($color=="dark") $color_path = "/diabook-dark/";
 
                        $entry = replace_macros($tpl,array(
                                '$id' => $rr['id'],
-                               '$profile-link' => $photo_page,
+                               '$profile_link' => $photo_page,
                                '$photo' => $photo_url,
-                               '$alt-text' => $rr['username']." : ".$rr['desc'],
+                               '$alt_text' => $rr['username']." : ".$rr['desc'],
                        ));
 
                        $aside['$photos_items'][] = $entry;
@@ -601,22 +582,8 @@ if ($color=="dark") $color_path = "/diabook-dark/";
        $aside['$con_services'] = $con_services;
        }
    //end connectable services
-   //twitter
-   if($close_twitter != "1") {
-   $twitter = array();
-       $twitter['title'] = Array("", "<a id='twittersettings-link' href='#twittersettings' style='text-decoration:none;' onclick='open_twittersettings(); return false;'>".t('Last Tweets')."</a>", "", "");
-       $aside['$twitter'] = $twitter;
-       $TSearchTerm = get_pconfig(local_user(), 'diabook', 'TSearchTerm' );
-       $aside['$TSearchTerm'] = array('diabook_TSearchTerm', t('Set twitter search term'), $TSearchTerm, '', $TSearchTerm);
-       $baseurl = $a->get_baseurl($ssl_state);
-       $aside['$baseurl'] = $baseurl;
-       if (isset($_POST['diabook-settings-sub']) && $_POST['diabook-settings-sub']!=''){
-               set_pconfig(local_user(), 'diabook', 'TSearchTerm', $_POST['diabook_TSearchTerm']);
-               header("Location: network");
-               }
-       }
-   //end twitter
-   if($ccCookie != "10") {
+   
+   if($ccCookie != "9") {
        $close_pages      = get_diabook_config( "close_pages", 1 );
        $close_profiles   = get_diabook_config( "close_profiles", 0 );
        $close_helpers    = get_diabook_config( "close_helpers", 0 );
@@ -625,7 +592,6 @@ if ($color=="dark") $color_path = "/diabook-dark/";
        $close_lastusers  = get_diabook_config( "close_lastusers", 0 );
        $close_lastphotos = get_diabook_config( "close_lastphotos", 0 );
        $close_lastlikes  = get_diabook_config( "close_lastlikes", 0 );
-       $close_twitter    = get_diabook_config( "close_twitter", 1 );
        $close_mapquery   = get_diabook_config( "close_mapquery", 1 );
        $close_or_not = array('1'=>t("don't show"),     '0'=>t("show"),);
        $boxsettings['title'] = Array("", t('Show/hide boxes at right-hand column:'), "", "");
@@ -636,7 +602,6 @@ if ($color=="dark") $color_path = "/diabook-dark/";
        $aside['$close_helpers'] = array('diabook_close_helpers', t('Help or @NewHere ?'), $close_helpers, '', $close_or_not);
        $aside['$close_services'] = array('diabook_close_services', t('Connect Services'), $close_services, '', $close_or_not);
        $aside['$close_friends'] = array('diabook_close_friends', t('Find Friends'), $close_friends, '', $close_or_not);
-       $aside['$close_twitter'] = array('diabook_close_twitter', t('Last Tweets'), $close_twitter, '', $close_or_not);
        $aside['$close_lastusers'] = array('diabook_close_lastusers', t('Last users'), $close_lastusers, '', $close_or_not);
        $aside['$close_lastphotos'] = array('diabook_close_lastphotos', t('Last photos'), $close_lastphotos, '', $close_or_not);
        $aside['$close_lastlikes'] = array('diabook_close_lastlikes', t('Last likes'), $close_lastlikes, '', $close_or_not);
@@ -650,7 +615,6 @@ if ($color=="dark") $color_path = "/diabook-dark/";
                set_pconfig(local_user(), 'diabook', 'close_helpers', $_POST['diabook_close_helpers']);
                set_pconfig(local_user(), 'diabook', 'close_services', $_POST['diabook_close_services']);
                set_pconfig(local_user(), 'diabook', 'close_friends', $_POST['diabook_close_friends']);
-               set_pconfig(local_user(), 'diabook', 'close_twitter', $_POST['diabook_close_twitter']);
                set_pconfig(local_user(), 'diabook', 'close_lastusers', $_POST['diabook_close_lastusers']);
                set_pconfig(local_user(), 'diabook', 'close_lastphotos', $_POST['diabook_close_lastphotos']);
                set_pconfig(local_user(), 'diabook', 'close_lastlikes', $_POST['diabook_close_lastlikes']);