ImageRotatorWidgetController.php #1

  • //
  • guest/
  • perforce_software/
  • chronicle/
  • main/
  • application/
  • widget/
  • controllers/
  • ImageRotatorWidgetController.php
  • View
  • Commits
  • Open Download .zip Download (1 KB)
<?php
/**
 * A widget that displays an arbitrary selection of images in a region.
 * The images can be updated (replaced).
 *
 * @copyright   2011 Perforce Software. All rights reserved.
 * @license     Please see LICENSE.txt in top-level folder of this distribution.
 * @version     <release>/<patch>
 */
class Widget_ImageRotatorWidgetController extends P4Cms_Widget_ControllerAbstract
{
    /**
     * Output the widgets html
     */
    public function indexAction()
    {
        $widget = $this->_getWidget();
        $images = $this->getOption('images');
        $images = $images ? $images->toArray() : null;

        // setup the view.
        $this->view->widget = $widget;
        $this->view->images = Content_Form_Element_ContentSelect::normalizeValue($images);
        $this->view->ids    = Content_Form_Element_ContentSelect::extractIds($images);
    }

    /**
     * Get config sub-form to present additional options when
     * configuring a widget of this type.
     *
     * @param   P4Cms_Widget            $widget     the widget instance being configured.
     * @return  Zend_Form_SubForm       the sub-form to integrate into the default
     *                                  widget config form or null for no sub-form.
     */
    public static function getConfigSubForm($widget)
    {
        return new Widget_Form_ImageRotatorWidget;
    }
}
# Change User Description Committed
#1 16170 perforce_software Move Chronicle files to follow new path scheme for branching.
//guest/perforce_software/chronicle/application/widget/controllers/ImageRotatorWidgetController.php
#1 8972 Matt Attaway Initial add of the Chronicle source code