]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - lib/noticestreamaction.php
Merge branch 'jquery-cookie-undefined' into 'nightly'
[quix0rs-gnu-social.git] / lib / noticestreamaction.php
1 <?php
2
3 if (!defined('GNUSOCIAL')) { exit(1); }
4
5 abstract class NoticestreamAction extends ProfileAction
6 {
7
8     protected function prepare(array $args=array()) {
9         parent::prepare($args);
10
11         // fetch the actual stream stuff
12         $stream = $this->getStream();
13         $this->notice = $stream->getNotices(($this->page-1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
14
15         if ($this->page > 1 && $this->notice->N == 0) {
16             // TRANS: Client error when page not found (404).
17             $this->clientError(_('No such page.'), 404);
18         }
19
20         return true;
21     }
22
23     // this fetches the NoticeStream
24     abstract public function getStream();
25 }