]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/mailbox.php
Improved type-hint for following methods:
[quix0rs-gnu-social.git] / lib / mailbox.php
index bbcf2ef5dd313c84a028272b2bb3c9573e746b6e..bc5ff76661a67925f47538d52cdcbcc0362effc3 100644 (file)
@@ -42,17 +42,16 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
  * @see      InboxAction
  * @see      OutboxAction
  */
-
-class MailboxAction extends CurrentUserDesignAction
+class MailboxAction extends Action
 {
     var $page = null;
 
-    function prepare($args)
+    function prepare(array $args=array())
     {
         parent::prepare($args);
 
         $nickname   = common_canonical_nickname($this->arg('nickname'));
-        $this->user = User::staticGet('nickname', $nickname);
+        $this->user = User::getKV('nickname', $nickname);
         $this->page = $this->trimmed('page');
 
         if (!$this->page) {
@@ -71,33 +70,25 @@ class MailboxAction extends CurrentUserDesignAction
      *
      * @return void
      */
-
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
 
         if (!$this->user) {
+            // TRANS: Client error displayed when trying to access a mailbox without providing a user.
             $this->clientError(_('No such user.'), 404);
-            return;
         }
 
         $cur = common_current_user();
 
         if (!$cur || $cur->id != $this->user->id) {
-            $this->clientError(_('Only the user can read their own mailboxes.'),
-                403);
-            return;
+            // TRANS: Client error displayed when trying to access a mailbox that is not of the logged in user.
+            $this->clientError(_('Only the user can read their own mailboxes.'), 403);
         }
 
         $this->showPage();
     }
 
-    function showLocalNav()
-    {
-        $nav = new PersonalGroupNav($this);
-        $nav->show();
-    }
-
     function showNoticeForm()
     {
         $message_form = new MessageForm($this);
@@ -120,8 +111,9 @@ class MailboxAction extends CurrentUserDesignAction
                               $this->trimmed('action'),
                               array('nickname' => $this->user->nickname));
         } else {
-            $this->element('p', 
-                           'guide', 
+            $this->element('p',
+                           'guide',
+                           // TRANS: Message displayed when there are no private messages in the inbox of a user.
                            _('You have no private messages. '.
                              'You can send private message to engage other users in conversation. '.
                              'People can send you messages for your eyes only.'));
@@ -145,7 +137,6 @@ class MailboxAction extends CurrentUserDesignAction
      *
      * @return void
      */
-
     function showPageNotice()
     {
         $instr  = $this->getInstructions();
@@ -156,44 +147,6 @@ class MailboxAction extends CurrentUserDesignAction
         $this->elementEnd('div');
     }
 
-    /**
-     * Show the source of the message
-     *
-     * Returns either the name (and link) of the API client that posted the notice,
-     * or one of other other channels.
-     *
-     * @param string $source the source of the message
-     *
-     * @return void
-     */
-
-    function showSource($source)
-    {
-        $source_name = _($source);
-        switch ($source) {
-        case 'web':
-        case 'xmpp':
-        case 'mail':
-        case 'omb':
-        case 'api':
-            $this->element('span', 'device', $source_name);
-            break;
-        default:
-            $ns = Notice_source::staticGet($source);
-            if ($ns) {
-                $this->elementStart('span', 'device');
-                $this->element('a', array('href' => $ns->url,
-                                               'rel' => 'external'),
-                                    $ns->name);
-                $this->elementEnd('span');
-            } else {
-                $this->element('span', 'device', $source_name);
-            }
-            break;
-        }
-        return;
-    }
-
     /**
      * Mailbox actions are read only
      *
@@ -201,9 +154,14 @@ class MailboxAction extends CurrentUserDesignAction
      *
      * @return boolean
      */
-
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
          return true;
     }
+
+    function showObjectNav()
+    {
+        $mm = new MailboxMenu($this);
+        $mm->show();
+    }
 }