]> git.mxchange.org Git - friendica.git/blobdiff - include/nav.php
events: use best_link_url() and zrl() for the author_link (author link as magic-link)
[friendica.git] / include / nav.php
index f71272f3b1bae1d55a51cf2b8248d56e6da0a335..d7a6e397c603162efdee4e551cc9725d0a777ead 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 
-function nav(&$a) {
+use Friendica\App;
+use Friendica\Core\System;
+
+function nav(App $a) {
 
        /*
         *
@@ -8,7 +11,7 @@ function nav(&$a) {
         *
         */
 
-       if(!(x($a->page,'nav')))
+       if (!(x($a->page,'nav')))
                $a->page['nav'] = '';
 
        $a->page['htmlhead'] .= replace_macros(get_markup_template('nav_head.tpl'), array());
@@ -28,7 +31,7 @@ function nav(&$a) {
        $tpl = get_markup_template('nav.tpl');
 
        $a->page['nav'] .= replace_macros($tpl, array(
-               '$baseurl' => App::get_baseurl(),
+               '$baseurl' => System::baseUrl(),
                '$sitelocation' => $nav_info['sitelocation'],
                '$nav' => $nav_info['nav'],
                '$banner' => $nav_info['banner'],
@@ -65,7 +68,7 @@ function nav_info(App $a)
 
        $myident = ((is_array($a->user) && isset($a->user['nickname'])) ? $a->user['nickname'] . '@' : '');
 
-       $sitelocation = $myident . substr(App::get_baseurl($ssl_state), strpos(App::get_baseurl($ssl_state), '//') + 2 );
+       $sitelocation = $myident . substr(System::baseUrl($ssl_state), strpos(System::baseUrl($ssl_state), '//') + 2 );
 
        // nav links: array of array('href', 'text', 'extra css classes', 'title')
        $nav = array();
@@ -86,9 +89,9 @@ function nav_info(App $a)
                $nav['usermenu'][] = array('notes/', t('Personal notes'), '', t('Your personal notes'));
 
                // user info
-               $r = q("SELECT `micro` FROM `contact` WHERE `uid` = %d AND `self` = 1", intval($a->user['uid']));
+               $r = dba::select('contact', array('micro'), array('uid' => $a->user['uid'], 'self' => true), array('limit' => 1));
                $userinfo = array(
-                       'icon' => (dbm::is_result($r) ? $a->remove_baseurl($r[0]['micro']) : 'images/person-48.jpg'),
+                       'icon' => (dbm::is_result($r) ? $a->remove_baseurl($r['micro']) : 'images/person-48.jpg'),
                        'name' => $a->user['username'],
                );
        } else {
@@ -119,7 +122,7 @@ function nav_info(App $a)
                $nav['apps'] = array('apps', t('Apps'), '', t('Addon applications, utilities, games'));
        }
 
-       if (local_user() OR !get_config('system', 'local_search')) {
+       if (local_user() || !get_config('system', 'local_search')) {
                $nav['search'] = array('search', t('Search'), '', t('Search site content'));
 
                $nav['searchoption'] = array(
@@ -136,7 +139,7 @@ function nav_info(App $a)
 
        if (strlen(get_config('system', 'singleuser'))) {
                $gdir = get_config('system', 'directory');
-               if(strlen($gdir)) {
+               if (strlen($gdir)) {
                        $gdirpath = zrl($gdir, true);
                }
        } elseif (get_config('system', 'community_page_style') == CP_USERS_ON_SERVER) {
@@ -202,7 +205,7 @@ function nav_info(App $a)
        // Provide a banner/logo/whatever
        $banner = get_config('system', 'banner');
        if ($banner === false) {
-               $banner = '<a href="http://friendica.com"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="http://friendica.com">Friendica</a></span>';
+               $banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
        }
 
        call_hooks('nav_info', $nav);