public function getAllItems()
{
$elements = array();
$items = $this->getAllToolbarItems();
$toolbarItems = $this->getToolbarItems();
foreach ($items as $group) {
if (!empty($group['items']) and is_array($group['items'])) {
$fieldset = new Fieldset($group['name']);
foreach ($group['items'] as $idxItem => $item) {
if ($item == '-') {
continue;
}
$element = new Element\Checkbox('toolbar-items[' . $item . ']');
$element->setAttribute('id', 'i' . $group['name'] . $idxItem)->setCheckedValue(1)->setAttribute('class', 'input-checkbox')->setLabel($item);
if (!empty($toolbarItems[$item])) {
$element->setValue(1);
}
$fieldset->add($element);
}
$elements[] = $fieldset;
}
}
return $elements;
}
/** * Load Textrich prevalue editor * * @return string */ public function load() { $parameters = $this->getConfig(); $ckeditor = new CkEditor(); if (empty($parameters) or !is_array($parameters)) { $parameters = array(); } $ckeditor->setParameters($parameters); return $this->addPath(__DIR__)->render('ckeditor-prevalue.phtml', array('textrich' => $ckeditor->getAllItems())); }