'n'); protected function _initElements() { $dataObj = new Admin\Obj(); $image = $dataObj->getConfig('image')->toArray(); $descriptionLength = $dataObj->getConfig('descriptionLength'); $this->addElement('static', 'albumTitle', array('label' => 'Album')); $this->addElement('text', 'title', array('label' => 'Title', 'required' => true, 'maxlength' => 255)); $resize = $image['width'] . 'x' . $image['height'] . 'cc'; $this->addElement( 'extendedImage', 'image', array( 'label' => 'Image', 'required' => true, 'resize' => $resize, 'validators' => array( array('ImageSize', false, array('minwidth' => $image['width'])) ) ) ); $this->addElement( 'textarea', 'description', array( 'label' => 'Description', 'description' => 'Text space is limited to '. $descriptionLength . ' characters.' ) ); $validatorOptions = array( 'max' => $descriptionLength, 'elementLabel' => $this->getElement('description')->getLabel(), ); $this->getElement('description')->addValidator('StringLength', true, array($validatorOptions)); $this->addElement('checkbox', 'mainImage', array('label' => 'Set as Main Album Image', 'decoration' => 'simple')); return $this; } }