123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
- }
- class MailboxAction extends Action
- {
- var $page = null;
- function prepare(array $args = array())
- {
- parent::prepare($args);
- $nickname = common_canonical_nickname($this->arg('nickname'));
- $this->user = User::getKV('nickname', $nickname);
- $this->page = $this->trimmed('page');
- if (!$this->page) {
- $this->page = 1;
- }
- common_set_returnto($this->selfUrl());
- return true;
- }
-
- function handle()
- {
- parent::handle();
- if (!$this->user) {
-
- $this->clientError(_('No such user.'), 404);
- }
- $cur = common_current_user();
- if (!$cur || $cur->id != $this->user->id) {
-
- $this->clientError(_('Only the user can read their own mailboxes.'), 403);
- }
- $this->showPage();
- }
- function showNoticeForm()
- {
- $message_form = new MessageForm($this);
- $message_form->show();
- }
- function showContent()
- {
- $message = $this->getMessages();
- if ($message) {
- $ml = $this->getMessageList($message);
- $cnt = $ml->show();
- $this->pagination($this->page > 1,
- $cnt > MESSAGES_PER_PAGE,
- $this->page,
- $this->trimmed('action'),
- array('nickname' => $this->user->nickname));
- } 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()
- {
- return null;
- }
- function getMessageList($message)
- {
- return null;
- }
-
- function showPageNotice()
- {
- $instr = $this->getInstructions();
- $output = common_markup_to_html($instr);
- $this->elementStart('div', 'instructions');
- $this->raw($output);
- $this->elementEnd('div');
- }
-
- function isReadOnly($args)
- {
- return true;
- }
- function showObjectNav()
- {
- $mm = new MailboxMenu($this);
- $mm->show();
- }
- }
|