Esempio n. 1
0
 public function initConfig()
 {
     parent::initConfig();
     $helper = Mage::helper('customgrid');
     if ($this->_canFilterOnSku()) {
         $this->addCustomParam('filter_on_sku', array('label' => $helper->__('Filter on Item SKU'), 'type' => 'select', 'source_model' => 'customgrid/system_config_source_yesno', 'value' => 0), 100000);
     }
     if ($this->_canFilterOnName()) {
         $this->addCustomParam('filter_on_name', array('label' => $helper->__('Filter on Item Name'), 'type' => 'select', 'source_model' => 'customgrid/system_config_source_yesno', 'value' => 0), 100010);
     }
     if ($this->_canExcludeChildrenFromFilter()) {
         $this->addCustomParam('filter_exclude_child', array('label' => $helper->__('Exclude Child Items From Filter'), 'type' => 'select', 'source_model' => 'customgrid/system_config_source_yesno', 'value' => 0), 100020);
     }
     if ($this->_canAllowSqlWildcardsInFilter()) {
         $this->addCustomParam('allow_sql_wildcards', array('label' => $helper->__('Allow SQL Wildcards In Filter'), 'type' => 'select', 'source_model' => 'customgrid/system_config_source_yesno', 'value' => 0), 100030);
     }
     if ($this->_isCustomizableList()) {
         $itemValues = array_reverse($this->getItemValues());
         $position = -10;
         foreach ($itemValues as $key => $value) {
             $this->addCustomParam('display_' . $key, array('label' => $helper->__('Display "%s"', $value['name']), 'description' => $value['description'], 'type' => 'select', 'source_model' => 'customgrid/system_config_source_yesno', 'value' => $value['default'] ? 1 : 0), $position -= 10);
         }
         $this->addCustomParam('hide_header', array('label' => $helper->__('Hide Header'), 'description' => $helper->__('Choose "Yes" if you do not want the field labels to be displayed in the header'), 'type' => 'select', 'source_model' => 'customgrid/system_config_source_yesno'), 0);
         $this->setCustomParamsWindowConfig(array('height' => 500));
     } else {
         $this->setCustomParamsWindowConfig(array('height' => 300));
     }
     return $this;
 }