]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/mailbox.php
Merge branch 'master' of git@gitorious.org:statusnet/mainline into testing
[quix0rs-gnu-social.git] / lib / mailbox.php
index d77234549af7f27bc33ece11ddcfca4719ae1c40..90a58b4c486bfed92fe98f28371dacf6446182e9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
  *
  * common superclass for direct messages inbox and outbox
  *
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  * @category  Message
- * @package   Laconica
- * @author    Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2008 Control Yourself, Inc.
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2008 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link      http://laconi.ca/
+ * @link      http://status.net/
  */
 
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
-require_once INSTALLDIR.'/lib/personal.php';
-
 define('MESSAGES_PER_PAGE', 20);
 
 /**
  * common superclass for direct messages inbox and outbox
  *
  * @category Message
- * @package  Laconica
- * @author   Evan Prodromou <evan@controlyourself.ca>
+ * @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
- * @link     http://laconi.ca/
+ * @link     http://status.net/
  * @see      InboxAction
  * @see      OutboxAction
  */
 
-class MailboxAction extends PersonalAction
+class MailboxAction extends CurrentUserDesignAction
 {
     var $page = null;
 
-    function prepare($args) 
+    function prepare($args)
     {
         parent::prepare($args);
 
@@ -137,6 +135,9 @@ class MailboxAction extends PersonalAction
             $message->free();
             unset($message);
         }
+        else {
+            $this->element('p', 'guide', _('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.'));
+        }
     }
 
     function getMessages()
@@ -212,26 +213,20 @@ class MailboxAction extends PersonalAction
         }
 
         $this->elementStart('div', 'entry-content');
-        $this->elementStart('dl', 'timestamp');
-        $this->element('dt', null, _('Published'));
-        $this->elementStart('dd', null);
-        $dt = common_date_iso8601($message->created);
         $this->elementStart('a', array('rel' => 'bookmark',
+                                       'class' => 'timestamp',
                                        'href' => $messageurl));
+        $dt = common_date_iso8601($message->created);
         $this->element('abbr', array('class' => 'published',
                                      'title' => $dt),
                                common_date_string($message->created));
         $this->elementEnd('a');
-        $this->elementEnd('dd');
-        $this->elementEnd('dl');
 
         if ($message->source) {
-            $this->elementStart('dl', 'device');
-            $this->elementStart('dt');
-            $this->text(_('From'));
-            $this->elementEnd('dt');
-            $this->showSource($message->source);
-            $this->elementEnd('dl');
+            $this->elementStart('span', 'source');
+            $this->text(_('from'));
+            $this->element('span', 'device', $this->showSource($message->source));
+            $this->elementEnd('span');
         }
         $this->elementEnd('div');
 
@@ -262,12 +257,12 @@ class MailboxAction extends PersonalAction
      * 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 
+     * @param string $source the source of the message
      *
      * @return void
      */
 
-    function showSource($source) 
+    function showSource($source)
     {
         $source_name = _($source);
         switch ($source) {
@@ -276,22 +271,35 @@ class MailboxAction extends PersonalAction
         case 'mail':
         case 'omb':
         case 'api':
-            $this->element('dd', null, $source_name);
+            $this->element('span', 'device', $source_name);
             break;
         default:
             $ns = Notice_source::staticGet($source);
             if ($ns) {
-                $this->elementStart('dd', null);
+                $this->elementStart('span', 'device');
                 $this->element('a', array('href' => $ns->url,
-                                          'rel' => 'external'),
-                               $ns->name);
-                $this->elementEnd('dd');
+                                               'rel' => 'external'),
+                                    $ns->name);
+                $this->elementEnd('span');
             } else {
-                $this->element('dd', null, $source_name);
+                $this->element('span', 'device', $source_name);
             }
             break;
         }
         return;
     }
 
+    /**
+     * Mailbox actions are read only
+     *
+     * @param array $args other arguments
+     *
+     * @return boolean
+     */
+
+    function isReadOnly($args)
+    {
+         return true;
+    }
+
 }