From 5bbcededa752133b2e607e8309d381df67f6a250 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 1 Mar 2011 16:48:20 -0500 Subject: [PATCH] move inbox/outbox to object menu --- lib/mailbox.php | 6 ++++ lib/mailboxmenu.php | 70 ++++++++++++++++++++++++++++++++++++++++ lib/personalgroupnav.php | 8 ++--- 3 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 lib/mailboxmenu.php diff --git a/lib/mailbox.php b/lib/mailbox.php index 7faeb7dba3..cb56eb5904 100644 --- a/lib/mailbox.php +++ b/lib/mailbox.php @@ -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 index 0000000000..d2d3607dce --- /dev/null +++ b/lib/mailboxmenu.php @@ -0,0 +1,70 @@ +. + * + * @category Cache + * @package StatusNet + * @author Evan Prodromou + * @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 + * @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/personalgroupnav.php b/lib/personalgroupnav.php index 348195a99d..9d78857c6d 100644 --- a/lib/personalgroupnav.php +++ b/lib/personalgroupnav.php @@ -95,15 +95,11 @@ class PersonalGroupNav extends Menu $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');