protected function _initFields() { parent::_initFields(); $this->setCreateMissingRow(true); if (!$this->getClass()) { return; } $generators = Kwc_Abstract::getSetting($this->getClass(), 'generators'); $classes = $generators['child']['component']; foreach ($classes as $key => $class) { if (!$class) { continue; } $form = Kwc_Abstract_Form::createChildComponentForm($this->getClass(), "-{$key}", $key); if ($form && count($form->fields)) { if ($this->_getIdTemplateForChild($key)) { $form->setIdTemplate($this->_getIdTemplateForChild($key)); } if (!$this->_createFieldsets || !Kwc_Abstract::hasSetting($class, 'componentName')) { $this->add($form); } else { $name = Kwf_Trl::getInstance()->trlStaticExecute(Kwc_Abstract::getSetting($class, 'componentName')); $name = str_replace('.', ' ', $name); $this->add(new Kwf_Form_Container_FieldSet($name))->setName($key)->add($form); } } } }
protected function _initFields() { parent::_initFields(); $this->add(new Kwf_Form_Field_Checkbox('visible', trlKwf('Visible'))); $form = Kwc_Abstract_Form::createChildComponentForm($this->getClass(), "-child", 'child'); $this->add($form); }
protected function _initFields() { parent::_initFields(); $form = Kwc_Abstract_Form::createChildComponentForm($this->getClass(), "_video", 'video'); $form->setIdTemplate('{0}_video'); $this->add($form); }
public function __construct($name, $class) { parent::__construct($name, $class); $form = Kwc_Abstract_Form::createChildComponentForm($class, '-downloadTag'); $this->add($form); $this->add(new Kwf_Form_Field_TextField('infotext', trlKwf('Description')))->setWidth(300)->setAutoFillWithFilename('filenameWithExt')->setHelpText(trlKwf('Text, shown after the file icon (automatically generated) and used as link for downloading the file.'))->setAllowBlank(false); }
protected function _initFields() { parent::_initFields(); $masterCC = Kwc_Abstract::getSetting($this->getClass(), 'masterComponentClass'); if (Kwc_Abstract::getSetting($masterCC, 'imageCaption')) { $this->add(new Kwf_Form_Field_ShowField('original_image_caption', trlKwf('Original Image caption')))->setData(new Kwf_Data_Trl_OriginalComponent('image_caption')); $this->add(new Kwf_Form_Field_TextField('image_caption', trlKwf('Image caption')))->setWidth(300); } if (Kwc_Abstract::getSetting($masterCC, 'editFilename') || Kwc_Abstract::getSetting($masterCC, 'altText') || Kwc_Abstract::getSetting($masterCC, 'titleText')) { $fs = $this->add(new Kwf_Form_Container_FieldSet('SEO')); $fs->setCollapsible(true); $fs->setCollapsed(true); } if (Kwc_Abstract::getSetting($masterCC, 'editFilename')) { $fs->add(new Kwf_Form_Field_ShowField('original_filename', trlKwf('Original {0}', trlKwf('Filename'))))->setData(new Kwf_Data_Trl_OriginalComponent('filename')); $fs->add(new Kwf_Form_Field_TextField('filename', trlKwf('Filename')))->setWidth(300)->setHelpText(trlKwf('Talking filename ("lorem-ipsum-2015"), hyphens and underscores are allowed.')); } if (Kwc_Abstract::getSetting($masterCC, 'altText')) { $fs->add(new Kwf_Form_Field_ShowField('original_alt_text', trlKwf('Original {0}', 'ALT Text')))->setData(new Kwf_Data_Trl_OriginalComponent('alt_text')); $fs->add(new Kwf_Form_Field_TextField('alt_text', 'ALT Text'))->setWidth(300)->setHelpText(trlKwf('Short, meaningful description of the image content.')); } if (Kwc_Abstract::getSetting($masterCC, 'titleText')) { $fs->add(new Kwf_Form_Field_ShowField('original_title_text', trlKwf('Original {0}', 'ALT Text')))->setData(new Kwf_Data_Trl_OriginalComponent('title_text')); $fs->add(new Kwf_Form_Field_TextField('title_text', 'IMG Title'))->setWidth(300)->setHelpText(trlKwf('Some browsers show the text as a tooltip when the mouse pointer is hovering the image.')); } $this->add(new Kwf_Form_Field_ShowField('image', trlKwf('Original Image')))->setData(new Kwc_Abstract_Image_Trl_Form_ImageData()); $fs = $this->add(new Kwf_Form_Container_FieldSet(trlKwf('Own Image'))); $fs->setCheckboxToggle(true); $fs->setCheckboxName('own_image'); $fs->add(Kwc_Abstract_Form::createChildComponentForm($this->getClass(), '-image', 'image')); }
public function __construct($name, $class) { parent::__construct($name, $class); $form = Kwc_Abstract_Form::createChildComponentForm($class, '-downloadTag'); $this->add($form); $this->add(new Kwf_Form_Field_TextField('infotext', trlKwf('Description')))->setWidth(300)->setAutoFillWithFilename('filenameWithExt')->setHelpText(hlpKwf('kwc_download_linktext'))->setAllowBlank(false); }
protected function _initFields() { parent::_initFields(); $this->setCreateMissingRow(true); $this->add(Kwc_Abstract_Form::createChildComponentForm($this->getClass(), '-linktext', 'linktext')); $this->add(new Kwf_Form_Field_Checkbox('start_opened', trlKwf('Start opened'))); }
protected function _initFields() { parent::_initFields(); $this->setCreateMissingRow(true); $this->setModel(new Kwf_Model_FnF()); $form = Kwc_Abstract_Form::createChildComponentForm($this->getClass(), "-linkTag", 'linkTag'); $this->add($form); }
protected function _initFields() { parent::_initFields(); $form = Kwc_Abstract_Form::createChildComponentForm($this->getClass(), '_mail'); $form->setIdTemplate('{component_id}_{id}_mail'); $this->add($form); $this->add(new Kwf_Form_Field_ShowField('create_date', trlKwf('Creation Date')))->setWidth(300); }
public function __construct($name, $class) { parent::__construct($name, $class); $form = Kwc_Abstract_Form::createChildComponentForm($class, '-downloadTag'); $this->add($form); $this->add(new Kwf_Form_Field_TextField('infotext', trlKwf('Descriptiontext')))->setWidth(300)->setHelpText(hlpKwf('kwc_download_linktext')); $this->add(new Kwf_Form_Field_ShowField('original_infotext', trlKwf('Original')))->setData(new Kwf_Data_Trl_OriginalComponent('infotext')); }
protected function _initFields() { parent::_initFields(); $fs = $this->add(new Kwf_Form_Container_FieldSet(trlKwf('Own Flash'))); $fs->setCheckboxToggle(true); $fs->setCheckboxName('own_flash'); $fs->add(Kwc_Abstract_Form::createChildComponentForm($this->getClass(), '-flash', 'flash')); }
public function __construct($name, $class) { parent::__construct($name, $class); $form = Kwc_Abstract_Form::createChildComponentForm($class, '-downloadTag'); $this->add($form); $this->add(new Kwf_Form_Field_TextField('infotext', trlKwf('Descriptiontext')))->setWidth(300)->setHelpText(trlKwf('Text, shown after the file icon (automatically generated) and used as link for downloading the file.')); $this->add(new Kwf_Form_Field_ShowField('original_infotext', trlKwf('Original')))->setData(new Kwf_Data_Trl_OriginalComponent('infotext')); }
protected function _initFields() { parent::_initFields(); $fs = $this->add(new Kwf_Form_Container_FieldSet(trlKwf('Own Download'))); $fs->setCheckboxToggle(true); $fs->setCheckboxName('own_download'); $fs->add(Kwc_Abstract_Form::createChildComponentForm($this->getClass(), '-download', 'download')); $this->add(new Kwf_Form_Field_ShowField('original_filename', trlKwf('Original Filename')))->setData(new Kwc_Basic_DownloadTag_Trl_Form_OriginalData('filename')); }
protected function _initFields() { parent::_initFields(); $form = Kwc_Abstract_Form::createChildComponentForm($this->getClass(), "-linkTag"); if (count($form->fields)) { $fs = $this->add(new Kwf_Form_Container_FieldSet(trlKwf('Click on Preview Image') . ':')); $fs->add($form); } }
protected function _initFields() { parent::_initFields(); $this->add(Kwc_Abstract_Form::createChildComponentForm($this->getClass(), "-image")); if (!$this->getModel()) { $this->setModel(new Kwf_Model_FnF()); $this->setCreateMissingRow(true); } }
protected function _initFields() { parent::_initFields(); $this->add(Kwc_Abstract_Form::createChildComponentForm($this->getClass(), "-child", 'child')); $fs = $this->add(new Kwf_Form_Container_FieldSet(trlKwf("Original"))); $fs->add(new Kwf_Form_Field_Panel('copy'))->setHideLabel(true)->setXtype('kwc.basic.text.trl.copybutton'); $fs->add(new Kwf_Form_Field_ShowField('content'))->setHideLabel(true)->setCls('kwfup-webStandard')->setData(new Kwf_Data_Trl_OriginalComponent()); if (!$this->getModel()) { $this->setModel(new Kwf_Model_FnF()); $this->setCreateMissingRow(true); } }
protected function _initFields() { parent::_initFields(); $this->add(new Kwf_Form_Field_TextField('title', trlKwf('Title')))->setAllowBlank(false)->setWidth(500); $this->add(new Kwf_Form_Field_ShowField('original_title', trlKwf('Original')))->setData(new Kwf_Data_Trl_OriginalComponentFromData('title')); $this->add(new Kwf_Form_Field_TextArea('teaser', trlKwf('Teaser')))->setWidth(500)->setHeight(100); $this->add(new Kwf_Form_Field_ShowField('original_teaser', trlKwf('Original')))->setData(new Kwf_Data_Trl_OriginalComponentFromData('teaser')); $this->add(new Kwf_Form_Field_ShowField('original_date', trlKwf('Publication')))->setData(new Kwf_Data_Trl_OriginalComponentFromData('date'))->setTpl('{value:date}'); $this->add(new Kwf_Form_Field_ShowField('original_author_id', trlKwf('Author')))->setData(new Kwc_Articles_Detail_Trl_Data('author_id')); $this->add(new Kwf_Form_Field_ShowField('original_vi_nr', trlKwf('VI-Number')))->setData(new Kwf_Data_Trl_OriginalComponentFromData('vi_nr')); $this->add(Kwc_Abstract_Form::createChildComponentForm($this->getClass(), '-previewImage')); }
protected function _getMultiFields() { $multifields = new Kwf_Form_Field_MultiFields('Children'); $multifields->setMinEntries(0); if (Kwc_Abstract::getSetting($this->getClass(), 'hasVisible')) { $multifields->fields->add(new Kwf_Form_Field_Checkbox('visible', trlKwf('Visible'))); } $multifields->setPosition(true); $form = Kwc_Abstract_Form::createChildComponentForm($this->getClass(), 'child'); $form->setIdTemplate('{component_id}-{id}'); $multifields->fields->add($form); return $multifields; }
protected function _initFields() { parent::_initFields(); $imageCaption = Kwc_Abstract::getSetting(Kwc_Abstract::getSetting($this->getClass(), 'masterComponentClass'), 'imageCaption'); if ($imageCaption) { $this->add(new Kwf_Form_Field_ShowField('original_image_caption', trlKwf('Original Image caption')))->setData(new Kwf_Data_Trl_OriginalComponent('image_caption')); $this->add(new Kwf_Form_Field_TextField('image_caption', trlKwf('Image caption'))); } $this->add(new Kwf_Form_Field_ShowField('image', trlKwf('Original Image')))->setData(new Kwc_Abstract_Image_Trl_Form_ImageData()); $fs = $this->add(new Kwf_Form_Container_FieldSet(trlKwf('Own Image'))); $fs->setCheckboxToggle(true); $fs->setCheckboxName('own_image'); $fs->add(Kwc_Abstract_Form::createChildComponentForm($this->getClass(), '-image', 'image')); }
protected function _initFields() { parent::_initFields(); $fs = new Kwf_Form_Container_FieldSet(trlKwf('Form Properties')); $fs->add(new Kwf_Form_Field_TextField('recipient', trlKwf('E-Mail Recipient')))->setVtype('email')->setWidth(400); $fs->add(new Kwf_Form_Field_TextField('recipient_cc', trlKwf('E-Mail CC')))->setVtype('email')->setWidth(400); $fs->add(new Kwf_Form_Field_TextField('subject', trlKwf('E-Mail Subject')))->setWidth(400); $fs->add(new Kwf_Form_Field_TextField('submit_caption', trlKwf('Submit Caption')))->setWidth(400); $this->add($fs); $fs = new Kwf_Form_Container_FieldSet(trlKwf('Send copy to User')); $this->add($fs)->setCheckboxToggle(true)->setCheckboxName('send_confirm_mail'); $fs->add(new Kwf_Form_Field_Select('confirm_field_component_id', trlKwf('E-Mail Field')))->setAllowBlank(false)->setValues(Kwc_Admin::getInstance($this->getClass())->getControllerUrl('EmailFields') . '/json-data'); $fs->add(new Kwf_Form_Field_TextField('confirm_subject', trlKwf('Subject')))->setWidth(300)->setAllowBlank(false); $this->add(Kwc_Abstract_Form::createChildComponentForm($this->getClass(), '-form')); }
public function jsonMultiUploadAction() { Zend_Registry::get('db')->beginTransaction(); $asciiFilter = new Kwf_Filter_Ascii(); $uploadIds = explode(',', $this->_getParam('uploadIds')); $max = Kwc_Abstract::getSetting($this->_getParam('class'), 'maxEntries'); if ($max) { $s = new Kwf_Model_Select(); $s->whereEquals('component_id', $this->_getParam('componentId')); if ($this->_model->countRows($s) + count($uploadIds) >= $max) { throw new Kwf_Exception_Client(trlKwf("Can't create more than {0} entries.", $max)); } } foreach ($uploadIds as $uploadId) { $fileRow = Kwf_Model_Abstract::getInstance('Kwf_Uploads_Model')->getRow($uploadId); $row = $this->_model->createRow(); $this->_beforeInsert($row, null); $this->_beforeSave($row, null); $row->save(); $form = Kwc_Abstract_Form::createChildComponentForm($this->_getParam('class'), 'child'); $form->setIdTemplate(null); $field = $this->_getFileUploadField($form); if (!$field) { throw new Kwf_Exception("can't find file field"); } $form->setId($this->_getParam('componentId') . '-' . $row->id); $postData = array($field->getFieldName() => $uploadId); foreach ($this->_getAutoFillFilenameField($form) as $f) { if ($f->getAutoFillWithFilename() == 'filename') { $postData[$f->getFieldName()] = $asciiFilter->filter($fileRow->filename); } else { if ($f->getAutoFillWithFilename() == 'filenameWithExt') { $postData[$f->getFieldName()] = $asciiFilter->filter($fileRow->filename) . '.' . $fileRow->extension; } } } $postData = array_merge($postData, $this->_getDefaultValues($form)); $postData = $form->processInput(null, $postData); if ($errors = $form->validate(null, $postData)) { throw new Kwf_Exception('validate failed'); } $form->prepareSave(null, $postData); $form->save(null, $postData); } Zend_Registry::get('db')->commit(); }
protected function _getConfig() { $ret = parent::_getConfig(); $cacheId = 'extConfig_multiFileUpload_' . $this->_class; $multiFileUpload = Kwf_Cache_SimpleStatic::fetch($cacheId, $success); if (!$success) { $multiFileUpload = false; $form = Kwc_Abstract_Form::createChildComponentForm($this->_class, 'child'); if ($form && ($field = $this->_getFileUploadField($form))) { $multiFileUpload = array('allowOnlyImages' => $field->getAllowOnlyImages(), 'maxResolution' => $field->getMaxResolution(), 'maxResolution' => $field->getMaxResolution(), 'fileSizeLimit' => $field->getFileSizeLimit()); } Kwf_Cache_SimpleStatic::add($cacheId, $multiFileUpload); } $ret['list']['multiFileUpload'] = $multiFileUpload; $ret['list']['maxEntries'] = Kwc_Abstract::getSetting($this->_class, 'maxEntries'); $ret['list']['maxEntriesErrorMessage'] = trlKwf("Can't create more than {0} entries.", $ret['list']['maxEntries']); return $ret; }
public function __construct($name, $class) { parent::__construct($name, $class); $this->setLabelWidth(120); $this->fields->add(new Kwf_Form_Field_GoogleMapsField('coordinates', trlKwf('Coordinates'))); $this->fields->add(new Kwf_Form_Field_Select('zoom', trlKwf('Zoomlevel')))->setAllowBlank(false)->setValues($this->_getZoomLevels())->setWidth(120); $this->fields->add(new Kwf_Form_Field_NumberField('width', trlKwf('Width')))->setAllowNegative(false)->setAllowDecimals(false)->setAllowBlank(true)->setWidth(120)->setComment(trlKwfStatic('optional, if empty full width')); $this->fields->add(new Kwf_Form_Field_NumberField('height', trlKwf('Height')))->setAllowNegative(false)->setAllowDecimals(false)->setAllowBlank(false)->setWidth(120); $this->fields->add(new Kwf_Form_Field_Select('zoom_properties', trlKwf('Zoom properties')))->setValues(array('0' => trlKwfStatic('Move + Zoom'), '1' => trlKwfStatic('Move + Zoom (without zoombar)'), '2' => trlKwfStatic('None')))->setWidth(300)->setAllowBlank(false); $this->fields->add(new Kwf_Form_Field_Checkbox('scale', trlKwf('Scale'))); $this->fields->add(new Kwf_Form_Field_Checkbox('satelite', trlKwf('Satelitemap'))); $this->fields->add(new Kwf_Form_Field_Checkbox('overview', trlKwf('Overviewmap'))); $this->fields->add(new Kwf_Form_Field_Checkbox('routing', trlKwf('Routing'))); $this->fields->add(new Kwf_Form_Field_Checkbox('scrollwheel', trlKwf('Enable Scrollwheel to zoom'))); $form = Kwc_Abstract_Form::createChildComponentForm($class, '-text'); $form->fields->getByName('content')->setHeight(170); $this->fields->add($form); }
public function addUserForms($detailsClass, $forms) { $generators = Kwc_Abstract::getSetting($detailsClass, 'generators'); $classes = $generators['child']['component']; foreach ($classes as $component => $class) { if ($forms == 'all' || in_array($component, $forms)) { $form = Kwc_Abstract_Form::createChildComponentForm($detailsClass, '-' . $component); if ($form->getModel() && $form->getModel() instanceof Kwf_User_Model) { $form->setIdTemplate("{0}"); } else { $form->setIdTemplate("users_{0}-{$component}"); } if ($form) { $this->add($form); } } } }
protected function _getMultiFields() { $multifields = new Kwf_Form_Field_MultiFields('Children'); $multifields->setMinEntries(0); $multifields->setPosition(true); if (Kwc_Abstract::getSetting($this->getClass(), 'hasVisible')) { $multifields->fields->add(new Kwf_Form_Field_Checkbox('visible', trlKwf('Visible'))); } foreach (Kwf_Component_Data_Root::getInstance()->getPlugins('Kwf_Component_PluginRoot_Interface_GeneratorProperty') as $plugin) { $params = $plugin->getGeneratorProperty(Kwf_Component_Generator_Abstract::getInstance($this->getClass(), 'child')); if ($params) { $multifields->fields->add(new Kwf_Form_Field_Select($params['name'], $params['label']))->setValues($params['values'])->setDefaultValue($params['defaultValue'])->setData(new Kwf_Component_PluginRoot_GeneratorProperty_Data($plugin, $this)); } } $form = Kwc_Abstract_Form::createChildComponentForm($this->getClass(), 'child'); $form->setIdTemplate('{component_id}-{id}'); $multifields->fields->add($form); return $multifields; }
protected function _initFields() { parent::_initFields(); $text = Kwc_Abstract_Form::createChildComponentForm($this->getClass(), "-text"); $this->add($text); // breite des html-editors ermitteln foreach ($text->fields as $f) { if (is_instance_of($f, 'Kwf_Form_Field_HtmlEditor')) { $editorWidth = $f->getWidth(); break; } } $fs = $this->add(new Kwf_Form_Container_FieldSet(trlKwf('Image')))->setName('image')->setCheckboxToggle(true)->setCheckboxName('image')->setWidth($editorWidth); $image = Kwc_Abstract_Form::createChildComponentForm($this->getClass(), "-image"); $fs->add($image); $fs = $fs->add(new Kwf_Form_Container_FieldSet(trlKwf('Text/Image - Alignment')))->setName('alignment'); $fs->add(new Kwf_Form_Field_Radio('position', trlKwf('Alignment')))->setValues(array('left' => trlKwf('Left'), 'right' => trlKwf('Right'), 'center' => trlKwf('Center')))->setWidth(210); $fs->add(new Kwf_Form_Field_Checkbox('flow', trlKwf('Text flows around Image'))); }
protected function _init() { parent::_init(); $gen = Kwc_Abstract::getSetting($this->getClass(), 'generators'); $classes = $gen['child']['component']; $cards = $this->add(new Kwf_Form_Container_Cards('component', trlKwf('Type')))->setDefaultValue(key($classes)); $hidden = new Kwf_Form_Field_Hidden('component'); $hidden->setData(new Kwc_Abstract_Cards_Trl_Form_ComponentData()); $cards->setCombobox($hidden); foreach ($classes as $name => $class) { $form = Kwc_Abstract_Form::createChildComponentForm($this->getClass(), '-' . $name, $name); if ($form) { $form->setIdTemplate('{0}-child'); $form->setAutoHeight(true); $form->setBaseCls('x2-plain'); } $card = $cards->add(); $card->setName($name); if ($form) { $card->add($form); } } }