示例#1
0
 public function toHtml()
 {
     $model = $this->getModel();
     parent::__construct(array('legend' => __('Additional')));
     $this->addField('ignore', 'multiselect', array('name' => 'properties[ignore]', 'label' => __('Ingnored Pages'), 'required' => false, 'value' => $model->getProperty('ignore'), 'values' => Mage::getSingleton('adminhtml/system_config_source_cms_page')->toOptionArray(), 'note' => Mage::helper('searchindex/help')->field('ignore')));
     return parent::toHtml();
 }
示例#2
0
 public function toHtml()
 {
     $model = $this->getModel();
     parent::__construct(array('legend' => __('URL Settings')));
     $this->addField('url_template', 'text', array('name' => 'properties[url_template]', 'label' => __('Url Template'), 'required' => true, 'value' => $model->getProperty('url_template'), 'note' => Mage::helper('searchindex/help')->field('url_template')));
     return parent::toHtml();
 }
示例#3
0
 public function toHtml()
 {
     $html = parent::toHtml();
     if (!@class_exists('Extendware_EWCore_Model_Autoload')) {
         return $html;
     }
     $tips = $this->_getExtendwareTips($this, 'hover', array('opentip' => array('tipJoint' => 'top right')));
     if (empty($tips) === false) {
         $id = 'ew-' . Mage::helper('core')->getRandomString(8);
         $code = '<div class="ewcore-tooltip-fieldset-label" id="' . $id . '"></div>';
         $html = preg_replace('/<div\\s+?class="form-buttons">/s', '<div class="form-buttons">' . $code, $html);
         foreach ($tips as $tip) {
             if (array_key_exists('title', $tip) === false) {
                 $tip['title'] = (string) $this->getData('legend');
             }
             $scripts[] = $this->_getExtendwareTipJs('$("' . $id . '")', $tip);
         }
     }
     foreach ($this->getElements() as $element) {
         $rowHtml = $this->_extractRowHtml($element->getId(), $html);
         if (empty($rowHtml)) {
             continue;
         }
         $tips = $this->_getExtendwareTips($element, Mage::helper('ewcore/config')->getDefaultFormHelpTriggerMode());
         foreach ($tips as $tip) {
             if (array_key_exists('title', $tip) === false) {
                 $tip['title'] = (string) $element->getData('label');
             }
             if (strpos($tip['mode'], 'label') !== false or strpos($tip['mode'], 'both') !== false) {
                 if (preg_match('/<td\\s+?class="label">(.+?)<\\/td>/is', $rowHtml, $match)) {
                     $id = 'ew-' . Mage::helper('core')->getRandomString(8);
                     $classes = 'ewcore-tooltip-label ' . (strpos($tip['mode'], 'click') !== false ? 'ewcore-tooltip-label-clickable' : '');
                     $label = preg_replace('/<label([^>]*?)>(.*?)<\\/label>/si', '<label\\1><span id="' . $id . '" class="' . $classes . '">\\2</span></label>', $match[0]);
                     $html = str_replace($rowHtml, str_replace($match[0], $label, $rowHtml), $html);
                     $scripts[] = $this->_getExtendwareTipJs('$("' . $id . '")', $tip);
                 }
             }
             if (strpos($tip['mode'], 'input') !== false or strpos($tip['mode'], 'both') !== false) {
                 if (!preg_match('/<select\\s+/si', $rowHtml)) {
                     $scripts[] = $this->_getExtendwareTipJs('$("' . $element->getHtmlId() . '")', $tip);
                 }
             }
             if ($tip['mode'] == 'hover') {
                 $id = 'ew-' . Mage::helper('core')->getRandomString(8);
                 $newRowHtml = str_replace('<tr>', '<tr id="' . $id . '">', $rowHtml);
                 $html = str_replace($rowHtml, $newRowHtml, $html);
                 $scripts[] = $this->_getExtendwareTipJs('$("' . $id . '")', $tip);
             }
         }
     }
     if (empty($scripts) === false) {
         $html .= '<script type="text/javascript">try{';
         foreach ($scripts as $script) {
             $html .= $script . "\n";
         }
         $html .= '} catch(e) {}</script>';
     }
     return $html;
 }
示例#4
0
 public function toHtml()
 {
     $model = $this->getModel();
     parent::__construct(array('legend' => __('Database Settings')));
     $this->addField('db_connection_name', 'text', array('name' => 'properties[db_connection_name]', 'label' => __('Database Connection Name'), 'required' => true, 'value' => $model->getProperty('db_connection_name') ? $model->getProperty('db_connection_name') : 'default_setup', 'note' => Mage::helper('searchindex/help')->field('db_connection_name')));
     $this->addField('db_table_prefix', 'text', array('name' => 'properties[db_table_prefix]', 'label' => __('Table Prefix'), 'required' => false, 'value' => $model->getProperty('db_table_prefix'), 'note' => Mage::helper('searchindex/help')->field('db_table_prefix')));
     return parent::toHtml();
 }
 public function toHtml()
 {
     $model = $this->getModel();
     if (!Mage::app()->isSingleStoreMode()) {
         parent::__construct(array('legend' => Mage::helper('searchindex')->__('Store Settings')));
         $this->addField('store_id', 'multiselect', array('label' => Mage::helper('searchindex')->__('Store View'), 'required' => true, 'name' => 'properties[store_id]', 'value' => $model->getProperty('store_id'), 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm()));
     }
     return parent::toHtml();
 }
示例#6
0
 public function toHtml()
 {
     $model = $this->getModel();
     parent::__construct(array('legend' => __('Additional Search Index Configuration')));
     $this->addField('include_category', 'select', array('name' => 'properties[include_category]', 'label' => __('Search by parent categories names'), 'required' => true, 'value' => $model->getProperty('include_category'), 'values' => Mage::getSingleton('adminhtml/system_config_source_yesno')->toOptionArray(), 'note' => Mage::helper('searchindex/help')->field('include_category')));
     $this->addField('include_bundled', 'select', array('name' => 'properties[include_bundled]', 'label' => __('Search by child products attributes (for bundle and configurable products)'), 'required' => true, 'value' => $model->getProperty('include_bundled'), 'values' => Mage::getSingleton('adminhtml/system_config_source_yesno')->toOptionArray(), 'note' => Mage::helper('searchindex/help')->field('include_bundled')));
     $this->addField('include_tag', 'select', array('name' => 'properties[include_tag]', 'label' => __('Search by product tags'), 'required' => true, 'value' => $model->getProperty('include_tag'), 'values' => Mage::getSingleton('adminhtml/system_config_source_yesno')->toOptionArray(), 'note' => Mage::helper('searchindex/help')->field('include_tag')));
     $this->addField('include_id', 'select', array('name' => 'properties[include_id]', 'label' => __('Search by product id'), 'required' => true, 'value' => $model->getProperty('include_id'), 'values' => Mage::getSingleton('adminhtml/system_config_source_yesno')->toOptionArray(), 'note' => Mage::helper('searchindex/help')->field('include_id')));
     $this->addField('out_of_stock_to_end', 'select', array('name' => 'properties[out_of_stock_to_end]', 'label' => __('Push "out of stock" products to the end'), 'required' => false, 'value' => $model->getProperty('out_of_stock_to_end'), 'values' => Mage::getSingleton('adminhtml/system_config_source_yesno')->toOptionArray(), 'note' => Mage::helper('searchindex/help')->field('out_of_stock_to_end')));
     return parent::toHtml();
 }
 public function toHtml()
 {
     $model = $this->getModel();
     parent::__construct(array('legend' => __('Attribute')));
     $attributes = Mage::getSingleton('eav/config')->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getAttributeCollection();
     $values = array();
     foreach ($attributes as $attr) {
         if (in_array($attr->getData('frontend_input'), array('select', 'multiselect'))) {
             $values[$attr->getAttributeCode()] = $attr->getFrontendLabel() . ' [' . $attr->getAttributeCode() . ']';
         }
     }
     $this->addField('attribute', 'select', array('name' => 'properties[attribute]', 'label' => __('Attribute'), 'required' => true, 'value' => $model->getProperty('attribute'), 'values' => $values));
     $this->addField('url_template', 'text', array('name' => 'properties[url_template]', 'label' => __('Url Template'), 'required' => true, 'value' => $model->getProperty('url_template')));
     return parent::toHtml();
 }