Perforce Chronicle 2012.2/486814
API Documentation

Category_AssociatedCategoriesWidgetController Class Reference

A widget that displays the categories associated with content, when content is being displayed. More...

Inheritance diagram for Category_AssociatedCategoriesWidgetController:
P4Cms_Widget_ControllerAbstract

List of all members.

Public Member Functions

 indexAction ()
 Display the text stored in the widget.

Static Public Member Functions

static getConfigSubForm ($widget)
 Get config sub-form to present additional options when configuring a widget of this type.

Detailed Description

A widget that displays the categories associated with content, when content is being displayed.

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Member Function Documentation

static Category_AssociatedCategoriesWidgetController::getConfigSubForm ( widget) [static]

Get config sub-form to present additional options when configuring a widget of this type.

Parameters:
P4Cms_Widget$widgetthe widget instance being configured.
Returns:
Zend_Form_SubForm|null the sub-form to integrate into the default widget config form or null for no sub-form.
Category_AssociatedCategoriesWidgetController::indexAction ( )

Display the text stored in the widget.

    {
        $this->view->display = false;
        $this->view->preamble = $this->getOption('preamble');
        $this->view->categories = array();

        $context = $this->widgetContext->getValues();
        if ($context and array_key_exists('contentId', $context)) {
            $categories = Category_Model_Category::fetchAllByEntry($context['contentId']);
            $this->view->categories = $categories;
            $this->view->display = true;
        }
    }

The documentation for this class was generated from the following file: