public function __construct($fieldsetObject, $attributes = array()) { $this->afExtjs = afExtjs::getInstance(); $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'codepress/Ext.ux.CodePress.js'))); $this->attributes['xtype'] = 'codepress'; parent::__construct($fieldsetObject, $attributes); }
public function __construct($containerObject, $attributes = array()) { $this->afExtjs = afExtjs::getInstance(); $this->attributes['xtype'] = 'treeitemselector'; $this->attributes['imagePath'] = $this->afExtjs->getPluginsDir() . 'multiselect/images/'; if (isset($attributes['fromLegend'])) { $this->attributes['fromRootText'] = $attributes['fromLegend']; unset($attributes['fromLegend']); } if (isset($attributes['toLegend'])) { $this->attributes['toRootText'] = $attributes['toLegend']; unset($attributes['toLegend']); } /** * the options attribute, an assoc array for now */ if (isset($attributes['options'])) { $this->attributes['fromChildren'] = $this->afExtjs->asVar(json_encode($attributes['options'])); unset($attributes['options']); } /** * the selected attribute, an assoc array for now */ if (isset($attributes['selected'])) { $this->attributes['toChildren'] = $this->afExtjs->asVar(json_encode($attributes['selected'])); unset($attributes['selected']); } /** * PROCESS state ATTRIBUTE * state can have "disabled" or "editable" values; if state is "readonly", then it's equal to "disabled" */ $this->processState($attributes); parent::__construct($containerObject, $attributes); }
public function __construct($fieldsetObject, $attributes = array()) { $this->attributes['xtype'] = 'textfield'; $this->attributes['inputType'] = 'password'; $this->attributes['width'] = '250'; parent::__construct($fieldsetObject, $attributes); }
public function __construct($fieldsetObject, $attributes = array()) { $this->afExtjs = afExtjs::getInstance(); $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'form/Ext.ux.form.StaticTextField.js'))); $this->attributes['xtype'] = 'statictextfield'; parent::__construct($fieldsetObject, $attributes); }
public function __construct($fieldsetObject, $attributes = array()) { $this->afExtjs = afExtjs::getInstance(); $this->attributes['xtype'] = 'captcha'; if (!isset($this->attributes['input'])) { $this->attributes['input'] = 'true'; } $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'form/Ext.ux.plugins.Captcha.js'))); $this->attributes['width'] = '250'; parent::__construct($fieldsetObject, $attributes); }
public function __construct($containerObject, $attributes = array()) { $this->afExtjs = afExtjs::getInstance(); /* * Set plugins and default attributes */ $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'datetime/Ext.ux.plugins.ExtendedDayTimeSelect.js'))); //$this->attributes['plugins'][]="Ext.ux.plugins.DayTimeSelect"; $this->attributes['xtype'] = 'extendedDayTimeSelect'; parent::__construct($containerObject, $attributes); }
public function __construct($fieldsetObject, $attributes = array()) { $this->attributes['xtype'] = 'hidden'; if (isset($attributes['label'])) { unset($attributes['label']); } if (isset($attributes['comment'])) { unset($attributes['comment']); } if (isset($attributes['help'])) { unset($attributes['help']); } parent::__construct($fieldsetObject, $attributes); }
public function __construct($containerObject, $attributes = array()) { $this->afExtjs = afExtjs::getInstance(); $this->privateName = 'field_' . Util::makeRandomKey(); $this->attributes['xtype'] = 'multiselect'; $this->attributes['width'] = '250'; $this->attributes['height'] = '100'; if (isset($attributes['plugin']) && $attributes['plugin'] == 'listfield') { $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'multiselect/ListField.js'))); $this->attributes['xtype'] = 'listfield'; $this->attributes['height'] = 250; } if (isset($attributes['name'])) { $this->attributes['name'] = $attributes['name']; $this->attributes['id'] = $this->privateName; } /** * add a button to clear the selection */ if (isset($attributes['clear'])) { $this->attributes['tbar'] = array($this->afExtjs->asAnonymousClass(array('text' => 'clear', 'handler' => $this->afExtjs->asMethod(array('parameters' => '', 'source' => 'Ext.getCmp("' . $this->attributes['id'] . '").reset();'))))); unset($attributes['clear']); } /** * the options attribute, an assoc array for now */ if (isset($attributes['options']) && count($attributes['options']) > 0) { $options = array(); foreach ($attributes['options'] as $key => $value) { $options[] = array($key, $value); } $this->attributes['dataFields'] = $this->afExtjs->asVar("['key','value']"); $this->attributes['valueField'] = "key"; $this->attributes['displayField'] = "value"; $this->attributes['data'] = $this->afExtjs->asVar(json_encode($options)); unset($attributes['options']); } /** * PROCESS selected values FROM value & selected ATTRIBUTES * you can use either selected and/or value attributes arrays to select some values from options attribute */ $this->processSelectedValues($attributes); /** * PROCESS state ATTRIBUTE * state can have "disabled" or "editable" values; if state is "readonly", then it's equal to "disabled" */ $this->processState($attributes); parent::__construct($containerObject, $attributes); }
public function __construct($containerObject, $attributes = array()) { $this->afExtjs = afExtjs::getInstance(); $this->attributes['xtype'] = 'itemselectorautosuggest'; $this->attributes['msWidth'] = '250'; $this->attributes['msHeight'] = '200'; $this->attributes['imagePath'] = $this->afExtjs->getPluginsDir() . 'multiselect/images/'; $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'multiselect/Ext.ux.plugins.ItemSelectorAutoSuggest.js'))); if (isset($attributes['name'])) { $this->attributes['name'] = $attributes['name']; $this->attributes['id'] = $attributes['name']; unset($attributes['name']); } /** * add a button to clear the selection */ if (isset($attributes['clear'])) { $this->attributes['toTBar'] = array($this->afExtjs->asAnonymousClass(array('text' => 'clear', 'handler' => $this->afExtjs->asMethod(array('parameters' => '', 'source' => 'Ext.getCmp("' . $this->attributes['id'] . '").reset();'))))); unset($attributes['clear']); } $this->attributes['dataFields'] = $this->afExtjs->asVar("['key','value']"); $this->attributes['valueField'] = "key"; $this->attributes['displayField'] = "value"; /** * the options attribute, an assoc array for now */ if (isset($attributes['options']) && count($attributes['options']) > 0) { $options = array(); foreach ($attributes['options'] as $key => $value) { $options[] = array($key, $value); } $this->attributes['fromData'] = $this->afExtjs->asVar(json_encode($options)); unset($attributes['options']); } else { $this->attributes['fromData'] = $this->afExtjs->asVar("[]"); } /** * PROCESS selected values FROM value & selected ATTRIBUTES * you can use either selected and/or value attributes arrays to select some values from options attribute */ $this->processSelectedValues($attributes); /** * PROCESS state ATTRIBUTE * state can have "disabled" or "editable" values; if state is "readonly", then it's equal to "disabled" */ $this->processState($attributes); parent::__construct($containerObject, $attributes); }
public function __construct($containerObject, $attributes = array()) { $this->attributes['xtype'] = 'checkbox'; if (isset($attributes['label']) && get_class($containerObject) == 'afExtjsFieldCheckboxGroup') { $this->attributes['boxLabel'] = $attributes['label']; unset($attributes['label']); } elseif (isset($attributes['label']) && get_class($containerObject) == 'afExtjsFieldset') { $this->attributes['fieldLabel'] = $attributes['label']; unset($attributes['label']); } if (isset($attributes['value'])) { $this->attributes['inputValue'] = $attributes['value']; unset($attributes['value']); } parent::__construct($containerObject, $attributes); }
public function __construct($fieldsetObject, $attributes = array()) { if (isset($attributes['rich']) && $attributes['rich'] || !isset($attributes['rich'])) { $this->attributes['xtype'] = 'htmleditor'; $this->attributes['height'] = isset($attributes['height']) ? $attributes['height'] : 150; $this->attributes['msgTarget'] = 'side'; } else { $this->attributes['xtype'] = 'textarea'; $this->attributes['autoHeight'] = true; $this->attributes['grow'] = true; $this->attributes['growMin'] = 60; } $this->attributes['anchor'] = "95%"; $this->attributes['boxMinHeight'] = 60; parent::__construct($fieldsetObject, $attributes); }
public function __construct($fieldsetObject, $attributes = array()) { $this->afExtjs = afExtjs::getInstance(); $this->attributes['xtype'] = 'colorfield'; $this->attributes['width'] = '250'; $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'form/colorfield/color-field.js'), 'css' => array($this->afExtjs->getPluginsDir() . 'form/colorfield/color-field.css'))); $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'form/adv-color-picker/code/Color.js'), 'css' => array($this->afExtjs->getPluginsDir() . 'form/adv-color-picker/code/color-picker.css'))); $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'form/adv-color-picker/code/ColorPickerPanel.js'))); $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'form/adv-color-picker/code/ColorPickerWin.js'))); if (isset($attributes['plugin'])) { unset($attributes['plugin']); } if (isset($attributes['value']) && $attributes['value'] != null) { $this->attributes['value'] = $attributes['value']; unset($attributes['value']); } parent::__construct($fieldsetObject, $attributes); }
public function __construct($containerObject, $attributes = array()) { $this->attributes['xtype'] = 'radio'; if (isset($attributes['label'])) { $this->attributes['boxLabel'] = $attributes['label']; unset($attributes['label']); } if (isset($attributes['value'])) { $this->attributes['inputValue'] = $attributes['value']; unset($attributes['value']); } if (isset($attributes['name'])) { $this->attributes['name'] = $attributes['name']; $this->attributes['id'] = $attributes['name'] . '_' . rand(0, 999); unset($attributes['name']); } $this->attributes['listeners']['check'] = array('parameters' => 'field', 'source' => 'field.blur();'); parent::__construct($containerObject, $attributes); }
public function end() { $this->attributes['listeners']['newitem']['parameters'] = 'bs,v'; $this->attributes['listeners']['newitem']['source'] = ' v = v.slice(0,1).toUpperCase() + v.slice(1).toLowerCase(); var newObj = { id: v, name: v }; bs.addItem(newObj); '; $this->attributes['listeners']['render'] = array("parameters" => "ct", "source" => ' return; new Ext.ToolTip({ target : ct.wrapEl, delegate : "li.x-superboxselect-item", //trackMouse : true, anchor:"top", animCollapse:true, hideDelay:1000, renderTo : document.body, listeners : { "beforeshow" : { fn : function(tip) { var rec = this.findSelectedRecord(tip.triggerElement); if(rec && rec.get("description")) tip.body.dom.innerHTML = rec.get("description"); else //tip.body.dom.innerHTML = "<div style=\\"font-style:italic\\">Not Available</div>"; tip.setVisible(false); }, scope : this } } }); '); parent::end(); }
public function __construct($fieldsetObject, $attributes = array()) { $this->afExtjs = afExtjs::getInstance(); if (!isset($attributes['type'])) { $attributes['type'] = 'date'; } switch ($attributes['type']) { case "date": $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'datetime/Ext.ux.form.DateTime.js'))); $this->attributes['xtype'] = 'xdatetime'; $this->attributes['width'] = '250'; $this->attributes['timeActive'] = false; break; case "datetime": $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'datetime/Ext.ux.form.DateTime.js'))); $this->attributes['xtype'] = 'xdatetime'; $this->attributes['width'] = '250'; $this->attributes['timeActive'] = true; break; case "dayplus": $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'datepickerplus/Ext.ux.datepickerplus.js'), 'css' => array($this->afExtjs->getPluginsDir() . 'datepickerplus/datepickerplus.css'))); $this->attributes['xtype'] = 'datefieldplus'; $this->attributes['width'] = '200'; $this->attributes['renderTodayButton'] = false; $this->attributes['showToday'] = false; $this->attributes['multiSelection'] = false; $this->attributes['format'] = 'd/m/Y'; $this->attributes['startDay'] = '1'; $this->attributes['selectionType'] = 'day'; if (isset($attributes['url'])) { $this->attributes['url'] = $attributes['url']; } break; case "weekplus": $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'datepickerplus/Ext.ux.datepickerplus.js'), 'css' => array($this->afExtjs->getPluginsDir() . 'datepickerplus/datepickerplus.css'))); $this->attributes['xtype'] = 'datefieldplus'; $this->attributes['width'] = '200'; $this->attributes['renderTodayButton'] = false; $this->attributes['showToday'] = false; $this->attributes['multiSelection'] = true; $this->attributes['format'] = 'd/m/Y'; $this->attributes['startDay'] = '1'; $this->attributes['selectionType'] = 'week'; $this->attributes['maxSelectionDays'] = 7; if (isset($attributes['url'])) { $this->attributes['url'] = $attributes['url']; } break; case "monthplus": $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'datepickerplus/Ext.ux.datepickerplus.js'), 'css' => array($this->afExtjs->getPluginsDir() . 'datepickerplus/datepickerplus.css'))); $this->attributes['xtype'] = 'datefieldplus'; $this->attributes['width'] = '200'; $this->attributes['renderTodayButton'] = false; $this->attributes['showToday'] = false; $this->attributes['multiSelection'] = true; $this->attributes['format'] = 'd/m/Y'; $this->attributes['startDay'] = '1'; $this->attributes['selectionType'] = 'month'; if (isset($attributes['url'])) { $this->attributes['url'] = $attributes['url']; } break; case "yearplus": $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'yearpicker/Ext.YearPicker.js'), 'css' => array($this->afExtjs->getPluginsDir() . 'yearpicker/Ext.YearPicker.css'))); $this->attributes['xtype'] = 'yearfield'; $this->attributes['width'] = '200'; $this->attributes['showToday'] = false; $this->attributes['multiSelection'] = true; if (isset($attributes['url'])) { $this->attributes['url'] = $attributes['url']; } break; } unset($attributes['type']); parent::__construct($fieldsetObject, $attributes); }
public function __construct($containerObject, $attributes = array(), $parsedData = array()) { $this->attributes['triggerAction'] = 'all'; $this->attributes['minChars'] = isset($attributes['minChars']) ? $attributes['minChars'] : 1; $this->afExtjs = afExtjs::getInstance(); /** * if isset button, then xtype will become combowbutton */ if (isset($attributes['button'])) { $this->attributes['buttonConfig'] = $attributes['button']; $this->attributes['xtype'] = 'combowbutton'; unset($attributes['button']); if (isset($attributes['window'])) { // if(isset($attributes['window']['component'])&&is_object($attributes['window']['component'])) // { // $this->attributes['windowConfig']['items'][]=$attributes['window']['component']->privateName; // // // // unset($attributes['window']['component']); // } $this->attributes['windowConfig'] = array_merge(isset($this->attributes['windowConfig']) ? $this->attributes['windowConfig'] : array(), $attributes['window']); unset($attributes['window']); } $this->attributes['width'] = '250'; if (empty($attributes['options'])) { $this->attributes['store'] = '[[0,"No options available.."]]'; } } else { $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'form/Ext.ux.form.Combo.js'))); $this->attributes['xtype'] = 'combowcolors'; if (isset($attributes['proxy']) && isset($attributes['template'])) { /** * autocomplete combo config */ $storePrivateName = 'store_' . Util::makeRandomKey(); $readerPrivateName = 'reader_' . Util::makeRandomKey(); $proxyPrivateName = 'proxy_' . Util::makeRandomKey(); $templatePrivateName = 'tpl_' . Util::makeRandomKey(); $xtemplatePrivateName = 'xtpl_' . Util::makeRandomKey(); $attributes[$readerPrivateName]['totalProperty'] = 'totalCount'; $attributes[$readerPrivateName]['root'] = 'rows'; foreach ($attributes['proxy']['fields'] as $field) { $attributes[$readerPrivateName]['fields'][] = $this->afExtjs->asAnonymousClass(array('name' => $field)); } $attributes[$readerPrivateName]['fields'][] = $this->afExtjs->asAnonymousClass(array('name' => 'url')); $this->afExtjs->private[$readerPrivateName] = $this->afExtjs->JsonReader($attributes[$readerPrivateName]); unset($attributes[$readerPrivateName]); $attributes[$proxyPrivateName]['url'] = $attributes['proxy']['url']; $this->afExtjs->private[$proxyPrivateName] = $this->afExtjs->HttpProxy($attributes[$proxyPrivateName]); unset($attributes[$proxyPrivateName]); $attributes[$storePrivateName]['reader'] = $this->afExtjs->asVar($readerPrivateName); $attributes[$storePrivateName]['proxy'] = $this->afExtjs->asVar($proxyPrivateName); $this->afExtjs->private[$storePrivateName] = $this->afExtjs->Store($attributes[$storePrivateName]); unset($attributes[$storePrivateName]); $this->afExtjs->private[$templatePrivateName] = '<tpl for="."><div class="search-item">' . $attributes['template'] . '</div></tpl>'; $this->afExtjs->private[$xtemplatePrivateName] = $this->afExtjs->XTemplate(array($this->afExtjs->asVar($templatePrivateName))); $this->attributes['typeAhead'] = false; $this->attributes['loadingText'] = 'Searching...'; $this->attributes['width'] = '250'; $this->attributes['pageSize'] = $attributes['proxy']['limit']; $this->attributes['hideTrigger'] = true; $this->attributes['itemSelector'] = 'div.search-item'; $this->attributes['tpl'] = $this->afExtjs->asVar($xtemplatePrivateName); $this->attributes['store'] = $this->afExtjs->asVar($storePrivateName); $this->attributes['minChars'] = $attributes['proxy']['minChars']; if (isset($attributes['proxy']['selectedIndex'])) { $this->attributes['onSelect'] = $this->afExtjs->asMethod(array("parameters" => "record", "source" => "if(record.data." . $attributes['proxy']['selectedIndex'] . "){var selectedValue=record.data." . $attributes['proxy']['selectedIndex'] . ";this.setRawValue(record.data." . $attributes['proxy']['selectedIndex'] . ");this.setValue(record.data." . $attributes['proxy']['selectedIndex'] . ");this.collapse();}")); } unset($attributes['proxy']); unset($attributes['template']); } else { /** * normal combo config */ $this->attributes['forceSelection'] = true; $this->attributes['disableKeyFilter'] = true; $this->attributes['mode'] = 'local'; $this->attributes['triggerAction'] = 'all'; $this->attributes['width'] = '250'; } } /** * the options attribute, an assoc array for now */ if (isset($attributes['options']) && count($attributes['options']) > 0 && (!isset($attributes['plugin']) || isset($attributes['plugin']) && $attributes['plugin'] != 'autocompleter')) { $options = array(); foreach ($attributes['options'] as $key => $value) { $tarray = null; $tarray[] = $key; if (is_array($value)) { foreach ($value as $k => $v) { $tarray[] = $v; } } else { $tarray[] = $value; $tarray[] = '#FFFFFF'; } $options[] = $tarray; } /** * options will be an array of arrays like ($key,$text,$color) */ $this->attributes['store'] = $this->afExtjs->asVar(json_encode($options)); unset($attributes['options']); } elseif (empty($attributes['options'])) { $this->attributes['store'] = '[[0,"No options available.."]]'; } /** * selected attribute is the same as the value attribute, you can use either of them */ if (isset($attributes['selected'])) { $this->attributes['value'] = $attributes['selected']; unset($attributes['selected']); } if (isset($attributes['name'])) { $this->attributes['hiddenName'] = substr($attributes['name'], -1) == ']' ? substr_replace($attributes['name'], '_value]', -1) : $attributes['name'] . '_value'; } /* * Set plugins and default attributes */ if (isset($attributes['plugin'])) { if ($attributes['plugin'] == 'extended_combo_box') { $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'form/Ext.ux.plugins.ExtendedComboBox.js'))); $this->attributes['plugins'][] = "Ext.ux.plugins.ExtendedComboBox"; $this->attributes['resizable'] = true; $this->attributes['triggerAction'] = 'all'; $this->attributes['forceSelection'] = true; $this->attributes['selectOnFocus'] = true; $this->attributes['hideLabel'] = true; $this->attributes['editable'] = false; } if ($attributes['plugin'] == 'autocompleter') { $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'form/Ext.ux.plugins.RemoteComboAutoSuggest.js'))); //$this->attributes['plugins'][]="Ext.ux.RemoteComboAutoSuggest"; $this->attributes['resizable'] = true; $this->attributes['triggerAction'] = 'all'; $this->attributes['forceSelection'] = true; $this->attributes['selectOnFocus'] = true; $this->attributes['mode'] = 'remote'; $this->attributes['xtype'] = "remotecomboautosuggest"; $this->attributes['enableKeyEvents'] = true; $this->attributes['disableKeyFilter'] = true; if (isset($attributes['url'])) { $this->attributes['url'] = $attributes['url']; } else { $this->attributes['url'] = '/appFlower/autocompleter'; } $this->attributes['store'] = '[]'; /** * example of i:value for autocompleter * <i:value type="orm"> <i:class>ModelCriteriaFetcher</i:class> <i:method name="getDataForComboWidget"> <i:param name="modelName">TicketType</i:param> <i:param name="lookupIn">Name</i:param> </i:method> </i:value> */ if (isset($parsedData['value'])) { $this->attributes['storeParams'] = $parsedData['value']; } } if ($attributes['plugin'] == 'fontfield') { $this->attributes['tpl'] = 'new Ext.XTemplate( \'<tpl for="."><div class="x-combo-list-item" style="margin-bottom:10px;">{text}<br><span style="font-family:\\\'{text}\\\';font-size:15px;">A quick brown fox</span></div></tpl>\' )'; } if ($attributes['plugin'] == 'checkcombo') { $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'form/lovcombo-1.0/js/Ext.ux.form.LovCombo.js'))); $this->afExtjs->setAddons(array('css' => array($this->afExtjs->getPluginsDir() . 'form/lovcombo-1.0/css/Ext.ux.form.LovCombo.css'))); //$this->attributes['plugins'][]="Ext.ux.RemoteComboAutoSuggest"; $this->attributes['xtype'] = "lovcombo"; $this->attributes['triggerAction'] = 'all'; $this->attributes['editable'] = false; $this->attributes['mode'] = 'local'; } unset($attributes['plugin']); } $this->attributes['listWidth'] = $this->attributes['width']; //print_r($this->attributes);die(); parent::__construct($containerObject, $attributes); }