/** * @group ZF-9689 */ public function testRenderWithListSeparatorForMulticheckbox() { require_once 'Zend/Form/Element/MultiCheckbox.php'; $element = new Zend_Form_Element_MultiCheckbox('foo'); $options = array('foo' => 'Foo', 'bar' => 'Bar'); $element->setMultiOptions($options); $element->setSeparator('</p><p>'); $element->setDecorators(array(array('ViewHelper', array('separator' => '')), array('HtmlTag', array('tag' => 'p')))); $expected = '<p><label><input type="checkbox" name="foo[]" id="foo-foo" value="foo">Foo</label></p>' . '<p><label><input type="checkbox" name="foo[]" id="foo-bar" value="bar">Bar</label></p>'; $actual = $element->render($this->getView()); $this->assertEquals($expected, $actual); }
/** * getFolderSecurity * @param Zend_Db_Table_Rowset_Abstract $objRowset * @author Thomas Schedler <*****@*****.**> * @version 1.0 */ public function getFolderSecurity($objRowset) { $this->core->logger->debug('core->views->helpers->FolderHelper->getFolderSecurity()'); $strOutput = ''; $arrZooluSecurity = array(); $arrWebsiteSecurity = array(); foreach ($objRowset as $objRow) { if ($this->core->sysConfig->zone->zoolu == $objRow->zone) { $arrZooluSecurity[] = $objRow->id; } else { if ($this->core->sysConfig->zone->website == $objRow->zone) { $arrWebsiteSecurity[] = $objRow->id; } } } $arrGroups = array(); $sqlStmt = $this->core->dbh->query("SELECT `id`, `title` FROM `groups` ORDER BY `title`")->fetchAll(); foreach ($sqlStmt as $arrSql) { $arrGroups[$arrSql['id']] = $arrSql['title']; } $objZooluSecurityElement = new Zend_Form_Element_MultiCheckbox('ZooluSecurity', array('value' => $arrZooluSecurity, 'label' => $this->core->translate->_('groups', false), 'multiOptions' => $arrGroups, 'columns' => 6, 'class' => 'multiCheckbox')); $objZooluSecurityElement->addPrefixPath('Form_Decorator', GLOBAL_ROOT_PATH . 'library/massiveart/generic/forms/decorators/', 'decorator'); $objZooluSecurityElement->setDecorators(array('Input')); $objWebsiteSecurityElement = new Zend_Form_Element_MultiCheckbox('WebsiteSecurity', array('value' => $arrWebsiteSecurity, 'label' => $this->core->translate->_('groups', false), 'multiOptions' => $arrGroups, 'columns' => 6, 'class' => 'multiCheckbox')); $objWebsiteSecurityElement->addPrefixPath('Form_Decorator', GLOBAL_ROOT_PATH . 'library/massiveart/generic/forms/decorators/', 'decorator'); $objWebsiteSecurityElement->setDecorators(array('Input')); $strOutput .= ' <div id="divTab_ZOOLU"> ' . $objZooluSecurityElement->render() . ' </div> <div id="divTab_Website" style="display:none;"> ' . $objWebsiteSecurityElement->render() . ' </div>'; /** * return html output */ return $strOutput; }