diff options
Diffstat (limited to 'include/nav.php')
-rw-r--r-- | include/nav.php | 65 |
1 files changed, 44 insertions, 21 deletions
diff --git a/include/nav.php b/include/nav.php index c2a058457..6ad43c909 100644 --- a/include/nav.php +++ b/include/nav.php @@ -1,6 +1,8 @@ <?php /** @file */ -function nav(&$a) { +use \Zotlabs\Lib as Zlib; + +function nav() { /** * @@ -12,8 +14,8 @@ function nav(&$a) { App::$page['nav'] = ''; $base = z_root(); - App::$page['htmlhead'] .= <<< EOT + App::$page['htmlhead'] .= <<< EOT <script>$(document).ready(function() { $("#nav-search-text").search_autocomplete('$base/acl'); }); @@ -21,8 +23,6 @@ function nav(&$a) { </script> EOT; - - if(local_channel()) { $channel = App::get_channel(); $observer = App::get_observer(); @@ -108,7 +108,7 @@ EOT; if(feature_enabled($channel['channel_id'],'webpages') && (! $basic)) $nav['usermenu'][] = Array('webpages/' . $channel['channel_address'],t('Webpages'),"",t('Your webpages'),'webpages_nav_btn'); if(feature_enabled($channel['channel_id'],'wiki') && (! $basic)) - $nav['usermenu'][] = Array('wiki/' . $channel['channel_address'],t('Wiki'),"",t('Your wiki'),'wiki_nav_btn'); + $nav['usermenu'][] = Array('wiki/' . $channel['channel_address'],t('Wikis'),"",t('Your wikis'),'wiki_nav_btn'); } else { if(! get_account_id()) { @@ -127,26 +127,24 @@ EOT; ); } - if($observer) { - $nav['lock'] = array('logout','','lock', - sprintf( t('%s - click to logout'), $observer['xchan_addr'])); - } elseif(! $_SESSION['authenticated']) { $nav['loginmenu'][] = Array('rmagic',t('Remote authentication'),'',t('Click to authenticate to your home hub'),'rmagic_nav_btn'); } - /** - * "Home" should also take you home from an authenticated remote profile connection - */ - $homelink = get_my_url(); if(! $homelink) { $observer = App::get_observer(); $homelink = (($observer) ? $observer['xchan_url'] : ''); } - if(! local_channel()) - $nav['home'] = array($homelink, t('Home'), "", t('Home Page'),'home_nav_btn'); + if(! local_channel()) { + $nav['rusermenu'] = array( + $homelink, + t('Get me home'), + 'logout', + t('Log me out of this site') + ); + } if(((get_config('system','register_policy') == REGISTER_OPEN) || (get_config('system','register_policy') == REGISTER_APPROVE)) && (! $_SESSION['authenticated'])) $nav['register'] = array('register',t('Register'), "", t('Create an account'),'register_nav_btn'); @@ -236,16 +234,41 @@ EOT; $x = array('nav' => $nav, 'usermenu' => $userinfo ); call_hooks('nav', $x); -// Not sure the best place to put this on the page. So I'm implementing it but leaving it -// turned off until somebody discovers this and figures out a good location for it. -$powered_by = ''; + // Not sure the best place to put this on the page. So I'm implementing it but leaving it + // turned off until somebody discovers this and figures out a good location for it. + $powered_by = ''; + + // $powered_by = '<strong>red<img class="smiley" src="' . z_root() . '/images/rm-16.png" alt="r#" />matrix</strong>'; + + + //app bin + $navapps = ''; + if(get_config('system','experimental_app_bin')) { + if(local_channel()) { + //Zlib\Apps::import_system_apps(); + $syslist = array(); + $list = Zlib\Apps::app_list(local_channel(), false, $_GET['cat']); + if($list) { + foreach($list as $li) { + $syslist[] = Zlib\Apps::app_encode($li); + } + } + Zlib\Apps::translate_system_apps($syslist); + } + else { + $syslist = Zlib\Apps::get_system_apps(true); + } -// $powered_by = '<strong>red<img class="smiley" src="' . z_root() . '/images/rm-16.png" alt="r#" />matrix</strong>'; + $navapps = replace_macros(get_markup_template('navapps.tpl'), array( + '$apps' => $syslist + )); + } $tpl = get_markup_template('nav.tpl'); App::$page['nav'] .= replace_macros($tpl, array( '$baseurl' => z_root(), + '$fulldocs' => t('Documentation'), '$sitelocation' => $sitelocation, '$nav' => $x['nav'], '$banner' => $banner, @@ -255,10 +278,10 @@ $powered_by = ''; '$sel' => App::$nav_sel, '$powered_by' => $powered_by, '$help' => t('@name, #tag, ?doc, content'), - '$pleasewait' => t('Please wait...') + '$pleasewait' => t('Please wait...'), + '$navapps' => $navapps )); - if(x($_SESSION, 'reload_avatar') && $observer) { // The avatar has been changed on the server but the browser doesn't know that, // force the browser to reload the image from the server instead of its cache. |