12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- abstract class NoticestreamAction extends ProfileAction
- {
- protected $notice = null;
- protected function prepare(array $args=array()) {
- parent::prepare($args);
-
- $this->doStreamPreparation();
-
- try {
- $stream = $this->getStream();
- $this->notice = $stream->getNotices(($this->page-1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
- } catch (PrivateStreamException $e) {
- $this->notice = new Notice();
- $this->notice->whereAdd('FALSE');
- }
- if ($this->page > 1 && $this->notice->N == 0) {
-
- $this->clientError(_('No such page.'), 404);
- }
- return true;
- }
- protected function doStreamPreparation()
- {
-
- }
- public function extraHeaders()
- {
- parent::extraHeaders();
- foreach ($this->getFeeds() as $feed) {
- header('Link: <'.htmlspecialchars($feed->getUrl()).'>;' .
- ' rel="'.htmlspecialchars($feed->rel()).'";' .
- ' type="'.htmlspecialchars($feed->mimeType()).'"',
- false
- );
- }
- }
-
- abstract public function getStream();
- }
|