X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fmailbox.php;h=2b00f5ffde0538f908fd7af15d4cf7d22c0697fc;hb=f1bfbece06d7db20fa144fe5ac8a2f6c589eff45;hp=8d5d44e49de6df002df9fa10749a51500577519b;hpb=0824bb2e1df68fd6634ca915e4c87664ee2ef872;p=quix0rs-gnu-social.git diff --git a/lib/mailbox.php b/lib/mailbox.php index 8d5d44e49d..2b00f5ffde 100644 --- a/lib/mailbox.php +++ b/lib/mailbox.php @@ -1,6 +1,6 @@ . * * @category Message - * @package Laconica - * @author Evan Prodromou - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @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 + * @package StatusNet + * @author Evan Prodromou * @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); @@ -63,6 +61,8 @@ class MailboxAction extends PersonalAction $this->page = 1; } + common_set_returnto($this->selfUrl()); + return true; } @@ -135,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() @@ -181,8 +184,8 @@ class MailboxAction extends PersonalAction 'class' => 'url')); $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE); $this->element('img', array('src' => ($avatar) ? - common_avatar_display_url($avatar) : - common_default_avatar(AVATAR_STREAM_SIZE), + $avatar->displayUrl() : + Avatar::defaultImage(AVATAR_STREAM_SIZE), 'class' => 'photo avatar', 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, @@ -210,26 +213,21 @@ 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'); + // FIXME: bad i18n. Device should be a parameter (from %s). + $this->text(_('from')); + $this->element('span', 'device', $this->showSource($message->source)); + $this->elementEnd('span'); } $this->elementEnd('div'); @@ -260,12 +258,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) { @@ -274,22 +272,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; + } + }