public function init() { $subject = new Monkeys_Form_Element_Text('subject'); translate('Subject'); $subject->setLabel('Subject')->setRequired(true); $cc = new Monkeys_Form_Element_Text('cc'); translate('CC'); $cc->setLabel('CC'); $bodyPlain = new Monkeys_Form_Element_Textarea('bodyPlain'); $bodyPlain->setDecoratorOptions(array('separateLine' => true)); $bodyHTML = new Monkeys_Form_Element_Richtextarea('bodyHTML'); $bodyHTML->setDecoratorOptions(array('separateLine' => true))->setAttrib('width', '510px'); $this->addElements(array($subject, $cc, $bodyPlain, $bodyHTML)); }
public function init() { $title = new Monkeys_Form_Element_Text('title'); translate('Title'); $title->setLabel('Title')->setRequired(true)->setAttrib('style', 'width:350px'); $date = new Monkeys_Form_Element_DateTime('date'); translate('Publication date'); $date->setLabel('Publication date')->setShowEmptyValues(false)->setStartEndYear(1900, date('Y') + 1)->setReverseYears(true)->setValue(date('Y-m-d H:i')); $excerpt = new Monkeys_Form_Element_Textarea('excerpt'); translate('Excerpt'); $excerpt->setLabel('Excerpt')->setAttrib('style', 'width:350px')->setAttrib('rows', 4); $content = new Monkeys_Form_Element_Richtextarea('content'); $content->setDecoratorOptions(array('separateLine' => true))->setAttrib('width', '510px')->setRequired(true); $this->addElements(array($title, $date, $excerpt, $content)); }