WidgetController.php #1

  • //
  • guest/
  • perforce_software/
  • chronicle/
  • main/
  • sites/
  • all/
  • modules/
  • feed/
  • controllers/
  • WidgetController.php
  • View
  • Commits
  • Open Download .zip Download (1 KB)
<?php
/**
 * A simple RSS/Atom widget.
 *
 * @copyright   2012 Perforce Software. All rights reserved.
 * @license     Please see LICENSE.txt in top-level folder of this distribution.
 * @version     <release>/<patch>
 */
class Feed_WidgetController extends P4Cms_Widget_ControllerAbstract
{
    /**
     * Present the configured rss/atom feed.
     */
    public function indexAction()
    {
        $view = $this->view;
        if ($this->getOption('feedUrl')) {
            $view->feed            = Zend_Feed_Reader::import($this->getOption('feedUrl'));
            $view->maxItems        = $this->getOption('maxItems');
            $view->showDate        = $this->getOption('showDate');
            $view->showDescription = $this->getOption('showDescription');
            if ($this->getOption('showFeedUrl')) {
                $view->feedUrl = $this->getOption('feedUrl');
            }
        }
    }

    /**
     * Add sub-form to collect rss/atom feed url.
     *
     * @param   P4Cms_Widget            $widget     the widget instance being configured.
     * @return  Zend_Form_SubForm|null  the sub-form to integrate into the default
     *                                  widget config form or null for no sub-form.
     */
    public static function getConfigSubForm($widget)
    {
        return new Feed_Form_Widget;
    }
}
# Change User Description Committed
#1 16170 perforce_software Move Chronicle files to follow new path scheme for branching.
//guest/perforce_software/chronicle/sites/all/modules/feed/controllers/WidgetController.php
#1 8972 Matt Attaway Initial add of the Chronicle source code