getConfig('image')->toArray(); $descriptionLength = (int) $this->getConfig('descriptionLength'); $this->addElement('static', 'albumTitle', ['label' => 'Album']); $this->addElement('text', 'title', ['label' => 'Title', 'required' => true, 'maxlength' => 255]); $resize = $imageCfg['width'] . 'x' . $imageCfg['height'] . Qs_ImageFs::getResizeMethodAlias($imageCfg['method']); $this->addElement( 'extendedImage', 'image', [ 'label' => 'Image', 'required' => true, 'resize' => $resize, /*'validators' => array( array('ImageSize', false, array('minwidth' => $imageCfg['width'])) )*/ ] ); $this->addElement( 'textarea', 'description', [ 'label' => 'Description', 'description' => 'Text space is limited to ' . $descriptionLength . ' characters.', ] ); $this->getElement('description')->addValidator( 'StringLength', true, ['max' => $descriptionLength, 'elementLabel' => $this->getElement('description')->getLabel()] ); $this->addElement('checkbox', 'enabled', ['label' => 'Show on user end', 'decoration' => 'simple']); return $this; } }