Perforce Chronicle 2012.2/486814
API Documentation
|
A simple wrapper around the content list view helper. More...
Public Member Functions | |
render ($content) | |
Renders the value (a list of content ids) using the content list helper. |
A simple wrapper around the content list view helper.
For use with the content select element and content editing (allows content select elements to render a list of content when used with content).
Content_Form_Decorator_DisplaySelectedContent::render | ( | $ | content | ) |
Renders the value (a list of content ids) using the content list helper.
Any options set on the decorator will be passed through to the list helper.
string | $content | The content to render. |
{ $element = $this->getElement(); $value = array_filter((array) $this->getElement()->getValue()); $view = $element->getView(); $helper = $view->getHelper('contentList'); $query = new P4Cms_Record_Query; // limit result to just the selected content. $query->setIds($value); // default is to sort entries in the order they were selected. $options = $this->getOptions(); $options['postSort'] = isset($options['postSort']) ? $options['postSort'] : array('id' => array(P4Cms_Model_Iterator::SORT_FIXED => $value)); return $helper->contentList($query, $options)->render(); }