public function __construct($containerObject)
 {
     $this->afExtjs = afExtjs::getInstance();
     $this->attributes['xtype'] = 'tbfill';
     parent::__construct($containerObject);
     $this->end();
 }
 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($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);
 }
 public function __construct($containerObject, $attributes = array())
 {
     $this->afExtjs = afExtjs::getInstance();
     //$this->attributes['xtype']='tbbutton';
     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' => '', 'source' => 'afApp.load("' . $attributes['url'] . '","' . $attributes['load'] . '");'));
         unset($attributes['url']);
     }
     if (isset($attributes['handler'])) {
         $this->attributes['handler'] = $this->afExtjs->asMethod(array('parameters' => '', 'source' => $attributes['handler']));
         unset($attributes['handler']);
     }
     if (isset($attributes['tooltip'])) {
         if (isset($attributes['tooltip']['text'])) {
             $this->attributes['tooltip']['text'] = $attributes['tooltip']['text'];
             if (isset($attributes['tooltip']['title'])) {
                 $this->attributes['tooltip']['title'] = $attributes['tooltip']['title'];
             }
         }
         unset($attributes['tooltip']);
     }
     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']);
     }
     parent::__construct($containerObject, $attributes);
 }