Example #1
0
 public function createCollectionForm($position)
 {
     $subform = new Admin_Form_Document_Collection();
     $multiWrapper = $subform->getDecorator('multiWrapper');
     if (!is_null($multiWrapper) && $multiWrapper instanceof Zend_Form_Decorator_HtmlTag) {
         $multiClass = $multiWrapper->getOption('class');
         $multiClass .= $position % 2 == 0 ? ' even' : ' odd';
         $multiWrapper->setOption('class', $multiClass);
     }
     return $subform;
 }
 public function testPopulateFromPost()
 {
     $form = new Admin_Form_Document_Collection();
     $post = array('Id' => '499');
     $form->populateFromPost($post);
     $collection = new Opus_Collection(499);
     $this->assertEquals($collection->getDisplayName(), $form->getLegend());
     $this->assertEquals($collection->getId(), $form->getElement('Id')->getValue());
 }