From 5d439239419b5a6b0c709f8622da41b5a8af68af Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 7 Jan 2011 19:27:59 -0500 Subject: [PATCH] remove help link; Everyone => Public; Logo goes home --- plugins/NewMenu/NewMenuPlugin.php | 61 +++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 8 deletions(-) diff --git a/plugins/NewMenu/NewMenuPlugin.php b/plugins/NewMenu/NewMenuPlugin.php index 7397d4fbc9..cdcea5cd92 100644 --- a/plugins/NewMenu/NewMenuPlugin.php +++ b/plugins/NewMenu/NewMenuPlugin.php @@ -130,7 +130,7 @@ class NewMenuPlugin extends Plugin 'nav_logout'); } else { $action->menuItem(common_local_url('public'), - _m('Everyone'), + _m('Public'), _m('Everyone on this site'), false, 'nav_public'); @@ -141,13 +141,6 @@ class NewMenuPlugin extends Plugin 'nav_login'); } - $action->menuItem(common_local_url('doc', - array('title' => 'help')), - _m('Help'), - _m('Help using this site'), - false, - 'nav_help'); - if (!empty($user) || !common_config('site', 'private')) { $action->menuItem(common_local_url('noticesearch'), _m('Search'), @@ -368,6 +361,58 @@ class NewMenuPlugin extends Plugin return true; } + function onStartAddressData($action) + { + if (common_config('singleuser', 'enabled')) { + $user = User::singleUser(); + $url = common_local_url('showstream', + array('nickname' => $user->nickname)); + } else if (common_logged_in()) { + $cur = common_current_user(); + $url = common_local_url('all', array('nickname' => $cur->nickname)); + } else { + $url = common_local_url('public'); + } + + $action->elementStart('a', array('class' => 'url home bookmark', + 'href' => $url)); + + if (StatusNet::isHTTPS()) { + $logoUrl = common_config('site', 'ssllogo'); + if (empty($logoUrl)) { + // if logo is an uploaded file, try to fall back to HTTPS file URL + $httpUrl = common_config('site', 'logo'); + if (!empty($httpUrl)) { + $f = File::staticGet('url', $httpUrl); + if (!empty($f) && !empty($f->filename)) { + // this will handle the HTTPS case + $logoUrl = File::url($f->filename); + } + } + } + } else { + $logoUrl = common_config('site', 'logo'); + } + + if (empty($logoUrl) && file_exists(Theme::file('logo.png'))) { + // This should handle the HTTPS case internally + $logoUrl = Theme::path('logo.png'); + } + + if (!empty($logoUrl)) { + $action->element('img', array('class' => 'logo photo', + 'src' => $logoUrl, + 'alt' => common_config('site', 'name'))); + } + + $action->text(' '); + $action->element('span', array('class' => 'fn org'), common_config('site', 'name')); + $action->elementEnd('a'); + + Event::handle('EndAddressData', array($action)); + return false; + } + /** * Return version information for this plugin * -- 2.39.5