コード例 #1
0
 public function load($row, $postData = array())
 {
     $ret = parent::load($row, $postData);
     $component = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($row->component_id, array('ignoreVisible' => true));
     if ($component) {
         //component can be non-existent if it's in a not selected card
         if (is_instance_of($component->componentClass, 'Kwc_Abstract_Image_Component')) {
             $contentWidth = $component->getComponent()->getMaxContentWidth();
         } else {
             $contentWidth = $component->getComponent()->getContentWidth();
         }
         $ret[$this->getFieldName()]['contentWidth'] = $contentWidth;
     }
     return $ret;
 }
コード例 #2
0
 protected function _getFormField()
 {
     $ret = new Kwf_Form_Field_File($this->getData()->componentId);
     $ret->setFieldLabel($this->getRow()->field_label);
     if ($this->getRow()->label_width) {
         $ret->setLabelWidth($this->getRow()->label_width);
     }
     $ret->setAllowBlank(!$this->getRow()->required);
     $ret->setHideLabel($this->getRow()->hide_label);
     if ($this->getRow()->label_position_above) {
         $ret->setLabelPosition('above');
     }
     return $ret;
 }
コード例 #3
0
 public function __construct($fieldname = null, $fieldLabel = null)
 {
     parent::__construct($fieldname, $fieldLabel);
     $this->setXtype('kwf.form.field.image.imagefile');
     $this->setAllowOnlyImages(true);
 }