'', 'afterThumbnail' => '', 'beforeDelete' => '', 'afterDelete' => '', 'beforeElement' => '', 'afterElement' => '', ); public function render($content) { /** @var Qs_Form_Element_ExtendedImage $element */ $element = $this->getElement(); $view = $element->getView(); $content = Zend_Form_Decorator_File::render($content); $translator = $element->getTranslator(); $topHtml = ''; $resize = $element->getResize(); $resizeHtml = ''; if (!empty($resize)) { $resizeTitle = 'Please resize the image automatically'; $sizeNote = 'Preferred Image '; if (empty($resize['width'])) { $sizeNote .= 'height is %value% px'; $sizeValue = $resize['height']; } elseif (empty($resize['height'])) { $sizeNote .= 'width is %value% px'; $sizeValue = $resize['width']; } else { $sizeNote .= 'Size is %value% px'; $sizeValue = $resize['width'] . 'x' . $resize['height']; } if ($translator) { $sizeNote = $translator->translate($sizeNote); $resizeTitle = $translator->translate($resizeTitle); } $sizeNote = str_replace('%value%', $sizeValue, $sizeNote); $resizeName = $element->getName() . '[resize]'; $resizeHtml = $view->formCheckbox($resizeName, Qs_Request::getRequestValue($resizeName, 'y'), null, array('checkedValue' => 'y', 'uncheckedValue' => 'n')) . ' '; $resizeHtml .= $view->formLabel($resizeName, $resizeTitle); $resizeHtml = '
' . $sizeNote . '
' . '
' . $resizeHtml . '
'; } if ($element->getValue()) { $topHtml = $this->_additionalHtml['beforeThumbnail'] . '' . $this->_additionalHtml['afterThumbnail'] . '' . $this->_additionalHtml['beforeDelete']; if (!$element->isRequired()) { if (empty($this->_additionalHtml['beforeDelete'])) { $topHtml .= '
'; } $deleteTitle = 'delete'; if ($translator) { $deleteTitle = $translator->translate($deleteTitle); } $topHtml .= ' ' . ''; } $topHtml .= $this->_additionalHtml['afterDelete'] . '
'; } else if (($thumbnail = $element->getDefaultThumbnail())) { $topHtml = $this->_additionalHtml['beforeThumbnail'] . '' . $this->_additionalHtml['afterThumbnail'] . '
'; } return $topHtml . $this->_additionalHtml['beforeElement'] . $content . $resizeHtml . $this->_additionalHtml['afterElement']; } }