diff options
author | Simon L'nu <simon.lnu@gmail.com> | 2012-05-05 20:08:19 -0400 |
---|---|---|
committer | Simon L'nu <simon.lnu@gmail.com> | 2012-05-05 20:08:19 -0400 |
commit | 0c4099966a5ac1f1ff5dc568a600aa57776fb752 (patch) | |
tree | f6c8a337eeae8ecc1848e319c9e5beb8c338d973 /view/theme/diabook/theme.php | |
parent | 250bf57e1e69670b956c1365dcb9ffa90800c05c (diff) | |
parent | e1ab3a93cc450ca52c7651ecca8cad8334e5f1ce (diff) | |
download | volse-hubzilla-0c4099966a5ac1f1ff5dc568a600aa57776fb752.tar.gz volse-hubzilla-0c4099966a5ac1f1ff5dc568a600aa57776fb752.tar.bz2 volse-hubzilla-0c4099966a5ac1f1ff5dc568a600aa57776fb752.zip |
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master:
diabook-theme: small fix
diabook-theme: twitter-box-update at right_aside
diabook-theme: can now set the twitter search term in theme-settings & small fixes
consolidate item deletion so we can fix orphaned categories and file_as tags.
DE: new email templates translated
workaround to clean up orphaned filetags
only show remove category to item owner
Option to set theme width added. Minor layout changes
* master:
Diffstat (limited to 'view/theme/diabook/theme.php')
-rwxr-xr-x | view/theme/diabook/theme.php | 111 |
1 files changed, 88 insertions, 23 deletions
diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index f8fdeb8b1..2880df2d5 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -48,7 +48,7 @@ if ($color=="pink") $color_path = "/diabook-pink/"; if ($color=="green") $color_path = "/diabook-green/"; if ($color=="dark") $color_path = "/diabook-dark/"; - + //profile_side at networkpages if ($a->argv[0] === "network" && local_user()){ @@ -80,9 +80,9 @@ if ($color=="dark") $color_path = "/diabook-dark/"; } - $ccCookie = $_COOKIE['close_pages'] + $_COOKIE['close_profiles'] + $_COOKIE['close_helpers'] + $_COOKIE['close_services'] + $_COOKIE['close_friends'] + $_COOKIE['close_twitter'] + $_COOKIE['close_lastusers'] + $_COOKIE['close_lastphotos'] + $_COOKIE['close_lastlikes']; + $ccCookie = $_COOKIE['close_pages'] + $_COOKIE['close_mapquery'] + $_COOKIE['close_profiles'] + $_COOKIE['close_helpers'] + $_COOKIE['close_services'] + $_COOKIE['close_friends'] + $_COOKIE['close_twitter'] + $_COOKIE['close_lastusers'] + $_COOKIE['close_lastphotos'] + $_COOKIE['close_lastlikes']; - if($ccCookie != "9") { + if($ccCookie != "10") { // COMMUNITY diabook_community_info(); @@ -96,7 +96,7 @@ if ($color=="dark") $color_path = "/diabook-dark/"; //right_aside at profile pages if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname']){ - if($ccCookie != "9") { + if($ccCookie != "10") { // COMMUNITY diabook_community_info(); @@ -128,36 +128,74 @@ if ($color=="dark") $color_path = "/diabook-dark/"; $a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $twitterJS); } + //load jquery.mapquery.js + $_COOKIE['close_mapquery'] = "1"; + if($_COOKIE['close_mapquery'] != "1") { + $mapqueryJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.mapquery.core.js"; + $a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $mapqueryJS); + $openlayersJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/OpenLayers.js"; + $a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $openlayersJS); + $qlayersJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.mapquery.mqLayerControl.js"; + $a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $mqlayersJS); + + } + $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;");}} ); }); $(window).load(function() { var footer_top = $(document).height() - 30; $("div#footerbox").attr("style", "border-top: 1px solid #D2D2D2; width: 70%;right: 15%;position: absolute;top:"+footer_top+"px;"); }); - - - </script>'; - + //check if mapquerybox is active and print + $_COOKIE['close_mapquery'] = "1"; + if($_COOKIE['close_mapquery'] != "1") { + $a->page['htmlhead'] .= ' + <script> + + $(document).ready(function() { + $("#map").mapQuery({ + layers:[{ //add layers to your map; you need to define at least one to be able to see anything on the map + type:"osm" //add a layer of the type osm (OpenStreetMap) + }] + }); + $("#map2").mapQuery({ + layers:[{ //add layers to your map; you need to define at least one to be able to see anything on the map + type:"osm" //add a layer of the type osm (OpenStreetMap) + }] + }); + + }); + + </script>'; + } //check if twitterbox is active and print if($_COOKIE['close_twitter'] != "1") { + $TSearchTerm=false; + $site_TSearchTerm = get_config("diabook", "TSearchTerm" ); + $TSearchTerm = get_pconfig(local_user(), "diabook", "TSearchTerm"); + if ($TSearchTerm===false) $TSearchTerm=$site_TSearchTerm; + if ($TSearchTerm===false) $TSearchTerm="friendica"; $a->page['htmlhead'] .= ' <script> $(function() { $("#twitter").twitterSearch({ - term: "friendica", + term: "'.$TSearchTerm.'", animInSpeed: 250, bird: false, avatar: false, colorExterior: "#fff", - title: "Last Tweets", timeout: 10000 }); }); + function open_twittersettings() { + $("div#twittersettings").attr("style","display: block;"); + }; </script>';} //check if community_home-plugin is activated and change css @@ -187,6 +225,7 @@ if ($color=="dark") $color_path = "/diabook-dark/"; <script> function restore_boxes(){ $.cookie("close_pages","2", { expires: 365, path: "/" }); + $.cookie("close_mapquery","2", { expires: 365, path: "/" }); $.cookie("close_helpers","2", { expires: 365, path: "/" }); $.cookie("close_profiles","2", { expires: 365, path: "/" }); $.cookie("close_services","2", { expires: 365, path: "/" }); @@ -219,6 +258,11 @@ if ($color=="dark") $color_path = "/diabook-dark/"; document.getElementById( "close_pages" ).style.display = "none"; }; + if($.cookie("close_mapquery") == "1") + { + document.getElementById( "close_mapquery" ).style.display = "none"; + }; + if($.cookie("close_profiles") == "1") { document.getElementById( "close_profiles" ).style.display = "none"; @@ -241,7 +285,7 @@ if ($color=="dark") $color_path = "/diabook-dark/"; if($.cookie("close_twitter") == "1") { - document.getElementById( "twitter" ).style.display = "none"; + document.getElementById( "close_twitter" ).style.display = "none"; }; if($.cookie("close_lastusers") == "1") @@ -265,6 +309,11 @@ if ($color=="dark") $color_path = "/diabook-dark/"; document.getElementById( "close_pages" ).style.display = "none"; $.cookie("close_pages","1", { expires: 365, path: "/" }); }; + + function close_mapquery(){ + document.getElementById( "close_mapquery" ).style.display = "none"; + $.cookie("close_mapquery","1", { expires: 365, path: "/" }); + }; function close_profiles(){ document.getElementById( "close_profiles" ).style.display = "none"; @@ -287,7 +336,7 @@ if ($color=="dark") $color_path = "/diabook-dark/"; }; function close_twitter(){ - document.getElementById( "twitter" ).style.display = "none"; + document.getElementById( "close_twitter" ).style.display = "none"; $.cookie("close_twitter","1", { expires: 365, path: "/" }); }; @@ -509,6 +558,15 @@ if ($color=="dark") $color_path = "/diabook-dark/"; }} //END Community Page + //mapquery + $_COOKIE['close_mapquery'] = "1"; + if($_COOKIE['close_mapquery'] != "1") { + $mapquery = array(); + $mapquery['title'] = Array("", t('Earth View'), "", ""); + $aside['$mapquery'] = $mapquery; + } + //end mapquery + //helpers if($_COOKIE['close_helpers'] != "1") { $helpers = array(); @@ -523,6 +581,23 @@ if ($color=="dark") $color_path = "/diabook-dark/"; $aside['$con_services'] = $con_services; } //end connectable services + //twitter + if($_COOKIE['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['$submit'] = t('Submit'); + $aside['$TSearchTerm'] = array('diabook_TSearchTerm', t('Set twitter search term'), $TSearchTerm, '', $TSearchTerm); + $baseurl = $a->get_baseurl(); + $aside['$baseurl'] = $baseurl; + if (isset($_POST['diabook-settings-submit'])){ + set_pconfig(local_user(), 'diabook', 'TSearchTerm', $_POST['diabook_TSearchTerm']); + } + } + //end twitter + $close = t('Close'); + $aside['$close'] = $close; //get_baseurl $url = $a->get_baseurl($ssl_state); $aside['$url'] = $url; @@ -542,14 +617,4 @@ if ($color=="dark") $color_path = "/diabook-dark/"; $a->page['footer'] = $a->page['footer'].replace_macros($tpl, $bottom); } - - - - - - - - - - - + |