]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch '3cl' into 1.0.x
authorEvan Prodromou <evan@status.net>
Mon, 7 Mar 2011 19:30:30 +0000 (14:30 -0500)
committerEvan Prodromou <evan@status.net>
Mon, 7 Mar 2011 19:30:30 +0000 (14:30 -0500)
37 files changed:
actions/all.php
actions/blockedfromgroup.php
actions/editgroup.php
actions/favorited.php
actions/featured.php
actions/groupdesignsettings.php
actions/grouplogo.php
actions/groupmembers.php
actions/groups.php
actions/invite.php
actions/public.php
actions/publictagcloud.php
actions/replies.php
actions/showfavorites.php
actions/showgroup.php
actions/showstream.php
actions/usergroups.php
lib/action.php
lib/adminpanelaction.php
lib/adminpanelnav.php [new file with mode: 0644]
lib/defaultlocalnav.php [new file with mode: 0644]
lib/galleryaction.php
lib/groupnav.php
lib/logingroupnav.php
lib/mailbox.php
lib/mailboxmenu.php [new file with mode: 0644]
lib/menu.php [new file with mode: 0644]
lib/personalgroupnav.php
lib/primarynav.php [new file with mode: 0644]
lib/publicgroupnav.php
lib/searchaction.php
lib/searchgroupnav.php
lib/secondarynav.php [new file with mode: 0644]
lib/settingsaction.php
lib/settingsnav.php
lib/subgroupnav.php
lib/userprofile.php

index 2936df4599a7ffac1088bc6faa337fffb2e93aed..2826319c0d9e59ffc56c0de40e9d561efdc418f0 100644 (file)
@@ -127,12 +127,6 @@ class AllAction extends ProfileAction
         );
     }
 
-    function showLocalNav()
-    {
-        $nav = new PersonalGroupNav($this);
-        $nav->show();
-    }
-
     function showEmptyListMessage()
     {
         // TRANS: Empty list message. %s is a user nickname.
index 6ff572c05d9dea64a4723b059f9d756fe1c6a1eb..dd916b170a09a88ece9b565caefcf64efc592266 100644 (file)
@@ -122,7 +122,7 @@ class BlockedfromgroupAction extends GroupDesignAction
                        _('A list of the users blocked from joining this group.'));
     }
 
-    function showLocalNav()
+    function showObjectNav()
     {
         $nav = new GroupNav($this, $this->group);
         $nav->show();
index 0e041700511360d29b493541dee9b3d521978367..08a75da12c690658d2413ecd271c65b36ad1405e 100644 (file)
@@ -139,7 +139,7 @@ class EditgroupAction extends GroupDesignAction
         $this->showPage();
     }
 
-    function showLocalNav()
+    function showObjectNav()
     {
         $nav = new GroupNav($this, $this->group);
         $nav->show();
index c137cf424f91f0e3f8d81681fb01de8441af36ae..17c2a58c946145181526d47e2c94f62b47218e0a 100644 (file)
@@ -163,19 +163,6 @@ class FavoritedAction extends Action
         $this->elementEnd('div');
     }
 
-    /**
-     * Local navigation
-     *
-     * This page is part of the public group, so show that.
-     *
-     * @return void
-     */
-    function showLocalNav()
-    {
-        $nav = new PublicGroupNav($this);
-        $nav->show();
-    }
-
     /**
      * Content area
      *
index 9a7f128b5739de3f1a150ba37b2b465e03fc2229..394cfe6a8b9ef456325179533a3e5c00dbb48cc5 100644 (file)
@@ -90,12 +90,6 @@ class FeaturedAction extends Action
         $this->elementEnd('div');
     }
 
-    function showLocalNav()
-    {
-        $nav = new PublicGroupNav($this);
-        $nav->show();
-    }
-
     function getInstructions()
     {
         // TRANS: Description on page displaying featured users.
index 3ef5e20e442420d4ab40ecaf5da8bb95440220c3..798064d16ca106e009929771e1cdeeaeb77f3ad0 100644 (file)
@@ -163,12 +163,22 @@ class GroupDesignSettingsAction extends DesignSettingsAction
      *
      * @return nothing
      */
-    function showLocalNav()
+    function showObjectNav()
     {
         $nav = new GroupNav($this, $this->group);
         $nav->show();
     }
 
+    /**
+     * Override to show default nav stuff
+     *
+     * @return nothing
+     */
+    function showLocalNav()
+    {
+        Action::showLocalNav();
+    }
+
     /**
      * Get the design we want to edit
      *
index d490cd9875f53767b6261189555a7af5f1e41112..db0d40ff0c1036049bac9d6d66f5970bbdc3be48 100644 (file)
@@ -458,7 +458,7 @@ class GrouplogoAction extends GroupDesignAction
         $this->autofocus('avatarfile');
     }
 
-    function showLocalNav()
+    function showObjectNav()
     {
         $nav = new GroupNav($this, $this->group);
         $nav->show();
index 7b1512dfab5cce8aa1f8e8e555bc655e7d8759e1..e280fd1fd136a9fb02df003fee08305a90a628cb 100644 (file)
@@ -125,7 +125,7 @@ class GroupmembersAction extends GroupDesignAction
                        _('A list of the users in this group.'));
     }
 
-    function showLocalNav()
+    function showObjectNav()
     {
         $nav = new GroupNav($this, $this->group);
         $nav->show();
index 958c5921bf985a112c78a53ad1ff6fe03181e08c..d1bc8d94583bd67169dfaad27d7bde211d1934a1 100644 (file)
@@ -80,12 +80,6 @@ class GroupsAction extends Action
         $this->showPage();
     }
 
-    function showLocalNav()
-    {
-        $nav = new PublicGroupNav($this);
-        $nav->show();
-    }
-
     function showPageNotice()
     {
         $notice =
index a2a0e0714a8ff697b569bc40f3413c259904559e..c64ff8adda32a4f3b2b29eec87696e196246393c 100644 (file)
@@ -289,7 +289,7 @@ class InviteAction extends CurrentUserDesignAction
         mail_send($recipients, $headers, $body);
     }
 
-    function showLocalNav()
+    function showObjectNav()
     {
         $nav = new SubGroupNav($this, common_current_user());
         $nav->show();
index 727c76d528a3531543b752fe07704c18dac04b4f..adeb58b0ee05126517c8cdb3ef49287226ab5b4a 100644 (file)
@@ -168,21 +168,6 @@ class PublicAction extends Action
                               _('Public Stream Feed (Atom)')));
     }
 
-    /**
-     * Show tabset for this page
-     *
-     * Uses the PublicGroupNav widget
-     *
-     * @return void
-     * @see PublicGroupNav
-     */
-
-    function showLocalNav()
-    {
-        $nav = new PublicGroupNav($this);
-        $nav->show();
-    }
-
     function showEmptyList()
     {
         $message = _('This is the public timeline for %%site.name%% but no one has posted anything yet.') . ' ';
index f6f1d31625e65c376fb0a61db748bc42e30d3ff4..1432ca66a89781821f8d899f44be308c2fa6a78b 100644 (file)
@@ -92,12 +92,6 @@ class PublictagcloudAction extends Action
         $this->elementEnd('div');
     }
 
-    function showLocalNav()
-    {
-        $nav = new PublicGroupNav($this);
-        $nav->show();
-    }
-
     function handle($args)
     {
         parent::handle($args);
index 8f2fc6c7f378c71b3481560c95ae6876210fed51..fd178175d2be107efb344c623f7491e4a2edb526 100644 (file)
@@ -160,18 +160,6 @@ class RepliesAction extends OwnerDesignAction
                                     $this->user->nickname)));
     }
 
-    /**
-     * show the personal group nav
-     *
-     * @return void
-     */
-
-    function showLocalNav()
-    {
-        $nav = new PersonalGroupNav($this);
-        $nav->show();
-    }
-
     /**
      * Show the content
      *
index eda2cf38ebe3fc83db5cbdb93263149040e536d8..67ee914a914a7283b83076b4e31cb8bc816641d7 100644 (file)
@@ -189,17 +189,6 @@ class ShowfavoritesAction extends OwnerDesignAction
                                       $this->user->nickname)));
     }
 
-    /**
-     * show the personal group nav
-     *
-     * @return void
-     */
-    function showLocalNav()
-    {
-        $nav = new PersonalGroupNav($this);
-        $nav->show();
-    }
-
     function showEmptyListMessage()
     {
         if (common_logged_in()) {
index a38945c131b790c2f7b5d1f15e091020afe4c4d5..411940ef9a2ed124a036e2db7d3fa53664aca0e2 100644 (file)
@@ -167,7 +167,7 @@ class ShowgroupAction extends GroupDesignAction
      *
      * @return void
      */
-    function showLocalNav()
+    function showObjectNav()
     {
         $nav = new GroupNav($this, $this->group);
         $nav->show();
index 0fd1c2c29fc43756a3d01c446c6411e325f496f3..afde49ecea36694bb9caceadd76fec36eeb75428 100644 (file)
@@ -104,7 +104,7 @@ class ShowstreamAction extends ProfileAction
         $this->showNotices();
     }
 
-    function showLocalNav()
+    function showObjectNav()
     {
         $nav = new SubGroupNav($this, $this->user);
         $nav->show();
index 6606e76cdb907c641bf8594dbf4fb34c66111e17..cf904bc9292424966d50bfb3f4a9e9210cb80a2c 100644 (file)
@@ -112,7 +112,7 @@ class UsergroupsAction extends OwnerDesignAction
         $this->showPage();
     }
 
-    function showLocalNav()
+    function showObjectNav()
     {
         $nav = new SubGroupNav($this, $this->user);
         $nav->show();
index b7f0036699ee2bae26794839a2ec2e88ec9b5ee9..e7c55ef10cdbbf762089f76940bd0bfb319a64fe 100644 (file)
@@ -476,14 +476,7 @@ class Action extends HTMLOutputter // lawsuit
 
             Event::handle('EndShowSiteNotice', array($this));
         }
-        if (common_logged_in()) {
-            if (Event::handle('StartShowNoticeForm', array($this))) {
-                $this->showNoticeForm();
-                Event::handle('EndShowNoticeForm', array($this));
-            }
-        } else {
-            $this->showAnonymousMessage();
-        }
+
         $this->elementEnd('div');
     }
 
@@ -555,69 +548,10 @@ class Action extends HTMLOutputter // lawsuit
      */
     function showPrimaryNav()
     {
-        $user = common_current_user();
-        $this->elementStart('ul', array('class' => 'nav',
-                                        'id' => 'site_nav_global_primary'));
-        if (Event::handle('StartPrimaryNav', array($this))) {
-            if (!empty($user)) {
-                $this->menuItem(common_local_url('all', 
-                                                 array('nickname' => $user->nickname)),
-                                _m('Home'),
-                                _m('Friends timeline'),
-                                false,
-                                'nav_home');
-                $this->menuItem(common_local_url('showstream', 
-                                                 array('nickname' => $user->nickname)),
-                                _m('Profile'),
-                                _m('Your profile'),
-                                false,
-                                'nav_profile');
-                $this->menuItem(common_local_url('public'),
-                                _m('Public'),
-                                _m('Everyone on this site'),
-                                false,
-                                'nav_public');
-                $this->menuItem(common_local_url('profilesettings'),
-                                _m('Settings'),
-                                _m('Change your personal settings'),
-                                false,
-                                'nav_account');
-                if ($user->hasRight(Right::CONFIGURESITE)) {
-                    $this->menuItem(common_local_url('siteadminpanel'),
-                                    _m('Admin'), 
-                                    _m('Site configuration'),
-                                    false,
-                                    'nav_admin');
-                }
-                $this->menuItem(common_local_url('logout'),
-                                _m('Logout'), 
-                                _m('Logout from the site'),
-                                false,
-                                'nav_logout');
-            } else {
-                $this->menuItem(common_local_url('public'),
-                                _m('Public'),
-                                _m('Everyone on this site'),
-                                false,
-                                'nav_public');
-                $this->menuItem(common_local_url('login'),
-                                _m('Login'), 
-                                _m('Login to the site'),
-                                false,
-                                'nav_login');
-            }
-
-            if (!empty($user) || !common_config('site', 'private')) {
-                $this->menuItem(common_local_url('noticesearch'),
-                                _m('Search'),
-                                _m('Search the site'),
-                                false,
-                                'nav_search');
-            }
-
-            Event::handle('EndPrimaryNav', array($this));
-        }
-        $this->elementEnd('ul');
+        $this->elementStart('div', array('id' => 'site_nav_global_primary'));
+        $pn = new PrimaryNav($this);
+        $pn->show();
+        $this->elementEnd('div');
     }
 
     /**
@@ -733,6 +667,10 @@ class Action extends HTMLOutputter // lawsuit
             $this->showContentBlock();
             Event::handle('EndShowContentBlock', array($this));
         }
+        if (Event::handle('StartShowObjectNavBlock', array($this))) {
+            $this->showObjectNavBlock();
+            Event::handle('EndShowObjectNavBlock', array($this));
+        }
         if (Event::handle('StartShowAside', array($this))) {
             $this->showAside();
             Event::handle('EndShowAside', array($this));
@@ -763,7 +701,34 @@ class Action extends HTMLOutputter // lawsuit
      */
     function showLocalNav()
     {
-        // does nothing by default
+        $nav = new DefaultLocalNav($this);
+        $nav->show();
+    }
+
+    /**
+     * Show menu for an object (group, profile)
+     *
+     * @return nothing
+     */
+    function showObjectNavBlock()
+    {
+        // Need to have this ID for CSS; I'm too lazy to add it to
+        // all menus
+        $this->elementStart('div', array('id' => 'site_nav_object'));
+        $this->showObjectNav();
+        $this->elementEnd('div');
+    }
+
+    /**
+     * Show object navigation.
+     *
+     * If there are things to do with this object, show it here.
+     *
+     * @return nothing
+     */
+    function showObjectNav()
+    {
+        /* Nothing here. */
     }
 
     /**
@@ -774,6 +739,12 @@ class Action extends HTMLOutputter // lawsuit
     function showContentBlock()
     {
         $this->elementStart('div', array('id' => 'content'));
+        if (common_logged_in()) {
+            if (Event::handle('StartShowNoticeForm', array($this))) {
+                $this->showNoticeForm();
+                Event::handle('EndShowNoticeForm', array($this));
+            }
+        }
         if (Event::handle('StartShowPageTitle', array($this))) {
             $this->showPageTitle();
             Event::handle('EndShowPageTitle', array($this));
@@ -915,43 +886,8 @@ class Action extends HTMLOutputter // lawsuit
      */
     function showSecondaryNav()
     {
-        $this->elementStart('ul', array('class' => 'nav',
-                                        'id' => 'site_nav_global_secondary'));
-        if (Event::handle('StartSecondaryNav', array($this))) {
-            $this->menuItem(common_local_url('doc', array('title' => 'help')),
-                            // TRANS: Secondary navigation menu option leading to help on StatusNet.
-                            _('Help'));
-            $this->menuItem(common_local_url('doc', array('title' => 'about')),
-                            // TRANS: Secondary navigation menu option leading to text about StatusNet site.
-                            _('About'));
-            $this->menuItem(common_local_url('doc', array('title' => 'faq')),
-                            // TRANS: Secondary navigation menu option leading to Frequently Asked Questions.
-                            _('FAQ'));
-            $bb = common_config('site', 'broughtby');
-            if (!empty($bb)) {
-                $this->menuItem(common_local_url('doc', array('title' => 'tos')),
-                                // TRANS: Secondary navigation menu option leading to Terms of Service.
-                                _('TOS'));
-            }
-            $this->menuItem(common_local_url('doc', array('title' => 'privacy')),
-                            // TRANS: Secondary navigation menu option leading to privacy policy.
-                            _('Privacy'));
-            $this->menuItem(common_local_url('doc', array('title' => 'source')),
-                            // TRANS: Secondary navigation menu option. Leads to information about StatusNet and its license.
-                            _('Source'));
-            $this->menuItem(common_local_url('version'),
-                            // TRANS: Secondary navigation menu option leading to version information on the StatusNet site.
-                            _('Version'));
-            $this->menuItem(common_local_url('doc', array('title' => 'contact')),
-                            // TRANS: Secondary navigation menu option leading to e-mail contact information on the
-                            // TRANS: StatusNet site, where to report bugs, ...
-                            _('Contact'));
-            $this->menuItem(common_local_url('doc', array('title' => 'badge')),
-                            // TRANS: Secondary navigation menu option. Leads to information about embedding a timeline widget.
-                            _('Badge'));
-            Event::handle('EndSecondaryNav', array($this));
-        }
-        $this->elementEnd('ul');
+        $sn = new SecondaryNav($this);
+        $sn->show();
     }
 
     /**
index 8dd16e9d0ce6a2b1d1e8b2abdd6f712257c1561c..a085fcd5dc2db3657d19aa877734750e385a5389 100644 (file)
@@ -291,129 +291,3 @@ class AdminPanelAction extends Action
         return $isOK;
     }
 }
-
-/**
- * Menu for public group of actions
- *
- * @category Output
- * @package  StatusNet
- * @author   Evan Prodromou <evan@status.net>
- * @author   Sarven Capadisli <csarven@status.net>
- * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link     http://status.net/
- *
- * @see      Widget
- */
-class AdminPanelNav extends Widget
-{
-    var $action = null;
-
-    /**
-     * Construction
-     *
-     * @param Action $action current action, used for output
-     */
-    function __construct($action=null)
-    {
-        parent::__construct($action);
-        $this->action = $action;
-    }
-
-    /**
-     * Show the menu
-     *
-     * @return void
-     */
-    function show()
-    {
-        $action_name = $this->action->trimmed('action');
-
-        $this->action->elementStart('ul', array('class' => 'nav'));
-
-        if (Event::handle('StartAdminPanelNav', array($this))) {
-
-            if (AdminPanelAction::canAdmin('site')) {
-                // TRANS: Menu item title/tooltip
-                $menu_title = _('Basic site configuration');
-                // TRANS: Menu item for site administration
-                $this->out->menuItem(common_local_url('siteadminpanel'), _m('MENU', 'Site'),
-                                     $menu_title, $action_name == 'siteadminpanel', 'nav_site_admin_panel');
-            }
-
-            if (AdminPanelAction::canAdmin('design')) {
-                // TRANS: Menu item title/tooltip
-                $menu_title = _('Design configuration');
-                // TRANS: Menu item for site administration
-                $this->out->menuItem(common_local_url('designadminpanel'), _m('MENU', 'Design'),
-                                     $menu_title, $action_name == 'designadminpanel', 'nav_design_admin_panel');
-            }
-
-            if (AdminPanelAction::canAdmin('user')) {
-                // TRANS: Menu item title/tooltip
-                $menu_title = _('User configuration');
-                // TRANS: Menu item for site administration
-                $this->out->menuItem(common_local_url('useradminpanel'), _('User'),
-                                     $menu_title, $action_name == 'useradminpanel', 'nav_user_admin_panel');
-            }
-
-            if (AdminPanelAction::canAdmin('access')) {
-                // TRANS: Menu item title/tooltip
-                $menu_title = _('Access configuration');
-                // TRANS: Menu item for site administration
-                $this->out->menuItem(common_local_url('accessadminpanel'), _('Access'),
-                                     $menu_title, $action_name == 'accessadminpanel', 'nav_access_admin_panel');
-            }
-
-            if (AdminPanelAction::canAdmin('paths')) {
-                // TRANS: Menu item title/tooltip
-                $menu_title = _('Paths configuration');
-                // TRANS: Menu item for site administration
-                $this->out->menuItem(common_local_url('pathsadminpanel'), _('Paths'),
-                                    $menu_title, $action_name == 'pathsadminpanel', 'nav_paths_admin_panel');
-            }
-
-            if (AdminPanelAction::canAdmin('sessions')) {
-                // TRANS: Menu item title/tooltip
-                $menu_title = _('Sessions configuration');
-                // TRANS: Menu item for site administration
-                $this->out->menuItem(common_local_url('sessionsadminpanel'), _('Sessions'),
-                                     $menu_title, $action_name == 'sessionsadminpanel', 'nav_sessions_admin_panel');
-            }
-
-            if (AdminPanelAction::canAdmin('sitenotice')) {
-                // TRANS: Menu item title/tooltip
-                $menu_title = _('Edit site notice');
-                // TRANS: Menu item for site administration
-                $this->out->menuItem(common_local_url('sitenoticeadminpanel'), _('Site notice'),
-                                     $menu_title, $action_name == 'sitenoticeadminpanel', 'nav_sitenotice_admin_panel');
-            }
-
-            if (AdminPanelAction::canAdmin('snapshot')) {
-                // TRANS: Menu item title/tooltip
-                $menu_title = _('Snapshots configuration');
-                // TRANS: Menu item for site administration
-                $this->out->menuItem(common_local_url('snapshotadminpanel'), _('Snapshots'),
-                                     $menu_title, $action_name == 'snapshotadminpanel', 'nav_snapshot_admin_panel');
-            }
-
-            if (AdminPanelAction::canAdmin('license')) {
-                // TRANS: Menu item title/tooltip
-                $menu_title = _('Set site license');
-                // TRANS: Menu item for site administration
-                $this->out->menuItem(common_local_url('licenseadminpanel'), _('License'),
-                                     $menu_title, $action_name == 'licenseadminpanel', 'nav_license_admin_panel');
-            }
-
-            if (AdminPanelAction::canAdmin('plugins')) {
-                // TRANS: Menu item title/tooltip
-                $menu_title = _('Plugins configuration');
-                // TRANS: Menu item for site administration
-                $this->out->menuItem(common_local_url('pluginsadminpanel'), _('Plugins'),
-                                     $menu_title, $action_name == 'pluginsadminpanel', 'nav_design_admin_panel');
-            }
-
-            Event::handle('EndAdminPanelNav', array($this));
-        }
-        $this->action->elementEnd('ul');
-    }
-}
diff --git a/lib/adminpanelnav.php b/lib/adminpanelnav.php
new file mode 100644 (file)
index 0000000..ceedf6c
--- /dev/null
@@ -0,0 +1,148 @@
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Menu for admin panels
+ * 
+ * PHP version 5
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category  Menu
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+    // This check helps protect against security problems;
+    // your code file can't be executed directly from the web.
+    exit(1);
+}
+
+/**
+ * Menu for admin panels
+ *
+ * @category Output
+ * @package  StatusNet
+ * @author   Evan Prodromou <evan@status.net>
+ * @author   Sarven Capadisli <csarven@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link     http://status.net/
+ */
+
+class AdminPanelNav extends Menu
+{
+    /**
+     * Show the menu
+     *
+     * @return void
+     */
+    function show()
+    {
+        $action_name = $this->action->trimmed('action');
+
+        $this->action->elementStart('ul', array('class' => 'nav'));
+
+        if (Event::handle('StartAdminPanelNav', array($this))) {
+
+            if (AdminPanelAction::canAdmin('site')) {
+                // TRANS: Menu item title/tooltip
+                $menu_title = _('Basic site configuration');
+                // TRANS: Menu item for site administration
+                $this->out->menuItem(common_local_url('siteadminpanel'), _m('MENU', 'Site'),
+                                     $menu_title, $action_name == 'siteadminpanel', 'nav_site_admin_panel');
+            }
+
+            if (AdminPanelAction::canAdmin('design')) {
+                // TRANS: Menu item title/tooltip
+                $menu_title = _('Design configuration');
+                // TRANS: Menu item for site administration
+                $this->out->menuItem(common_local_url('designadminpanel'), _m('MENU', 'Design'),
+                                     $menu_title, $action_name == 'designadminpanel', 'nav_design_admin_panel');
+            }
+
+            if (AdminPanelAction::canAdmin('user')) {
+                // TRANS: Menu item title/tooltip
+                $menu_title = _('User configuration');
+                // TRANS: Menu item for site administration
+                $this->out->menuItem(common_local_url('useradminpanel'), _('User'),
+                                     $menu_title, $action_name == 'useradminpanel', 'nav_user_admin_panel');
+            }
+
+            if (AdminPanelAction::canAdmin('access')) {
+                // TRANS: Menu item title/tooltip
+                $menu_title = _('Access configuration');
+                // TRANS: Menu item for site administration
+                $this->out->menuItem(common_local_url('accessadminpanel'), _('Access'),
+                                     $menu_title, $action_name == 'accessadminpanel', 'nav_access_admin_panel');
+            }
+
+            if (AdminPanelAction::canAdmin('paths')) {
+                // TRANS: Menu item title/tooltip
+                $menu_title = _('Paths configuration');
+                // TRANS: Menu item for site administration
+                $this->out->menuItem(common_local_url('pathsadminpanel'), _('Paths'),
+                                    $menu_title, $action_name == 'pathsadminpanel', 'nav_paths_admin_panel');
+            }
+
+            if (AdminPanelAction::canAdmin('sessions')) {
+                // TRANS: Menu item title/tooltip
+                $menu_title = _('Sessions configuration');
+                // TRANS: Menu item for site administration
+                $this->out->menuItem(common_local_url('sessionsadminpanel'), _('Sessions'),
+                                     $menu_title, $action_name == 'sessionsadminpanel', 'nav_sessions_admin_panel');
+            }
+
+            if (AdminPanelAction::canAdmin('sitenotice')) {
+                // TRANS: Menu item title/tooltip
+                $menu_title = _('Edit site notice');
+                // TRANS: Menu item for site administration
+                $this->out->menuItem(common_local_url('sitenoticeadminpanel'), _('Site notice'),
+                                     $menu_title, $action_name == 'sitenoticeadminpanel', 'nav_sitenotice_admin_panel');
+            }
+
+            if (AdminPanelAction::canAdmin('snapshot')) {
+                // TRANS: Menu item title/tooltip
+                $menu_title = _('Snapshots configuration');
+                // TRANS: Menu item for site administration
+                $this->out->menuItem(common_local_url('snapshotadminpanel'), _('Snapshots'),
+                                     $menu_title, $action_name == 'snapshotadminpanel', 'nav_snapshot_admin_panel');
+            }
+
+            if (AdminPanelAction::canAdmin('license')) {
+                // TRANS: Menu item title/tooltip
+                $menu_title = _('Set site license');
+                // TRANS: Menu item for site administration
+                $this->out->menuItem(common_local_url('licenseadminpanel'), _('License'),
+                                     $menu_title, $action_name == 'licenseadminpanel', 'nav_license_admin_panel');
+            }
+
+            if (AdminPanelAction::canAdmin('plugins')) {
+                // TRANS: Menu item title/tooltip
+                $menu_title = _('Plugins configuration');
+                // TRANS: Menu item for site administration
+                $this->out->menuItem(common_local_url('pluginsadminpanel'), _('Plugins'),
+                                     $menu_title, $action_name == 'pluginsadminpanel', 'nav_design_admin_panel');
+            }
+
+            Event::handle('EndAdminPanelNav', array($this));
+        }
+        $this->action->elementEnd('ul');
+    }
+}
diff --git a/lib/defaultlocalnav.php b/lib/defaultlocalnav.php
new file mode 100644 (file)
index 0000000..7af3c96
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Default local nav
+ * 
+ * PHP version 5
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category  Menu
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+    // This check helps protect against security problems;
+    // your code file can't be executed directly from the web.
+    exit(1);
+}
+
+/**
+ * Default menu
+ *
+ * @category  Menu
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
+
+class DefaultLocalNav extends Menu
+{
+    function show()
+    {
+        $this->action->elementStart('ul', array('id' => 'nav_local_default'));
+
+        $user = common_current_user();
+
+        if (!empty($user)) {
+            $pn = new PersonalGroupNav($this->action);
+            $this->submenu(_m('Home'), $pn);
+        }
+
+        $bn = new PublicGroupNav($this->action);
+        $this->submenu(_('Public'), $bn);
+
+        $this->action->elementEnd('ul');
+    }
+}
index b8edbbb7ba84ba5d6319d1eed185e4b0c0525757..107134a09b205129e94dc87a78e61a3f6c34b147 100644 (file)
@@ -94,7 +94,7 @@ class GalleryAction extends OwnerDesignAction
         $this->showPage();
     }
 
-    function showLocalNav()
+    function showObjectNav()
     {
         $nav = new SubGroupNav($this, $this->user);
         $nav->show();
index ee988d0a98bcfbed50c8b5ad813377574fd8bdd7..a2dd6eac0087e39687049a2a836925b01c9d2311 100644 (file)
@@ -49,9 +49,8 @@ require_once INSTALLDIR.'/lib/widget.php';
  * @see      HTMLOutputter
  */
 
-class GroupNav extends Widget
+class GroupNav extends Menu
 {
-    var $action = null;
     var $group = null;
 
     /**
@@ -63,7 +62,6 @@ class GroupNav extends Widget
     function __construct($action=null, $group=null)
     {
         parent::__construct($action);
-        $this->action = $action;
         $this->group = $group;
     }
 
index a309e7320fda35e13c24a605bec13719fd320b0c..3c67f76322add99f5ebc0e6c186e2ea9638d3d3d 100644 (file)
@@ -44,21 +44,8 @@ require_once INSTALLDIR.'/lib/widget.php';
  *
  * @see      Widget
  */
-class LoginGroupNav extends Widget
+class LoginGroupNav extends Menu
 {
-    var $action = null;
-
-    /**
-     * Construction
-     *
-     * @param Action $action current action, used for output
-     */
-    function __construct($action=null)
-    {
-        parent::__construct($action);
-        $this->action = $action;
-    }
-
     /**
      * Show the menu
      *
index 7faeb7dba3b0365d0ba856e10e5285c29b52a106..cb56eb5904932a47c8c0b9b52582bc5741b881b3 100644 (file)
@@ -168,4 +168,10 @@ class MailboxAction extends CurrentUserDesignAction
     {
          return true;
     }
+
+    function showObjectNav()
+    {
+        $mm = new MailboxMenu($this);
+        $mm->show();
+    }
 }
diff --git a/lib/mailboxmenu.php b/lib/mailboxmenu.php
new file mode 100644 (file)
index 0000000..d2d3607
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Private mailboxes menu
+ * 
+ * PHP version 5
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category  Cache
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+    // This check helps protect against security problems;
+    // your code file can't be executed directly from the web.
+    exit(1);
+}
+
+/**
+ * Menu of existing mailboxes
+ *
+ * @category  General
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
+
+class MailboxMenu extends Menu
+{
+    function show()
+    {
+        $cur = common_current_user();
+        $nickname = $cur->nickname;
+
+        $this->out->elementStart('ul', array('class' => 'nav'));
+
+        $this->item('inbox',
+                    array('nickname' => $nickname),
+                    _('Inbox'),
+                    _('Your incoming messages'));
+
+        $this->item('outbox',
+                    array('nickname' => $nickname),
+                    _('Outbox'),
+                    _('Your sent messages'));
+
+        $this->out->elementEnd('ul');
+    }
+
+}
diff --git a/lib/menu.php b/lib/menu.php
new file mode 100644 (file)
index 0000000..2713b44
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Menu widget
+ * 
+ * PHP version 5
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category  Widget
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+    // This check helps protect against security problems;
+    // your code file can't be executed directly from the web.
+    exit(1);
+}
+
+/**
+ * Superclass for menus
+ *
+ * @category  General
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
+
+class Menu extends Widget
+{
+    var $action     = null;
+    var $actionName = null;
+    /**
+     * Construction
+     *
+     * @param Action $action current action, used for output
+     */
+    function __construct($action=null)
+    {
+        parent::__construct($action);
+
+        $this->action     = $action;
+        $this->actionName = $action->trimmed('action');
+    }
+
+    function item($actionName, $args, $label, $description, $id=null)
+    {
+        if (empty($id)) {
+            $id = $this->menuItemID($actionName);
+        }
+
+        $url = common_local_url($actionName, $args);
+
+        $this->out->menuItem($url,
+                             $label,
+                             $description,
+                             $actionName == $this->actionName,
+                             $id);
+    }
+
+    function menuItemID($actionName)
+    {
+        return sprintf('nav_%s', $actionName);
+    }
+
+    function submenu($label, $menu)
+    {
+        $this->action->elementStart('li');
+        $this->action->element('h3', null, $label);
+        $menu->show();
+        $this->action->elementEnd('li');
+    }
+}
index 72d0893af732a3574b1593e5c70a41befc608338..9d78857c6da252fdcb67a32b3bb2c2450e01427a 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * StatusNet, the distributed open-source microblogging tool
  *
- * Base class for all actions (~views)
+ * Menu for personal group of actions
  *
  * PHP version 5
  *
  * You should have received a copy of the GNU Affero General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
- * @category  Action
+ * @category  Menu
  * @package   StatusNet
  * @author    Evan Prodromou <evan@status.net>
  * @author    Sarven Capadisli <csarven@status.net>
- * @copyright 2008 StatusNet, Inc.
+ * @copyright 2008-2011 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link      http://status.net/
  */
@@ -32,41 +32,20 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
-require_once INSTALLDIR.'/lib/widget.php';
-
 /**
- * Base class for all actions
- *
- * This is the base class for all actions in the package. An action is
- * more or less a "view" in an MVC framework.
- *
- * Actions are responsible for extracting and validating parameters; using
- * model classes to read and write to the database; and doing ouput.
+ * Menu for personal group of actions
  *
- * @category Output
+ * @category Menu
  * @package  StatusNet
  * @author   Evan Prodromou <evan@status.net>
  * @author   Sarven Capadisli <csarven@status.net>
+ * @copyright 2008-2011 StatusNet, Inc.
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
- *
- * @see      HTMLOutputter
  */
-class PersonalGroupNav extends Widget
-{
-    var $action = null;
-
-    /**
-     * Construction
-     *
-     * @param Action $action current action, used for output
-     */
-    function __construct($action=null)
-    {
-        parent::__construct($action);
-        $this->action = $action;
-    }
 
+class PersonalGroupNav extends Menu
+{
     /**
      * Show the menu
      *
@@ -74,23 +53,16 @@ class PersonalGroupNav extends Widget
      */
     function show()
     {
-        $user = null;
-
-        // FIXME: we should probably pass this in
-
-        $action = $this->action->trimmed('action');
-        $nickname = $this->action->trimmed('nickname');
+        $user         = common_current_user();
 
-        if ($nickname) {
-            $user = User::staticGet('nickname', $nickname);
-            $user_profile = $user->getProfile();
-            $name = $user_profile->getBestName();
-        } else {
-            // @fixme can this happen? is this valid?
-            $user_profile = false;
-            $name = $nickname;
+        if (empty($user)) {
+            throw new ServerException('Do not show personal group nav with no current user.');
         }
 
+        $user_profile = $user->getProfile();
+        $nickname     = $user->nickname;
+        $name         = $user_profile->getBestName();
+
         $this->out->elementStart('ul', array('class' => 'nav'));
 
         if (Event::handle('StartPersonalGroupNav', array($this))) {
@@ -99,6 +71,12 @@ class PersonalGroupNav extends Widget
                                  _('Home'),
                                  sprintf(_('%s and friends'), $name),
                                  $action == 'all', 'nav_timeline_personal');
+            $this->out->menuItem(common_local_url('showstream', array('nickname' =>
+                                                                      $nickname)),
+                                 _('Profile'),
+                                 _('Your profile'),
+                                 $action == 'showstream',
+                                 'nav_profile');
             $this->out->menuItem(common_local_url('replies', array('nickname' =>
                                                                    $nickname)),
                                  _('Replies'),
@@ -117,15 +95,11 @@ class PersonalGroupNav extends Widget
 
                 $this->out->menuItem(common_local_url('inbox', array('nickname' =>
                                                                      $nickname)),
-                                     _('Inbox'),
+                                     _('Messages'),
                                      _('Your incoming messages'),
                                      $action == 'inbox');
-                $this->out->menuItem(common_local_url('outbox', array('nickname' =>
-                                                                      $nickname)),
-                                     _('Outbox'),
-                                     _('Your sent messages'),
-                                     $action == 'outbox');
             }
+
             Event::handle('EndPersonalGroupNav', array($this));
         }
         $this->out->elementEnd('ul');
diff --git a/lib/primarynav.php b/lib/primarynav.php
new file mode 100644 (file)
index 0000000..7748d7a
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Primary nav, show on all pages
+ * 
+ * PHP version 5
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category  Menu
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+    // This check helps protect against security problems;
+    // your code file can't be executed directly from the web.
+    exit(1);
+}
+
+/**
+ * Primary, top-level menu
+ *
+ * @category  General
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
+
+class PrimaryNav extends Menu
+{
+    function show()
+    {
+        $user = common_current_user();
+        $this->action->elementStart('ul', array('class' => 'nav'));
+        if (Event::handle('StartPrimaryNav', array($this->action))) {
+            if (!empty($user)) {
+                $this->action->menuItem(common_local_url('profilesettings'),
+                                _m('Settings'),
+                                _m('Change your personal settings'),
+                                false,
+                                'nav_account');
+                if ($user->hasRight(Right::CONFIGURESITE)) {
+                    $this->action->menuItem(common_local_url('siteadminpanel'),
+                                    _m('Admin'), 
+                                    _m('Site configuration'),
+                                    false,
+                                    'nav_admin');
+                }
+                $this->action->menuItem(common_local_url('logout'),
+                                _m('Logout'), 
+                                _m('Logout from the site'),
+                                false,
+                                'nav_logout');
+            } else {
+                $this->action->menuItem(common_local_url('login'),
+                                _m('Login'), 
+                                _m('Login to the site'),
+                                false,
+                                'nav_login');
+            }
+
+            if (!empty($user) || !common_config('site', 'private')) {
+                $this->action->menuItem(common_local_url('noticesearch'),
+                                _m('Search'),
+                                _m('Search the site'),
+                                false,
+                                'nav_search');
+            }
+
+            Event::handle('EndPrimaryNav', array($this->action));
+        }
+
+        $this->action->elementEnd('ul');
+    }
+}
index ae9cbdebb491dd8f4c4f97f11f16857c80d33b48..bd2ad5312419467b243090491019e49e8415db05 100644 (file)
@@ -46,22 +46,8 @@ require_once INSTALLDIR.'/lib/widget.php';
  * @see      Widget
  */
 
-class PublicGroupNav extends Widget
+class PublicGroupNav extends Menu
 {
-    var $action = null;
-
-    /**
-     * Construction
-     *
-     * @param Action $action current action, used for output
-     */
-
-    function __construct($action=null)
-    {
-        parent::__construct($action);
-        $this->action = $action;
-    }
-
     /**
      * Show the menu
      *
index 67d0bcdeb84c57598c7d11ce99650d7daaa03e38..73c287eef3b62e5b8d24cd77e666468f9a4d55db 100644 (file)
@@ -70,7 +70,7 @@ class SearchAction extends Action
      * @return void
      * @see SearchGroupNav
      */
-    function showLocalNav()
+    function showObjectNav()
     {
         $nav = new SearchGroupNav($this, $this->trimmed('q'));
         $nav->show();
index e843dc096ca408f8a7f008cffd50749357a1d26a..cfe8fde3535e925a8ed6a9a57fd3bb7757ec39d0 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * StatusNet, the distributed open-source microblogging tool
  *
- * Menu for search actions
+ * Menu for search group of actions
  *
  * PHP version 5
  *
@@ -22,7 +22,7 @@
  * @category  Menu
  * @package   StatusNet
  * @author    Evan Prodromou <evan@status.net>
- * @copyright 2008 StatusNet, Inc.
+ * @copyright 2008-2011 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link      http://status.net/
  */
@@ -31,12 +31,10 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
-require_once INSTALLDIR.'/lib/widget.php';
-
 /**
  * Menu for public group of actions
  *
- * @category Output
+ * @category Menu
  * @package  StatusNet
  * @author   Evan Prodromou <evan@status.net>
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
@@ -45,9 +43,8 @@ require_once INSTALLDIR.'/lib/widget.php';
  * @see      Widget
  */
 
-class SearchGroupNav extends Widget
+class SearchGroupNav extends Menu
 {
-    var $action = null;
     var $q = null;
 
     /**
@@ -59,7 +56,6 @@ class SearchGroupNav extends Widget
     function __construct($action=null, $q = null)
     {
         parent::__construct($action);
-        $this->action = $action;
         $this->q = $q;
     }
 
diff --git a/lib/secondarynav.php b/lib/secondarynav.php
new file mode 100644 (file)
index 0000000..542de51
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Secondary menu, shown at foot of all pages
+ * 
+ * PHP version 5
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category  Cache
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+    // This check helps protect against security problems;
+    // your code file can't be executed directly from the web.
+    exit(1);
+}
+
+/**
+ * Secondary menu, shown at the bottom of all pages
+ *
+ * @category  General
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
+
+class SecondaryNav extends Menu
+{
+    function show()
+    {
+        $this->out->elementStart('ul', array('class' => 'nav',
+                                             'id' => 'site_nav_global_secondary'));
+        if (Event::handle('StartSecondaryNav', array($this->action))) {
+            $this->out->menuItem(common_local_url('doc', array('title' => 'help')),
+                                 // TRANS: Secondary navigation menu option leading to help on StatusNet.
+                                 _('Help'));
+            $this->out->menuItem(common_local_url('doc', array('title' => 'about')),
+                                 // TRANS: Secondary navigation menu option leading to text about StatusNet site.
+                                 _('About'));
+            $this->out->menuItem(common_local_url('doc', array('title' => 'faq')),
+                                 // TRANS: Secondary navigation menu option leading to Frequently Asked Questions.
+                                 _('FAQ'));
+            $bb = common_config('site', 'broughtby');
+            if (!empty($bb)) {
+                $this->out->menuItem(common_local_url('doc', array('title' => 'tos')),
+                                     // TRANS: Secondary navigation menu option leading to Terms of Service.
+                                     _('TOS'));
+            }
+            $this->out->menuItem(common_local_url('doc', array('title' => 'privacy')),
+                                 // TRANS: Secondary navigation menu option leading to privacy policy.
+                                 _('Privacy'));
+            $this->out->menuItem(common_local_url('doc', array('title' => 'source')),
+                                 // TRANS: Secondary navigation menu option. Leads to information about StatusNet and its license.
+                                 _('Source'));
+            $this->out->menuItem(common_local_url('version'),
+                                 // TRANS: Secondary navigation menu option leading to version information on the StatusNet site.
+                                 _('Version'));
+            $this->out->menuItem(common_local_url('doc', array('title' => 'contact')),
+                                 // TRANS: Secondary navigation menu option leading to e-mail contact information on the
+                                 // TRANS: StatusNet site, where to report bugs, ...
+                                 _('Contact'));
+            $this->out->menuItem(common_local_url('doc', array('title' => 'badge')),
+                                 // TRANS: Secondary navigation menu option. Leads to information about embedding a timeline widget.
+                                 _('Badge'));
+            Event::handle('EndSecondaryNav', array($this->action));
+        }
+        $this->out->elementEnd('ul');
+    }
+}
\ No newline at end of file
index 8c00054dcb6323441b8e7079b5839dd592c26940..dc60137ab4405c50ab8da8071630d8dc3b239371 100644 (file)
@@ -163,4 +163,15 @@ class SettingsAction extends CurrentUserDesignAction
         $menu = new SettingsNav($this);
         $menu->show();
     }
+
+    /**
+     * Show notice form.
+     *
+     * @return nothing
+     */
+
+    function showNoticeForm()
+    {
+        return;
+    }
 }
index a73f73f86a0d0a22b2969e07a866573d5abce7f3..697e7ee46bc6a985e6e0fbc45b1ecbbb13ca917b 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * StatusNet - the distributed open-source microblogging tool
- * Copyright (C) 2010, StatusNet, Inc.
+ * Copyright (C) 2010,2011, StatusNet, Inc.
  *
  * Settings menu
  * 
@@ -23,7 +23,7 @@
  * @category  Widget
  * @package   StatusNet
  * @author    Evan Prodromou <evan@status.net>
- * @copyright 2010 StatusNet, Inc.
+ * @copyright 2010,2011 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
  * @link      http://status.net/
  */
@@ -46,21 +46,8 @@ if (!defined('STATUSNET')) {
  * @see      HTMLOutputter
  */
 
-class SettingsNav extends Widget
+class SettingsNav extends Menu
 {
-    var $action = null;
-
-    /**
-     * Construction
-     *
-     * @param Action $action current action, used for output
-     */
-    function __construct($action=null)
-    {
-        parent::__construct($action);
-        $this->action = $action;
-    }
-
     /**
      * Show the menu
      *
index be3ba2748061f88993c36cc10ca7cb3af4ca4188..ee4b0a8dffc482242c94d0bccb92e8cfd2f10f26 100644 (file)
@@ -22,7 +22,7 @@
  * @category  Subs
  * @package   StatusNet
  * @author    Evan Prodromou <evan@status.net>
- * @copyright 2008-2009 StatusNet, Inc.
+ * @copyright 2008-2011 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link      http://status.net/
  */
@@ -43,9 +43,8 @@ require_once INSTALLDIR.'/lib/widget.php';
  * @link     http://status.net/
  */
 
-class SubGroupNav extends Widget
+class SubGroupNav extends Menu
 {
-    var $action = null;
     var $user = null;
 
     /**
@@ -57,7 +56,6 @@ class SubGroupNav extends Widget
     function __construct($action=null, $user=null)
     {
         parent::__construct($action);
-        $this->action = $action;
         $this->user = $user;
     }
 
index 0b7efb22fc6bceb6587374f3f6342a87a988784d..9c563db5d068f7a831832a56cd8eab18c26e0a21 100644 (file)
@@ -95,6 +95,8 @@ class UserProfile extends Widget
 
     function showAvatar()
     {
+        $this->out->elementStart('div', 'ur_face');
+
         if (Event::handle('StartProfilePageAvatar', array($this->out, $this->profile))) {
 
             $avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
@@ -119,6 +121,8 @@ class UserProfile extends Widget
             Event::handle('EndProfilePageAvatar',
                           array($this->out, $this->profile));
         }
+
+        $this->out->elementEnd('div');
     }
 
     function showNickname()