_useNamespace) ? '\\' : '') . 'Qs_Form'; $classGenerator->setName($this->_getClassName()) ->addProperties(array( new Generator\PropertyGenerator( '_defaults', array('enabled' => 'y'), Generator\AbstractMemberGenerator::FLAG_PROTECTED ) )) ->addMethods( array( new MethodGenerator( '_initElements', array(), Generator\AbstractMemberGenerator::FLAG_PROTECTED, $this->_getInitElementsBody() ) ) ) ->setExtendedClass($extendedClass) ->setAbstract(true); return $this->_generateContext($classGenerator); } protected function _getInitElementsBody() { $body = array(); $body[] = '$config = ' . (($this->_useNamespace) ? '\\' : '') . 'Qs_Application::getConfig(\'' . $this->_moduleName . '\');'; $body[] = 'parent::_initElements();'; $body[] = '$this->addElement(\'text\', \'title\', array(\'label\' => \'Title\', \'required\' => true));'; $body[] = '$this->addElement( \'extendedImage\', \'image\', array( \'label\' => \'Image\', \'required\' => false, \'resize\' => $config->image->width . \'x\' . $config->image->height . $config->image->resizeMethodAlias, ) );'; $body[] = '$this->addElement(\'checkbox\', \'enabled\', ' . 'array(\'label\' => \'Show on user end\', \'decoration\' => \'simple\'));'; $body[] = 'return $this;'; return implode(self::LINE_FEED, $body); } }