本文整理汇总了PHP中Zend_Form_SubForm::addSubForm方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_SubForm::addSubForm方法的具体用法?PHP Zend_Form_SubForm::addSubForm怎么用?PHP Zend_Form_SubForm::addSubForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_SubForm
的用法示例。
在下文中一共展示了Zend_Form_SubForm::addSubForm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addTripLines
public function addTripLines($tripCount = 1, $startDate, $buses = array())
{
// create subform
$tripLinePanel = new Zend_Form_SubForm();
$tripLinePanel->setDecorators($this->_displayGroupDecorators)->addAttribs(array('class' => 'fieldsetForm span-8'));
for ($i = 1; $i <= $tripCount; ++$i) {
// create bus element
$bus = $this->_createBusElement($buses);
// create departure time element
$departureTime = $this->_createElement('text', 'departureTime', 'Ngày giờ đi', 'Làm ơn nhập ngày giờ đi', true);
$departureTime->setValue($startDate . ' 00:00:00');
$departureTime->addValidator(new TBB_Validate_DepartureTime($startDate));
// create arrival time element
$arrivalTime = $this->_createElement('text', 'arrivalTime', 'Ngày giờ đến', 'Làm ơn nhập ngày giờ đến', true);
$arrivalTime->setValue($startDate . ' 00:00:00');
$arrivalTime->addValidator(new TBB_Validate_ArrivalTime());
$fare = $this->_createElement('text', 'fare', 'Giá vé', 'Làm ơn nhập giá vé', false, true);
// create trip line
$tripLine = new Zend_Form_SubForm();
$tripLine->setDecorators($this->_displayGroupDecorators)->addAttribs(array('class' => 'span-7'))->setLegend('Chuyến #' . $i);
// add elements to the tripline
$tripLine->addElements(array($bus, $departureTime, $arrivalTime, $fare));
$tripLinePanel->addSubForm($tripLine, $i);
}
// add submit button
$submit = $this->_createSubmitButton();
$tripLinePanel->addElement($submit);
$this->addSubForm($tripLinePanel, 'tripLines');
}
示例2: init
public function init()
{
parent::init();
/*
* Translations
*/
$subForm = new Zend_Form_SubForm('Translation');
$langs = Model_Hm_Lang::listAll();
foreach ($langs as $lang) {
$subSubForm = new Zend_Form_SubForm($lang->code);
$element = new Zend_Form_Element_Text('title');
$element->setLabel('Titel (eigen)')->setDescription('Deze titel is voor gebruik in eigen administratie.')->setRequired(true);
$subSubForm->addElement($element);
$element = new Zend_Form_Element_Text('display_title');
$element->setLabel('Titel (gebruiker)')->setDescription('Deze titel krijgen de gebruikesr van het systeem te zien.')->setRequired(true);
$subSubForm->addElement($element);
$element = new Zend_Form_Element_Textarea('description');
$element->setLabel('Omschrijving')->setRequired(true)->setValidators(array(array('stringLength', false, array('min' => 40))))->setAttrib('class', 'autoexpand')->setAttrib('rows', 2);
$subSubForm->addElement($element);
$subSubForm->addDisplayGroup(array('title', 'display_title', 'description'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
$subForm->addSubForm($subSubForm, $lang->code);
$this->bhvkSubDecorators($subSubForm);
}
$this->addSubForm($subForm, 'Translation');
$this->bhvkSubDecorators($subForm);
/*
* Submit
*/
$element = new Zend_Form_Element_Submit('submit_chargeoptional');
$element->setLabel('Verwerken')->setAttrib('class', 'submit');
$this->addElement($element);
$this->addDisplayGroup(array('submit_chargeoptional'), 'submit', array('class' => 'submit'));
$this->bhvkDecorators();
$this->bhvkDecorateSubmitElement($this->getElement('submit_chargeoptional'));
}
示例3: init
public function init()
{
parent::init();
$this->setAttrib('enctype', 'multipart/form-data');
$element = new Zend_Form_Element_File('filename');
$element->setLabel('Foto')->setDescription('Maximale grootte van de foto is 1mb')->setRequired(true)->setValidators(array(array('Count', false, 1), array('Size', false, 1024000), array('Extension', false, 'jpg,png,gif')))->setDestination(APPLICATION_PATH . '/../public/images/uploads/holidayhome/photos');
$this->addElement($element);
$this->addDisplayGroup(array('filename'), 'photogroup', array('legend' => 'Foto', 'class' => 'file'));
$subForm = new Zend_Form_SubForm('Translation');
foreach (Model_Hm_Lang::listAll() as $lang) {
$subSubForm = new Zend_Form_SubForm($lang->code);
$element = new Zend_Form_Element_Text('title');
$element->setLabel('Titel')->setRequired(true)->setValidators(array(array('stringLength', null, array('min' => 4, 'max' => 64))));
$subSubForm->addElement($element);
$element = new Zend_Form_Element_Textarea('description');
$element->setLabel('Omschrijving')->setAttrib('rows', 2)->setAttrib('class', 'autoexpand')->setRequired(true)->setValidators(array(array('stringLength', null, array('min' => 40))));
$subSubForm->addElement($element);
$subSubForm->addDisplayGroup(array('title', 'description'), $lang->code, array('class' => 'textarea', 'legend' => $lang->name));
$this->bhvkSubDecorators($subSubForm);
$subForm->addSubForm($subSubForm, $lang->code);
}
$this->bhvkSubDecorators($subForm);
$this->addSubForm($subForm, 'Translation');
$element = new Zend_Form_Element_Submit('photo_submit');
$element->setLabel('Verwerken')->setAttrib('class', 'submit');
$this->addElement($element);
$this->addDisplayGroup(array('photo_submit'), 'submit', array('class' => 'submit'));
$this->bhvkDecorators();
$this->bhvkDecorateSubmit('photo_submit');
$this->bhvkDecorateFile($this->getElement('filename'));
}
示例4: init
public function init()
{
parent::init();
$subForm = new Zend_Form_SubForm('Translation');
$langs = Model_Hm_Lang::listAll();
foreach ($langs as $lang) {
$subSubForm = new Zend_Form_SubForm($lang->code);
$element = new Zend_Form_Element_Text('name');
$element->setLabel('Naam')->setAttrib('maxlength', 64)->setValidators(array(array('stringLength', false, array('min' => 4, 'max' => 64))))->setRequired(true);
$subSubForm->addElement($element);
$element = new Zend_Form_Element_Textarea('description');
$element->setLabel('Omschrijving')->setRequired(true)->setValidators(array(array('stringLength', false, array('min' => 40))))->setAttrib('class', 'autoexpand')->setAttrib('rows', 2);
$subSubForm->addElement($element);
$subSubForm->addDisplayGroup(array('name', 'description'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
$subForm->addSubForm($subSubForm, $lang->code);
$this->bhvkSubDecorators($subSubForm);
}
$this->addSubForm($subForm, 'Translation');
$this->bhvkSubDecorators($subForm);
$element = new Zend_Form_Element_Submit('submit_category');
$element->setLabel('Verwerken')->setAttrib('class', 'submit');
$this->addElement($element)->addDisplayGroup(array('submit_category'), 'submit', array('class' => 'submit'));
$this->bhvkDecorators();
$this->bhvkDecorateSubmit('submit_category');
}
示例5: getForm
protected function getForm()
{
$translationKey = $this->_request->getParam('key');
if (empty($translationKey)) {
throw new Application_Exception('Parameters missing');
}
$form = new Zend_Form_SubForm();
$form->addSubForm(new Setup_Form_LanguageKey($translationKey), $translationKey);
return $form;
}
示例6: init
public function init()
{
$this->setName('addApplicant');
$id = new Zend_Form_Element_Hidden('id');
$id->addFilter('Int');
$product = new Zend_Form_Element_Text('product');
$product->setLabel('* product:')->setRequired(true)->addFilter('StripTags')->addFilter('stringTrim')->addValidators(array(array('regex', false, array('pattern' => "/^[а,б,в,г,ґ,д,е,є,ж,з,и,ы,і,ї,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ь,ю,я,А,Б,В,С,Г,Д,Е,Є,Ж,З,И,Ы,І,Ї,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ь,Ю,Я,A,a,B,b,C,c,D,d,E,e,F,f,G,g,H,h,I,i,J,j,K,k,L,l,M,m,N,n,O,o,P,p,Q,q,R,r,S,s,T,t,U,u,V,v,W,w,X,x,Y,y,Z,z,1,2,3,4,5,6,7,8,9,0'.]{2,}\$/", 'messages' => 'В полі присутні заборонені символи!!'))));
$category = new Zend_Form_Element_Text('category');
$category->setLabel("* category:")->setRequired(true)->addFilter('StripTags')->addFilter('stringTrim')->addValidators(array(array('regex', false, array('pattern' => "/^[а,б,в,г,ґ,д,е,є,ж,з,и,ы,і,ї,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ь,ю,я,А,Б,В,С,Г,Д,Е,Є,Ж,З,И,Ы,І,Ї,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ь,Ю,Я,A,a,B,b,C,c,D,d,E,e,F,f,G,g,H,h,I,i,J,j,K,k,L,l,M,m,N,n,O,o,P,p,Q,q,R,r,S,s,T,t,U,u,V,v,W,w,X,x,Y,y,Z,z,1,2,3,4,5,6,7,8,9,0'.]{2,}\$/", 'messages' => 'В полі присутні заборонені символи!!'))));
$group = new Zend_Form_Element_Text('group');
$group->setLabel("* group:")->setRequired(true)->addFilter('StripTags')->addFilter('stringTrim')->addValidators(array(array('regex', false, array('pattern' => "/^[а,б,в,г,ґ,д,е,є,ж,з,и,ы,і,ї,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ь,ю,я,А,Б,В,С,Г,Д,Е,Є,Ж,З,И,Ы,І,Ї,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ь,Ю,Я,A,a,B,b,C,c,D,d,E,e,F,f,G,g,H,h,I,i,J,j,K,k,L,l,M,m,N,n,O,o,P,p,Q,q,R,r,S,s,T,t,U,u,V,v,W,w,X,x,Y,y,Z,z,1,2,3,4,5,6,7,8,9,0'.]{2,}\$/", 'messages' => 'В полі присутні заборонені символи!!'))));
$this->addElements(array($id, $product, $category, $group));
//-------------------- add attr
$institutions = new Zend_Form_SubForm();
$institutions->setName('attr');
$session = new Zend_Session_Namespace('form');
foreach ($session->attr as $inst) {
$rowForm = new Zend_Form_SubForm();
$rowForm->setName($inst);
if ($inst === '__template1__') {
$rowForm->setAttrib('style', 'display: none;');
}
$instName = new Zend_Form_Element_Text('instName');
$instName->setLabel('attribute')->addFilter('StripTags')->addFilter('stringTrim')->setAttrib('class', 'institution')->setAttrib('onfocus', 'institutionAutocomplete(this)');
if ($inst !== '__template1__') {
$instName->setRequired(true);
}
$inst_remove = new Zend_Form_Element_Button('remove');
$inst_remove->setLabel('remove')->setAttrib('class', 'remove')->setAttrib('onclick', 'removeInst(this)');
$elements = array($instName, $inst_remove);
foreach ($elements as $element) {
if ($inst !== '__template1__' && $element->getName() !== 'remove') {
$element->setRequired(true);
}
}
$rowForm->addElements($elements);
$rowForm->setElementDecorators($this->getElementDecorators());
$rowForm->getElement('remove')->removeDecorator('Label');
$rowForm->setDecorators($this->getSubFormDecorators());
$institutions->addSubForm($rowForm, $inst);
}
$institutions->setDecorators($this->getSubFormDecorators());
$inst_add = new Zend_Form_Element_Button('addInst');
$inst_add->setLabel('add attribute')->setAttrib('class', 'addInst');
$institutions->addElement($inst_add);
$institutions->setElementDecorators($this->getElementDecorators());
$institutions->getElement('addInst')->removeDecorator('Label');
$this->addSubForm($institutions, 'institutions');
$this->postSetup();
}
示例7: init
public function init()
{
parent::init();
/*
* Options
*/
$element = new Zend_Form_Element_Checkbox('per_person');
$element->setLabel('Per persoon')->setDescription('Selecteer deze optie wanneer u deze kosten
per nacht per persoon wilt rekenen. Laat deze optie leeg
wanneer u de kosten alleen per nacht wilt rekenen.');
$this->addElement($element);
$element = new Zend_Form_Element_Checkbox('visible');
$element->setLabel('Zichtbaar')->setAttrib('checked', 'checked')->setDescription('Selecteer deze optie wanneer u wilt dat de
kosten onzichtbaar worden berekend.');
$this->addElement($element);
$this->addDisplayGroup(array('per_person', 'visible'), 'info', array('legend' => 'Opties', 'class' => 'checkbox'));
/*
* Text
*/
$element = new Zend_Form_Element_Text('exp');
$element->setLabel('Expressies')->setDescription('Waarschuwing! Het is mogelijk om hier speciale
expressies in te vullen. Indien u niet weet wat dit is, laat
het veld leeg. U kunt de applicatie en betaal processen
ernstige schade toebrengen.');
$this->addElement($element);
$this->addDisplayGroup(array('exp'), 'expas', array('legend' => 'Expressies'));
/*
* Translations
*/
$subForm = new Zend_Form_SubForm('Translation');
$langs = Model_Hm_Lang::listAll();
foreach ($langs as $lang) {
$subSubForm = new Zend_Form_SubForm($lang->code);
$element = new Zend_Form_Element_Text('title');
$element->setLabel('Titel (eigen)')->setDescription('Deze titel is voor gebruik in eigen administratie.')->setRequired(true);
$subSubForm->addElement($element);
$element = new Zend_Form_Element_Text('display_title');
$element->setLabel('Titel (gebruiker)')->setDescription('Deze titel krijgen de gebruikesr van het systeem te zien.')->setRequired(true);
$subSubForm->addElement($element);
$element = new Zend_Form_Element_Textarea('description');
$element->setLabel('Omschrijving')->setRequired(true)->setValidators(array(array('stringLength', false, array('min' => 40))))->setAttrib('class', 'autoexpand')->setAttrib('rows', 2);
$subSubForm->addElement($element);
$subSubForm->addDisplayGroup(array('title', 'display_title', 'description'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
$subForm->addSubForm($subSubForm, $lang->code);
$this->bhvkSubDecorators($subSubForm);
}
$this->addSubForm($subForm, 'Translation');
$this->bhvkSubDecorators($subForm);
}
示例8: init
public function init()
{
$translator = $this->getTranslator();
foreach (array('de', 'en') as $lang) {
$langForm = new Zend_Form_SubForm();
$langForm->setLegend($translator->translate("setup_language_{$lang}"));
$keyForm = new Zend_Form_SubForm();
$keyForm->addElement('text', 'home_index_index_pagetitle', array('label' => $translator->translate('setup_home_index_index_pagetitle'), 'attribs' => array('size' => 90)));
$keyForm->addElement('text', 'home_index_index_title', array('label' => $translator->translate('setup_home_index_index_title'), 'attribs' => array('size' => 90)));
$keyForm->addElement('textarea', 'home_index_index_welcome', array('label' => $translator->translate('setup_home_index_index_welcome'), 'attribs' => array('size' => 90)));
$keyForm->addElement('textarea', 'home_index_index_instructions', array('label' => $translator->translate('setup_home_index_index_instructions'), 'attribs' => array('size' => 90)));
$langForm->addSubForm($keyForm, 'key');
$this->addSubForm($langForm, $lang);
}
}
示例9: addItemXpathsToExtend
protected function addItemXpathsToExtend($itemXpathsToExtend)
{
if (count($itemXpathsToExtend) == 0) {
$itemXpathsToExtend = array(new Kaltura_Client_Type_String());
}
$mainSubForm = new Zend_Form_SubForm();
$mainSubForm->setLegend('Item XPaths To Extend');
$mainSubForm->setDecorators(array('FormElements', array('ViewScript', array('viewScript' => 'distribution-item-xpath-to-extend.phtml', 'placement' => 'APPEND')), 'Fieldset'));
$i = 1;
foreach ($itemXpathsToExtend as $stringObject) {
$subForm = new Zend_Form_SubForm(array('disableLoadDefaultDecorators' => true));
$subForm->setDecorators(array('FormElements'));
$subForm->addElement('text', 'itemXpathsToExtend', array('decorators' => array('ViewHelper', array('HtmlTag', array('tag' => 'div'))), 'isArray' => true, 'value' => $stringObject->value));
$mainSubForm->addSubForm($subForm, 'itemXpathsToExtend_subform_' . $i++);
}
$this->addSubForm($mainSubForm, 'itemXpathsToExtend_group');
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:17,代码来源:ConfigurableProfileConfiguration.php
示例10: init
public function init()
{
parent::init();
/*
* Code
*/
$element = new Zend_Form_Element_Text('code');
$element->setLabel('Landcode')->setRequired(true);
$this->addElement($element);
/*
* Areacode
*/
$element = new Zend_Form_Element_Text('area_code');
$element->setLabel('Netnummer')->setRequired(true);
$this->addElement($element);
$this->addDisplayGroup(array('code', 'area_code'), 'Algemeen', array('legend' => 'Gegevens'));
/*
* Translations
*/
$subForm = new Zend_Form_SubForm('Translation');
$langs = Model_Hm_Lang::listAll();
foreach ($langs as $lang) {
$subSubForm = new Zend_Form_SubForm($lang->code);
/*
* Name field
*/
$element = new Zend_Form_Element_Text('name');
$element->setLabel('Naam')->setAttrib('maxlength', 64)->setValidators(array(array('stringLength', false, array('min' => 4, 'max' => 64))))->setRequired(true);
$subSubForm->addElement($element);
$subSubForm->addDisplayGroup(array('name'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
$subForm->addSubForm($subSubForm, $lang->code);
$this->bhvkSubDecorators($subSubForm);
}
$this->addSubForm($subForm, 'Translation');
$this->bhvkSubDecorators($subForm);
/*
* Submit
*/
$element = new Zend_Form_Element_Submit('submit_country');
$element->setLabel("Verwerken")->setAttrib('class', 'submit');
$this->addElement($element);
$this->addDisplayGroup(array('submit_country'), 'submit', array('class' => 'submit'));
$this->bhvkDecorators();
$this->bhvkDecorateSubmit('submit_country');
}
示例11: init
public function init()
{
parent::init();
$element = new Zend_Form_Element_Select('hm_geo_region_id');
$element->setLabel('Regio')->setRequired(true)->addMultiOption('', '...');
$regions = Model_Hm_Geo_Region::findAllForAdmin()->execute();
foreach ($regions as $region) {
$element->addMultiOption($region->id, $region->Country->translationHandler()->name . ' - ' . $region->name);
}
$this->addElement($element);
$element = new Zend_Form_Element_Text('name');
$element->setLabel('Naam')->setRequired(true)->setAttrib('maxlength', 128)->setValidators(array(array('stringLength', false, array('min' => 4, 'max' => 128))));
$this->addElement($element);
$element = new Zend_Form_Element_Text('coordinate');
$element->setLabel('Coordinaat')->setRequired(true)->setAttrib('maxlength', 32)->setValidators(array(array('stringLength', false, array('min' => 4, 'max' => 32))));
$this->addElement($element);
$this->addDisplayGroup(array('hm_geo_region_id', 'name', 'coordinate'), 'info', array('legend' => 'Algemeen'));
/*
* Translations
*/
$subForm = new Zend_Form_SubForm('Translation');
$langs = Model_Hm_Lang::listAll();
foreach ($langs as $lang) {
$subSubForm = new Zend_Form_SubForm($lang->code);
/*
* Name field
*/
$element = new Zend_Form_Element_Textarea('description');
$element->setLabel('Omschrijving')->setAttrib('class', 'autoexpand')->setAttrib('rows', 2)->setValidators(array(array('stringLength', false, array('min' => 40))))->setRequired(true);
$subSubForm->addElement($element);
$subSubForm->addDisplayGroup(array('description'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
$subForm->addSubForm($subSubForm, $lang->code);
$this->bhvkSubDecorators($subSubForm);
}
$this->addSubForm($subForm, 'Translation');
$this->bhvkSubDecorators($subForm);
$element = new Zend_Form_Element_Submit('submit_city');
$element->setLabel('Verwerken')->setAttrib('class', 'submit');
$this->addElement($element);
$this->addDisplayGroup(array('submit_city'), 'submit', array('class' => 'submit'));
$this->bhvkDecorators();
$this->bhvkDecorateSubmit('submit_city');
}
示例12: init
public function init()
{
parent::init();
$subForm = new Zend_Form_SubForm('Translation');
$langs = Model_Hm_Lang::listAll();
foreach ($langs as $lang) {
$element = new Zend_Form_Element_Textarea('content');
$element->setLabel('Content')->setRequired(true)->setAttrib('class', 'autoexpand')->setAttrib('rows', 2);
$subSubForm = new Zend_Form_SubForm($lang->code);
$subSubForm->addElement($element)->addDisplayGroup(array('content'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
$subForm->addSubForm($subSubForm, $lang->code);
$this->bhvkSubDecorators($subSubForm);
}
$this->addSubForm($subForm, 'Translation');
$this->bhvkSubDecorators($subForm);
$element = new Zend_Form_Element_Submit('infomail_submit');
$element->setLabel('Verwerken')->setAttrib('class', 'submit');
$this->addElement($element);
$this->addDisplayGroup(array('infomail_submit'), 'submit', array('class' => 'submit'));
$this->bhvkDecorators();
$this->bhvkDecorateSubmit('infomail_submit');
}
示例13: init
public function init()
{
parent::init();
$subForm = new Zend_Form_SubForm('Translation');
foreach (Model_Hm_Lang::listAll() as $lang) {
$subSubForm = new Zend_Form_SubForm($lang->code);
$element = new Zend_Form_Element_Textarea('content');
$element->setLabel('Commentaar')->setAttrib('rows', 2)->setAttrib('class', 'autoexpand')->setRequired(true)->setValidators(array(array('stringLength', null, array('min' => 40))));
$subSubForm->addElement($element);
$subSubForm->addDisplayGroup(array('content'), $lang->code, array('class' => 'textarea', 'legend' => $lang->name));
$this->bhvkSubDecorators($subSubForm);
$subForm->addSubForm($subSubForm, $lang->code);
}
$this->bhvkSubDecorators($subForm);
$this->addSubForm($subForm, 'Translation');
$element = new Zend_Form_Element_Submit('submit_comment');
$element->setLabel('Verwerken')->setAttrib('class', 'submit');
$this->addElement($element);
$this->addDisplayGroup(array('submit_comment'), 'submit', array('class' => 'submit'));
$this->bhvkDecorators();
$this->bhvkDecorateSubmit('submit_comment');
}
示例14: init
public function init()
{
parent::init();
$element = new Zend_Form_Element_Text('date');
$element->setLabel('Datum')->setDescription('De datum wanneer deze uitgave in rekening
gebracht dient te worden. Voorbeeld: 24-08-1985')->setValidators(array(array('date', false, array('format' => 'dd-MM-YYYY')), array('stringLength', false, array('max' => 10))))->setAttribs(array('class' => 'datepicker', 'maxLength' => 10))->setRequired(true);
$this->addElement($element);
$element = new Zend_Form_Element_Text('price');
$element->setLabel('Prijs')->setRequired(true)->setValidators(array(array('float')));
$this->addElement($element);
$this->addDisplayGroup(array('date', 'price'), 'algemeen', array('legend' => 'Algemeen'));
/*
* Translations
*/
$subForm = new Zend_Form_SubForm('Translation');
$langs = Model_Hm_Lang::listAll();
foreach ($langs as $lang) {
$subSubForm = new Zend_Form_SubForm($lang->code);
$element = new Zend_Form_Element_Textarea('description');
$element->setLabel('Omschrijving')->setRequired(true)->setValidators(array(array('stringLength', false, array('min' => 40))))->setFilters(array('stripTags', 'htmlEntities'))->setAttrib('class', 'autoexpand')->setAttrib('rows', 2);
$subSubForm->addElement($element);
$subSubForm->addDisplayGroup(array('description'), $lang->code, array('legend' => $lang->name, 'class' => 'textarea'));
$subForm->addSubForm($subSubForm, $lang->code);
$this->bhvkSubDecorators($subSubForm);
}
$this->addSubForm($subForm, 'Translation');
$this->bhvkSubDecorators($subForm);
/*
*
*/
$element = new Zend_Form_Element_Submit('submit_invoicecharge');
$element->setLabel('Verwerken')->setAttrib('class', 'submit');
$this->addElement($element);
$this->addDisplayGroup(array('submit_invoicecharge'), 'submit', array('class' => 'submit'));
$this->bhvkDecorators();
$this->bhvkDecorateSubmit('submit_invoicecharge');
}
示例15: addItemXpathsToExtend
protected function addItemXpathsToExtend($itemXpathsToExtend)
{
if (count($itemXpathsToExtend) == 0) {
$itemXpathsToExtend = array(new Kaltura_Client_Type_ExtendingItemMrssParameter());
}
$mainSubForm = new Zend_Form_SubForm();
$mainSubForm->setLegend('Item XPaths To Extend');
$mainSubForm->setDecorators(array('FormElements', array('ViewScript', array('viewScript' => 'distribution-item-xpath-to-extend.phtml', 'placement' => 'APPEND')), 'Fieldset'));
$i = 1;
$extendCategory = false;
$extendParentCategory = false;
foreach ($itemXpathsToExtend as $itemXPath) {
/* @var $itemXPath Kaltura_Client_Type_ExtendingItemMrssParameter */
//if it a category identifier
if ($itemXPath->identifier instanceof Kaltura_Client_Type_CategoryIdentifier) {
/* @var $identifier Kaltura_Client_Type_CategoryIdentifier */
$identifier = $itemXPath->identifier;
//if the parameters are set exactly as the admin console sets.
if ($itemXPath->xpath == '//category' && $itemXPath->extensionMode == Kaltura_Client_Enum_MrssExtensionMode::REPLACE && $identifier->identifier == Kaltura_Client_Enum_CategoryIdentifierField::FULL_NAME) {
foreach (explode(',', $identifier->extendedFeatures) as $extendedFeature) {
if ($extendedFeature == Kaltura_Client_Enum_ObjectFeatureType::METADATA) {
$extendCategory = true;
} elseif ($extendedFeature == Kaltura_Client_Enum_ObjectFeatureType::ANCESTOR_RECURSIVE) {
$extendParentCategory = true;
}
}
}
continue;
}
$subForm = new Zend_Form_SubForm(array('disableLoadDefaultDecorators' => true));
$subForm->setDecorators(array('FormElements'));
$subForm->addElement('text', 'itemXpathsToExtend', array('decorators' => array('ViewHelper', array('HtmlTag', array('tag' => 'div'))), 'isArray' => true, 'value' => $itemXPath->xpath));
$mainSubForm->addSubForm($subForm, 'itemXpathsToExtend_subform_' . $i++);
}
//set the extend category metadata checkbox
$subForm = new Zend_Form_SubForm(array('disableLoadDefaultDecorators' => true));
$subForm->setDecorators(array('FormElements'));
$subForm->addElement('checkbox', 'includeCategoryInMrss', array('label' => 'Include category-level custom metadata in MRSS', 'isArray' => true, 'value' => $extendCategory));
$subForm->getElement('includeCategoryInMrss')->getDecorator('Label')->setOption('placement', 'APPEND');
$subForm->getElement('includeCategoryInMrss')->setChecked($extendCategory);
$mainSubForm->addSubForm($subForm, 'itemXpathsToExtend_subform_' . $i++, 99);
//set the extend category parent metadata checkbox
$subForm = new Zend_Form_SubForm(array('disableLoadDefaultDecorators' => true));
$subForm->setDecorators(array('FormElements'));
$subForm->addElement('checkbox', 'includeCategoryParentInMrss', array('label' => 'Include parent categories', 'isArray' => true, 'value' => $extendParentCategory));
$subForm->getElement('includeCategoryParentInMrss')->getDecorator('Label')->setOption('placement', 'APPEND');
$subForm->getElement('includeCategoryParentInMrss')->setChecked($extendParentCategory);
$mainSubForm->addSubForm($subForm, 'itemXpathsToExtend_subform_' . $i++, 100);
$this->addSubForm($mainSubForm, 'itemXpathsToExtend_group');
}