private function _getDefaultValues(Kwf_Form_Container_Abstract $form)
 {
     $ret = array();
     foreach ($form->getChildren() as $i) {
         if ($i instanceof Kwf_Form_Container_Abstract) {
             $ret = array_merge($ret, $this->_getDefaultValues($i));
         } else {
             if ($i->getDefaultValue()) {
                 $ret[$i->getFieldName()] = $i->getDefaultValue();
             }
         }
     }
     return $ret;
 }
Example #2
0
 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->setBaseCls('x2-plain');
     $this->setAutoHeight(true);
     $this->setBodyStyle('padding:10px');
 }
 public function getMetaData($model)
 {
     $ret = parent::getMetaData($model);
     if (!isset($ret['border'])) {
         $ret['border'] = false;
     }
     return $ret;
 }
 public function getTemplateVars($values, $fieldNamePostfix = '', $idPrefix = '')
 {
     $ret = parent::getTemplateVars($values, $fieldNamePostfix, $idPrefix);
     $ret['preHtml'] = '';
     // damit ein div ausgegeben wird
     $ret['postHtml'] = '<div class="kwfUp-clear"></div>';
     return $ret;
 }
Example #5
0
 public function __construct($name = null)
 {
     $this->fields = new Kwf_Collection_FormFields(null, 'Kwf_Form_Container_Tab');
     parent::__construct($name);
     $this->setDeferredRender(false);
     //verursacht combobox-view-breite-bug
     $this->setBaseCls('x2-plain');
     $this->setXtype('tabpanel');
     $this->setLayout(null);
 }
Example #6
0
 public function getTemplateVars($values, $fieldNamePostfix = '', $idPrefix = '')
 {
     $ret = parent::getTemplateVars($values, $fieldNamePostfix, $idPrefix);
     $style = '';
     if ($this->getWidth()) {
         $style .= 'width: ' . $this->getWidth() . 'px';
     }
     $ret['preHtml'] = '<div style="' . $style . '">';
     $ret['postHtml'] = '</div>';
     static $nr;
     //TODO: das darf so nicht sein -- bei aenderung bitte chris sagen, da css auf $nr basiert
     $nr++;
     $ret['id'] = 'Column' . $nr;
     return $ret;
 }
 public function __construct($imageLabel)
 {
     parent::__construct();
     $dpr2Check = Kwf_Config::getValue('kwc.requireDpr2');
     $this->setXtype('kwc.image.imageuploadfield');
     $this->setBaseCls('kwc-abstract-image-image-upload-big-preview');
     // Fileupload
     $this->_image = new Kwc_Abstract_Image_ImageFile('Image', $imageLabel);
     $this->_image->setPreviewWidth(390)->setPreviewHeight(184)->setCls('kwc-abstract-image-image-upload-file')->setWidth(390)->setHeight(184);
     $this->fields->add($this->_image);
     $this->_dimensionField = new Kwc_Abstract_Image_DimensionField('dimension', trlKwf('Dimension'));
     $this->_dimensionField->setDpr2Check($dpr2Check);
     $this->_dimensionField->setAllowBlank(false)->setLabelStyle('display:none')->setCtCls('kwc-abstract-image-dimension-container');
     $this->fields->add($this->_dimensionField);
 }
 public function __construct($imageLabel, $imageUploadRelation, $dimensionColumn)
 {
     parent::__construct();
     $this->setPreviewUrl('/kwf/media/upload/preview-with-crop');
     $dpr2Check = Kwf_Config::getValue('kwc.requireDpr2');
     $this->setXtype('kwf.form.field.image.uploadfield');
     $this->setBaseCls('kwf-form-field-image-upload-big-preview');
     // Fileupload
     $cls = $this->_imageFileClass;
     $this->_imageField = new $cls($imageUploadRelation, $imageLabel);
     $this->_imageField->setPreviewWidth(390)->setPreviewHeight(184)->setCls('kwf-form-field-image-upload-file')->setWidth(390)->setHeight(184);
     $this->fields->add($this->_imageField);
     $cls = $this->_dimensionFieldClass;
     $this->_dimensionField = new $cls($dimensionColumn, trlKwf('Dimension'));
     $this->_dimensionField->setDpr2Check($dpr2Check);
     $this->_dimensionField->setAllowBlank(false)->setLabelStyle('display:none')->setCtCls('kwf-form-field-image-dimension-container');
     $this->fields->add($this->_dimensionField);
 }
 public static function getSettings()
 {
     $ret = parent::getSettings();
     $ret['childComponentClasses']['textfield'] = 'Kwf_Form_Field_TextField';
     $ret['childComponentClasses']['checkbox'] = 'Kwf_Form_Field_Checkbox';
     $ret['childComponentClasses']['select'] = 'Kwf_Form_Field_Select';
     $ret['childComponentClasses']['numberfield'] = 'Kwf_Form_Field_NumberField';
     $ret['childComponentClasses']['textarea'] = 'Kwf_Form_Field_TextArea';
     $ret['childComponentClasses']['fieldset'] = 'Kwf_Form_Container_FieldSet';
     $ret['childComponentClasses']['text'] = 'Kwc_Basic_Text_Component';
     $ret['tablename'] = 'Kwc_Formular_Dynamic_Model';
     $ret['decorator'] = 'Kwc_Formular_Decorator_Label';
     $ret['componentName'] = trlKwf('Fieldset');
     $ret['assetsAdmin']['files'][] = 'kwf/Kwc/Paragraphs/Panel.js';
     $ret['assetsAdmin']['files'][] = 'kwf/Kwf/Form/Container/FieldSet/Panel.js';
     return $ret;
 }
Example #10
0
 protected function _getTrlProperties()
 {
     $ret = parent::_getTrlProperties();
     $ret[] = 'html';
     return $ret;
 }
 public function getMetaData($model)
 {
     $ret = parent::getMetaData($model);
     unset($ret['idTemplate']);
     return $ret;
 }
Example #12
0
 public function getFrontendMetaData()
 {
     $ret = parent::getFrontendMetaData();
     $ret['combobox'] = $this->getCombobox()->getFieldName();
     return $ret;
 }