X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Ffeedlist.php;h=cc0f55249394352268c6bb869a711500163dc16b;hb=8b78e01d4c4b9512a7b74efa52fcaf37de0dc6f1;hp=4aacf0b3d84ac4f3a9a327c3be8c8ebe584015b9;hpb=3224f7fec9906b00684851759fcb476517d14e48;p=quix0rs-gnu-social.git diff --git a/lib/feedlist.php b/lib/feedlist.php index 4aacf0b3d8..cc0f552493 100644 --- a/lib/feedlist.php +++ b/lib/feedlist.php @@ -28,9 +28,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} +if (!defined('GNUSOCIAL')) { exit(1); } /** * Widget for showing a list of feeds @@ -46,34 +44,37 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { * * @see Action::showExportList() */ - class FeedList extends Widget { var $action = null; - function __construct($action=null) + protected $feeds = null; + + public function __construct(Action $action=null, array $feeds=array()) { - parent::__construct($action); - $this->action = $action; + parent::__construct($action); + $this->action = $action; + $this->feeds = $feeds; } - function show($feeds) + public function show() { - if (Event::handle('StartShowFeedLinkList', array($this->action, &$feeds))) { - if (!empty($feeds)) { + if (Event::handle('StartShowFeedLinkList', array($this->action, &$this->feeds))) { + if (!empty($this->feeds)) { $this->out->elementStart('div', array('id' => 'export_data', 'class' => 'section')); + // TRANS: Header for feed links (h2). $this->out->element('h2', null, _('Feeds')); $this->out->elementStart('ul', array('class' => 'xoxo')); - foreach ($feeds as $feed) { + foreach ($this->feeds as $feed) { $this->feedItem($feed); } $this->out->elementEnd('ul'); $this->out->elementEnd('div'); } - Event::handle('EndShowFeedLinkList', array($this->action, &$feeds)); + Event::handle('EndShowFeedLinkList', array($this->action, &$this->feeds)); } } @@ -93,6 +94,9 @@ class FeedList extends Widget case Feed::FOAF: $classname = 'foaf'; break; + case Feed::JSON: + $classname = 'json'; + break; } $this->out->elementStart('li');