public function __construct($attributes)
 {
     parent::__construct($attributes);
     if (!isset($this->_attributes['allow_generate'])) {
         $this->_attributes['allow_generate'] = 1;
     }
     $this->_attributes['category_field'] = $this->_attributes['category']->GetName();
     $this->_attributes['price_field'] = $this->_attributes['price']->GetName();
     $this->_attributes['vat_field_name'] = $this->_attributes['vat_field']->GetName();
     $this->_attributes['vat_values'] = App::getModel('vat/vat')->getVATValuesAll();
     $this->_attributes['suffixes'] = App::getModel('suffix/suffix')->getSuffixTypes();
     $this->_jsGetAttributeSetsForCategories = 'GetAttributeSetsForCategories_' . $this->_id;
     $this->_jsGetAttributesForSet = 'GetAttributesForSet_' . $this->_id;
     $this->_jsGetValuesForAttribute = 'GetValuesForAttribute_' . $this->_id;
     $this->_jsGetCartesian = 'GetCartesian_' . $this->_id;
     $this->_jsAddAttribute = 'AddAttribute_' . $this->_id;
     $this->_jsAddValue = 'AddValue_' . $this->_id;
     $this->_attributes['get_sets_for_categories'] = 'xajax_' . $this->_jsGetAttributeSetsForCategories;
     $this->_attributes['get_attributes_for_set'] = 'xajax_' . $this->_jsGetAttributesForSet;
     $this->_attributes['get_values_for_attribute'] = 'xajax_' . $this->_jsGetValuesForAttribute;
     $this->_attributes['get_cartesian'] = 'xajax_' . $this->_jsGetCartesian;
     $this->_attributes['add_attribute'] = 'xajax_' . $this->_jsAddAttribute;
     $this->_attributes['add_value'] = 'xajax_' . $this->_jsAddValue;
     App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsGetAttributeSetsForCategories, $this, 'getAttributeSetsForCategories'));
     App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsGetAttributesForSet, $this, 'getAttributesForSet'));
     App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsGetValuesForAttribute, $this, 'getValuesForAttribute'));
     App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsGetCartesian, $this, 'getCartesian'));
     App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsAddAttribute, $this, 'addAttribute'));
     App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsAddValue, $this, 'addValue'));
 }
Esempio n. 2
0
 public function __construct($attributes)
 {
     parent::__construct($attributes);
     $this->_attributes['load'] = App::getRegistry()->xajaxInterface->registerFunction(array('ProgressIndicator_OnLoad_' . $this->_id, $this->_attributes['load'][0], $this->_attributes['load'][1]));
     $this->_attributes['process'] = App::getRegistry()->xajaxInterface->registerFunction(array('ProgressIndicator_OnProcess_' . $this->_id, $this->_attributes['process'][0], $this->_attributes['process'][1]));
     $this->_attributes['success'] = App::getRegistry()->xajaxInterface->registerFunction(array('ProgressIndicator_OnSuccess_' . $this->_id, $this->_attributes['success'][0], $this->_attributes['success'][1]));
 }
Esempio n. 3
0
 public function __construct($attributes)
 {
     parent::__construct($attributes);
     $this->_attributes['session_name'] = session_name();
     $this->_attributes['session_id'] = session_id();
     $this->_jsFunction = 'LoadFiles_' . $this->_id;
     $this->_attributes['load_handler'] = 'xajax_' . $this->_jsFunction;
     App::getRegistry()->xajax->registerFunction(array($this->_jsFunction, $this, 'doLoadFilesForDatagrid_' . $this->_id));
 }
 public function __construct($attributes)
 {
     parent::__construct($attributes);
     if (!isset($this->_attributes['name'])) {
         $this->_attributes['name'] = 'LayoutBoxSchemePreview_' . $this->_id;
     }
     if (isset($this->_attributes['layout_box_tpl']) && is_file($this->_attributes['layout_box_tpl'])) {
         $this->_attributes['layout_box_tpl'] = file_get_contents($this->_attributes['layout_box_tpl']);
     }
 }
Esempio n. 5
0
 public function __construct($attributes)
 {
     $attributes['attributes'] = App::getModel('attributeproduct/attributeproduct')->getAttributeProductFull();
     parent::__construct($attributes);
     App::getRegistry()->xajaxInterface->registerFunction(array('DeleteAttribute', $this, 'deleteAttribute'));
     App::getRegistry()->xajaxInterface->registerFunction(array('RenameAttribute', $this, 'renameAttribute'));
     App::getRegistry()->xajaxInterface->registerFunction(array('RenameValue', $this, 'renameValue'));
     $this->_attributes['deleteAttributeFunction'] = 'xajax_DeleteAttribute';
     $this->_attributes['renameAttributeFunction'] = 'xajax_RenameAttribute';
     $this->_attributes['renameValueFunction'] = 'xajax_RenameValue';
 }
Esempio n. 6
0
 public function __construct($attributes)
 {
     parent::__construct($attributes);
     if (!isset($this->_attributes['products_source_field']) || !$this->_attributes['products_source_field'] instanceof ProductSelect) {
         throw new Exception("Source field (attribute: products_source_field) not set for field '{$this->_attributes['name']}'.");
     }
     $this->_attributes['products_source_field_name'] = $this->_attributes['products_source_field']->GetName();
     $this->_attributes['vat_values'] = App::getModel('vat/vat')->getVATAll();
     $this->_attributes['prefixes'] = array(Translation::get('TXT_PRICE_NET'), Translation::get('TXT_PRICE_GROSS'));
     $this->_jsFunction = 'LoadProductDataForAggregation_' . $this->_id;
     $this->_attributes['jsfunction'] = 'xajax_' . $this->_jsFunction;
     App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsFunction, $this, 'loadProductData'));
 }
Esempio n. 7
0
 public function __construct($attributes)
 {
     parent::__construct($attributes);
     $this->_jsGetChildren = 'GetChildren_' . $this->_id;
     if (isset($this->_attributes['load_children']) && is_callable($this->_attributes['load_children'])) {
         $this->_attributes['get_children'] = 'xajax_' . $this->_jsGetChildren;
         App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsGetChildren, $this, 'getChildren'));
     }
     if (!isset($this->_attributes['addLabel'])) {
         $this->_attributes['addLabel'] = \Gekosale\Translation::get('TXT_ADD');
     }
     if (!isset($this->_attributes['retractable'])) {
         $this->_attributes['retractable'] = true;
     }
     $this->_attributes['total'] = count($this->_attributes['items']);
 }
Esempio n. 8
0
 public function __construct($attributes)
 {
     parent::__construct($attributes);
     $storesArray = array();
     $storesRaw = App::getModel('stores')->getStoresAll();
     foreach ($storesRaw as $storeRaw) {
         $storesArray['s' . $storeRaw['id']]['id'] = $storeRaw['id'];
         $storesArray['s' . $storeRaw['id']]['name'] = $storeRaw['name'];
         $storesArray['s' . $storeRaw['id']]['label'] = 's' . $storeRaw['id'];
         $storesArray['s' . $storeRaw['id']]['parent'] = null;
         $storesArray['s' . $storeRaw['id']]['weight'] = $storeRaw['id'];
         $storesArray['s' . $storeRaw['id']]['type'] = 'store';
     }
     $viewsRaw = App::getModel('stores')->getViewsAll();
     foreach ($viewsRaw as $viewRaw) {
         $storesArray['v' . $viewRaw['id']]['id'] = $viewRaw['id'];
         $storesArray['v' . $viewRaw['id']]['name'] = $viewRaw['name'];
         $storesArray['v' . $viewRaw['id']]['label'] = 'v' . $viewRaw['id'];
         $storesArray['v' . $viewRaw['id']]['parent'] = 's' . $viewRaw['parent'];
         $storesArray['v' . $viewRaw['id']]['weight'] = $viewRaw['id'];
         $storesArray['v' . $viewRaw['id']]['type'] = 'view';
     }
     $this->_attributes['stores'] = $storesArray;
 }
Esempio n. 9
0
 public function __construct($attributes)
 {
     parent::__construct($attributes);
 }