public function addCenterComponent($tools, $attributes = array())
 {
     if ($this->showFullCenter()) {
         if (!afExtjs::getInstance()->isDesktop()) {
             $attributes['title'] = isset($attributes['title']) ? $attributes['title'] : 'Panel';
             $attributes['tools'] = $tools->end();
         } else {
             $attributes['winTitle'] = isset($attributes['title']) ? $attributes['title'] : 'Panel';
             unset($attributes['tools']);
         }
         $attributes = array_merge($attributes, array('id' => 'center_panel_first_panel', 'autoScroll' => true, 'width' => 'auto', 'frame' => true, 'collapsible' => true, 'style' => 'padding-right:0px;', 'idxml' => isset($attributes['idxml']) ? $attributes['idxml'] : false));
         $attributes['plugins'][] = 'new Ext.ux.MaximizeTool()';
         if (isset($this->attributes['viewport']['center_panel']) && count($this->attributes['viewport']['center_panel']) > 0) {
             $attributes = array_merge($attributes, $this->attributes['viewport']['center_panel']);
         }
         $this->afExtjs->privateAttributes['center_panel_first_panel'] = $attributes;
         $this->afExtjs->private['center_panel_first_panel'] = $this->afExtjs->Panel($attributes);
         $attributesPanel['items'][] = $this->afExtjs->asVar('center_panel_first_panel');
         $attributesPanel['border'] = false;
         $attributesPanel['bodyBorder'] = false;
         $attributesPanel['layout'] = 'fit';
         $attributesPanel['id'] = 'center_panel_first';
         $this->afExtjs->private['center_panel_first'] = $this->afExtjs->Panel($attributesPanel);
         $attributesPanelContainer['items'][] = $this->afExtjs->asVar('center_panel_first');
         $attributesPanelContainer['style'] = 'padding-right:5px;';
         $attributesPanelContainer['border'] = false;
         $attributesPanelContainer['bodyBorder'] = false;
         $attributesPanelContainer['layout'] = 'fit';
         $attributesPanelContainer['id'] = 'center_panel';
         $this->addPanel('center', $attributesPanelContainer);
     }
 }
 public function __construct($attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     $this->privateName = 'form_' . Util::makeRandomKey();
     $this->attributes['name'] = $this->privateName;
     $this->attributes['id'] = $this->privateName;
     //$this->attributes['defaults']=array('labelStyle'=>'width:75px;font-size:11px;font-weight:bold;padding:0 3px 3px 0;');
     if (isset($attributes['labelWidth'])) {
         //$this->attributes['defaults']=array('labelStyle'=>'width:'.$attributes['labelWidth'].'px;font-size:11px;font-weight:bold;padding:0 3px 3px 0;');
     }
     /*if(isset($attributes['idxml'])&&$attributes['idxml'])
     		{
     			$this->attributes['id']=$attributes['idxml'];
     		}*/
     $this->afExtjs->setAddons(array('css' => array('/appFlowerPlugin/css/my-extjs.css', $this->afExtjs->getPluginsDir() . 'multiselect/multiselect.css'), 'js' => array($this->afExtjs->getPluginsDir() . 'multiselect/DDView.js', $this->afExtjs->getPluginsDir() . 'multiselect/MultiSelect.js', $this->afExtjs->getPluginsDir() . 'multiselect/ItemSelector.js', $this->afExtjs->getPluginsDir() . 'multiselect/Ext.ux.TreeItemSelector.js', $this->afExtjs->getPluginsDir() . 'tree/Ext.tree.TreeSerializer.js', $this->afExtjs->getPluginsDir() . 'form/Ext.ux.ClassicFormPanel.js', $this->afExtjs->getPluginsDir() . 'form/Ext.ux.form.ComboWButton.js')));
     if (isset($attributes['action'])) {
         $this->attributes['url'] = $attributes['action'];
         unset($attributes['action']);
     }
     if (isset($attributes['portal']) && $attributes['portal'] == true) {
         $this->attributes = array_merge($this->attributes, array('anchor' => '100%', 'frame' => true, 'collapsible' => true, 'draggable' => true, 'cls' => 'x-portlet'));
         unset($attributes['portal']);
     }
     if (isset($attributes['tools'])) {
         $this->attributes['tools'] = $attributes['tools']->end();
         unset($attributes['tools']);
     }
     $this->attributes['getWidgetConfig'] = $this->afExtjs->asMethod("var o={}; o.idxml=this.idxml || false; return o;");
     if (count($attributes) > 0) {
         $this->attributes = array_merge($this->attributes, $attributes);
     }
 }
 public function __construct($fieldsetObject, $attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     $this->containerObject = $fieldsetObject;
     $this->attributes['xtype'] = 'checkboxgroup';
     if (count($this->attributes) > 0) {
         $attributes = array_merge($this->attributes, $attributes);
     }
     if (isset($attributes['name'])) {
         unset($attributes['name']);
     }
     $this->attributes['labelStyle'] = 'font-size:11px;font-weight:bold;';
     if (isset($attributes['state'])) {
         switch ($attributes['state']) {
             case "readonly":
                 $this->attributes['readOnly'] = true;
                 break;
             case "disabled":
                 $this->attributes['disabled'] = true;
                 break;
             case "editable":
                 $this->attributes['disabled'] = false;
                 $this->attributes['readOnly'] = false;
                 break;
         }
         unset($attributes['state']);
     }
     if (isset($attributes['label'])) {
         $this->attributes['fieldLabel'] = $attributes['label'];
         unset($attributes['label']);
     }
     if (isset($attributes['handlers']) && $attributes['handlers'] != '') {
         if (isset($this->attributes['listeners'])) {
             foreach ($this->attributes['listeners'] as $type => $type_params) {
                 /**
                  * if listener function source is not an array then the string is used directly
                  */
                 if (isset($type_params['parameters']) && $type_params['parameters'] != '' && isset($type_params['source']) && !is_array($type_params['source'])) {
                     $this->attributes['listeners'][$type] = array('parameters' => $type_params['parameters'], 'source' => $type_params['source'] . $attributes['handlers'][$type]['source']);
                 }
             }
         } else {
             $this->attributes['listeners'] = $attributes['handlers'];
         }
         unset($attributes['handlers']);
     }
     if (isset($attributes['help']) && $attributes['help'] != '') {
         if (!isset($this->attributes['listeners']['render']['source'])) {
             $this->attributes['listeners']['render']['source'] = '';
         }
         if (!isset($this->attributes['listeners']['render']['parameters'])) {
             $this->attributes['listeners']['render']['parameters'] = 'field';
         }
         $this->attributes['listeners']['render']['source'] .= "new Ext.ToolTip({target: field.getEl(),html: '" . $attributes['help'] . "'});";
         unset($attributes['help']);
     }
     if (count($attributes) > 0) {
         $this->attributes = array_merge($this->attributes, $attributes);
     }
 }
 public function __construct($attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     $this->afExtjs->setAddons(array('js' => array('/appFlowerPlugin/js/custom/cheatJS.js')));
     $this->privateName = 'panel_' . Util::makeRandomKey();
     $this->attributes['id'] = $this->privateName;
     if (isset($attributes['idxml']) && $attributes['idxml']) {
         $this->attributes['id'] = $attributes['idxml'];
     }
     if (isset($attributes['plugins'])) {
         $this->attributes['plugins'][] = $attributes['plugins'];
         unset($attributes['plugins']);
     }
     if (isset($attributes['portal']) && $attributes['portal'] == true) {
         $this->attributes = array_merge($this->attributes, array('anchor' => '100%', 'frame' => true, 'collapsible' => true, 'draggable' => true, 'maximizable' => true, 'cls' => 'x-portlet'));
         $this->attributes['plugins'][] = 'new Ext.ux.MaximizeTool()';
         unset($attributes['portal']);
     }
     if (isset($attributes['tools'])) {
         $this->attributes['tools'] = $attributes['tools']->end();
         unset($attributes['tools']);
     }
     $this->attributes['getWidgetConfig'] = $this->afExtjs->asMethod("var o={}; o.idxml=this.idxml || false; return o;");
     if (count($attributes) > 0) {
         $this->attributes = array_merge($this->attributes, $attributes);
     }
     $this->attributes['listeners']['bodyresize'] = $this->afExtjs->asMethod(array("parameters" => "object,layout", "source" => "if(object.ownerCt.ownerCt)object.ownerCt.ownerCt.doLayout();"));
     if (isset($attributes['autoEnd']) && $attributes['autoEnd'] || !isset($attributes['autoEnd'])) {
         $this->end();
     }
 }
 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($containerObject)
 {
     $this->afExtjs = afExtjs::getInstance();
     $this->attributes['xtype'] = 'tbfill';
     parent::__construct($containerObject);
     $this->end();
 }
 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->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'codepress/Ext.ux.CodePress.js')));
     $this->attributes['xtype'] = 'codepress';
     parent::__construct($fieldsetObject, $attributes);
 }
    public function __construct($attributes = array())
    {
        $this->afExtjs = afExtjs::getInstance();
        /**
         * deferredRender & layoutOnTabChange, for creating the layout of each tab after the tab is clicked
         */
        $this->attributes['deferredRender'] = false;
        //$this->attributes['forceLayout'] = true;
        $ah = array('autoHeight' => isset($attributes['tabHeight']) && $attributes['tabHeight'] ? false : true);
        $this->attributes['defaults'] = $this->afExtjs->asAnonymousClass(array_merge(array('iconCls' => '', 'icon' => '', 'bodyStyle' => 'padding:10px;', 'hideMode' => 'offsets', 'autoWidth' => true), $ah));
        $this->attributes['listeners']['tabchange'] = $this->afExtjs->asMethod(array('parameters' => 'tabPanel,tab', 'source' => "tabPanel.doLayout();"));
        /**
         * Tabs cheats for Ext 3
         */
        if (afExtjsLayout::getInstance()->getExtjsVersion() == 3) {
            $this->attributes['deferredRender']['onTabChange'] = true;
            $this->attributes['listeners']['render'] = $this->afExtjs->asMethod(array('parameters' => 'tabPanel', 'source' => '	
							                	tabPanel.getEl().mask("Rendering UI").setStyle({backgroundColor:"#dfe8f6"}).setOpacity(1);
								                tabPanel.setActiveTab(0);
								                while(true){								                		          	      		
								                	var tp = tabPanel.getActiveTab().nextSibling();								                	
								                	if(!tp) break;
								                	tabPanel.activate(tp);
								                }
								                tabPanel.setActiveTab(0);
								                tabPanel.getEl().unmask();
								               
							         		'));
        }
        if (count($attributes) > 0) {
            $this->attributes = array_merge($this->attributes, $attributes);
        }
        $this->checkIfSetting($this->attributes);
    }
 public function __construct($attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     $this->portalPrivateName = 'portal_' . Util::makeRandomKey();
     if (isset($attributes['portalLayoutType'])) {
         $this->attributes['portal']['portalLayoutType'] = $attributes['portalLayoutType'];
         unset($attributes['portalLayoutType']);
     }
     if (isset($attributes['portalWidgets'])) {
         $this->attributes['portal']['portalWidgets'] = $attributes['portalWidgets'];
         unset($attributes['portalWidgets']);
     }
     /**
      * fixing ticket #1295 part 2
      * 
      * @author Radu Topala <*****@*****.**>
      */
     $this->attributes['portal']['dropConfig']['ddGroup'] = $this->portalPrivateName . '_dd';
     $this->attributes['portal']['bodyBorder'] = false;
     $this->attributes['portal']['autoWidth'] = true;
     @($this->attributes['portal']['style'] .= 'padding-right:5px;');
     @($this->attributes['portal']['bodyStyle'] .= 'overflow-x:hidden;overflow-y:hidden;padding-right:5px;');
     if (count($attributes) > 0) {
         $this->attributes = array_merge($this->attributes, $attributes);
     }
 }
 public function __construct($attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     if (count($attributes) > 0) {
         $this->attributes = array_merge($this->attributes, $attributes);
     }
 }
 public function __construct($containerObject, $attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     if (isset($attributes['label'])) {
         $this->attributes['text'] = $attributes['label'];
         unset($attributes['label']);
     }
     if (isset($attributes['url'])) {
         $param_name = isset($attributes['param']) ? $attributes['param'] : "param";
         $url = $attributes['url'] . "&" . $param_name . "=";
         $param = $containerObject->privateName . '.stack["text"]';
         $cellDiv = $containerObject->privateName . '.stack["cellDiv"]';
         if (isset($attributes['ajax'])) {
             sfProjectConfiguration::getActive()->loadHelpers(array('afExtjsContextMenu'));
             $source = ajax_source($url . '"+' . $param);
         } else {
             $source = 'window.location.href="' . $url . '"+' . $param;
         }
         $this->attributes['handler'] = $this->afExtjs->asMethod(array('parameters' => '', 'source' => $source));
         unset($attributes['url']);
         unset($attributes['ajax']);
         unset($attributes['param']);
     }
     if (isset($attributes['source'])) {
         $this->attributes['handler'] = $this->afExtjs->asMethod(array('parameters' => '', 'source' => $attributes["source"]));
     }
     parent::__construct($containerObject, $attributes);
 }
 public function __construct($realRoot)
 {
     $this->afExtjs = afExtjs::getInstance();
     $this->request = sfContext::getInstance()->getRequest();
     $this->realRoot = $realRoot;
     $this->files = $_FILES;
     $this->start();
 }
Esempio n. 14
0
 public function __construct($attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     if (count($attributes)) {
         $this->attributes = array_merge($this->attributes, $attributes);
     }
     $this->privateName = 'menu_' . Util::makeRandomKey();
 }
 public function __construct($attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     $this->attributes['loader'] = $this->afExtjs->asVar('new Ext.tree.TreeLoader()');
     if (count($attributes) > 0) {
         $this->attributes = array_merge($this->attributes, $attributes);
     }
 }
 public function __construct($attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     $this->setExtjsVersion(3);
     $this->afExtjs->setOptions(array('theme' => 'green'));
     $this->afExtjs->setAddons(array('js' => array('/appFlowerPlugin/js/custom/widgetJS.js')));
     $this->afExtjs->setAddons(array('css' => array('/css/my-extjs.css', $this->afExtjs->getPluginsDir() . 'layout-browser/Ext.ux.layout.CenterLayout.css'), 'js' => array($this->afExtjs->getPluginsDir() . 'layout-browser/Ext.ux.layout.CenterLayout.js', $this->afExtjs->getPluginsDir() . 'form/TriggerField.js')));
 }
 public function __construct($containerObject, $attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     $this->containerObject = $containerObject;
     if (count($this->attributes) > 0) {
         $attributes = array_merge($this->attributes, $attributes);
     }
     if (isset($attributes['icon'])) {
         $this->attributes['cls'] = 'x-btn-text-icon';
     }
     //print_r($attributes);
     if (isset($attributes['icon']) && isset($attributes['iconPosition'])) {
         if ($attributes['iconPosition'] == 'right') {
             $this->attributes['cls'] = 'x-btn-text-icon-right';
         } elseif ($attributes['iconPosition'] == 'left') {
             $this->attributes['cls'] = 'x-btn-text-icon';
         }
     }
     if (isset($attributes['state'])) {
         switch ($attributes['state']) {
             case "disabled":
                 $this->attributes['disabled'] = true;
                 break;
         }
         unset($attributes['state']);
     }
     if (isset($attributes['label'])) {
         $this->attributes['text'] = $attributes['label'];
         unset($attributes['label']);
     }
     if (isset($attributes['handlers']) && $attributes['handlers'] != '') {
         if (isset($this->attributes['listeners'])) {
             foreach ($this->attributes['listeners'] as $type => $type_params) {
                 /**
                  * if listener function source is not an array then the string is used directly
                  */
                 if (isset($type_params['parameters']) && $type_params['parameters'] != '' && isset($type_params['source']) && !is_array($type_params['source'])) {
                     $this->attributes['listeners'][$type] = array('parameters' => $type_params['parameters'], 'source' => $type_params['source'] . $attributes['handlers'][$type]['source']);
                 }
             }
         } else {
             $this->attributes['listeners'] = $attributes['handlers'];
         }
         unset($attributes['handlers']);
     }
     if (count($attributes) > 0) {
         $this->attributes = array_merge($this->attributes, $attributes);
     }
     //add the button to the container
     //to a object container
     if (is_object($containerObject)) {
         if (method_exists($this->containerObject, 'addButton')) {
             $this->containerObject->addButton($this);
         }
     } else {
         afExtjsLayout::getInstance()->attributes['viewport'][$containerObject . '_panel']['tbar'][] = $this->afExtjs->asVar($this->end());
     }
 }
 public function __construct($attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     if (!is_object($attributes)) {
         $this->attributes = array_merge($this->attributes, $attributes);
     } else {
         $this->containerObject = $attributes;
     }
     $this->privateName = 'startMenuConfig';
 }
 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($attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     $this->afExtjs->setAddons(array('js' => array($this->afExtjs->getPluginsDir() . 'comet/Ext.Comet.js', $this->afExtjs->getPluginsDir() . 'comet/Ext.ux.Updater.js')));
     $this->privateName = 'updater_' . Util::makeRandomKey();
     $this->attributes['id'] = $this->privateName;
     if (count($attributes) > 0) {
         $this->attributes = array_merge($this->attributes, $attributes);
     }
     $this->end();
 }
 public function __construct($attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     if (count($this->attributes) > 0) {
         $attributes = array_merge($this->attributes, $attributes);
     }
     $this->afExtjs->setAddons(array('css' => array($this->afExtjs->getPluginsDir() . 'rowactionsImm/css/Ext.ux.GridRowActions.css', $this->afExtjs->getPluginsDir() . 'rowactionsImm/css/icons.css'), 'js' => array($this->afExtjs->getPluginsDir() . 'rowactionsImm/js/Ext.ux.GridRowActions.js')));
     if (count($attributes) > 0) {
         $this->attributes = array_merge($this->attributes, $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();
     $this->containerObject = $containerObject;
     if (isset($attributes['href'])) {
         $this->attributes['leaf'] = true;
         $this->attributes['icon'] = '/images/famfamfam/link.png';
     }
     if (count($attributes) > 0) {
         $this->attributes = array_merge($this->attributes, $attributes);
     }
 }
 public function __construct($attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     $this->privateName = 'window_' . Util::makeRandomKey();
     $this->attributes['id'] = $this->privateName;
     if (isset($attributes['tools'])) {
         $this->attributes['tools'] = $attributes['tools']->end();
         unset($attributes['tools']);
     }
     if (count($attributes) > 0) {
         $this->attributes = array_merge($this->attributes, $attributes);
     }
 }
 public function __construct($attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     if (count($this->attributes) > 0) {
         $attributes = array_merge($this->attributes, $attributes);
     }
     $this->attributes['url'] = '/afExtjs/filetree';
     $this->afExtjs->setAddons(array('css' => array($this->afExtjs->getPluginsDir() . 'filetree/css/filetype.css', $this->afExtjs->getPluginsDir() . 'filetree/css/filetree.css', $this->afExtjs->getPluginsDir() . 'filetree/css/icons.css'), 'js' => array($this->afExtjs->getPluginsDir() . 'filetree/js/Ext.ux.FileTreePanel.js', $this->afExtjs->getPluginsDir() . 'filetree/js/Ext.ux.FileTreeMenu.js', $this->afExtjs->getPluginsDir() . 'filetree/js/Ext.ux.form.BrowseButton.js', $this->afExtjs->getPluginsDir() . 'filetree/js/Ext.ux.FileUploader.js', $this->afExtjs->getPluginsDir() . 'filetree/js/Ext.ux.UploadPanel.js')));
     if (count($attributes) > 0) {
         $this->attributes = array_merge($this->attributes, $attributes);
     }
     $this->end();
 }
 public function __construct($attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     if (count($this->attributes) > 0) {
         $attributes = array_merge($this->attributes, $attributes);
     }
     if (isset($attributes['legend'])) {
         $this->attributes['title'] = $attributes['legend'];
         unset($attributes['legend']);
     }
     if (count($attributes) > 0) {
         $this->attributes = array_merge($this->attributes, $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->afExtjs = afExtjs::getInstance();
     if (isset($attributes['label'])) {
         $this->attributes['text'] = $attributes['label'];
         unset($attributes['label']);
     }
     if (isset($attributes['url'])) {
         $this->attributes['handler'] = $this->afExtjs->asMethod(array('parameters' => 'b,e', 'source' => "afApp.widgetPopup(\"" . $attributes['url'] . "\");"));
         unset($attributes['url']);
     }
     if (isset($attributes['source'])) {
         $this->attributes['handler'] = $this->afExtjs->asMethod(array('parameters' => '', 'source' => $attributes["source"]));
     }
     parent::__construct($containerObject, $attributes);
 }
 public function __construct($containerObject, $attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     if (isset($attributes['label'])) {
         $this->attributes['text'] = $attributes['label'];
         unset($attributes['label']);
     }
     $attributes['load'] = isset($attributes['load']) ? $attributes['load'] : 'center';
     if (isset($attributes['url'])) {
         $this->attributes['handler'] = $this->afExtjs->asMethod(array('parameters' => 'b,e', 'source' => "if(!e.ctrlKey&&!e.metaKey){afApp.load(\"" . $attributes['url'] . "\",\"" . $attributes['load'] . "\");}else{afApp.widgetPopup(\"" . $attributes['url'] . "\");}"));
         unset($attributes['url']);
     }
     if (isset($attributes['source'])) {
         $this->attributes['handler'] = $this->afExtjs->asMethod(array('parameters' => '', 'source' => $attributes["source"]));
     }
     parent::__construct($containerObject, $attributes);
 }