Mage_Adminhtml_Block_Catalog_Search_Edit_Form Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Catalog_Search_Edit_Form:

Mage_Adminhtml_Block_Widget_Form Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()

Protected Member Functions

 _prepareForm ()


Detailed Description

Definition at line 35 of file Form.php.


Constructor & Destructor Documentation

__construct (  ) 

Init Form properties

Reimplemented from Mage_Adminhtml_Block_Widget_Form.

Definition at line 41 of file Form.php.

00042     {
00043         parent::__construct();
00044         $this->setId('catalog_search_form');
00045         $this->setTitle(Mage::helper('catalog')->__('Search Information'));
00046     }


Member Function Documentation

_prepareForm (  )  [protected]

Prepare form fields

Returns:
Mage_Adminhtml_Block_Catalog_Search_Edit_Form

Reimplemented from Mage_Adminhtml_Block_Widget_Form.

Definition at line 53 of file Form.php.

00054     {
00055         $model = Mage::registry('current_catalog_search');
00056         /* @var $model Mage_CatalogSearch_Model_Query */
00057 
00058         $form = new Varien_Data_Form(array(
00059             'id'        => 'edit_form',
00060             'action'    => $this->getData('action'),
00061             'method' => 'post'
00062         ));
00063 
00064         $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('catalog')->__('General Information')));
00065 
00066         $yesno = array(
00067             array(
00068                 'value' => 0,
00069                 'label' => Mage::helper('catalog')->__('No')
00070             ),
00071             array(
00072                 'value' => 1,
00073                 'label' => Mage::helper('catalog')->__('Yes')
00074             ));
00075 
00076         if ($model->getId()) {
00077             $fieldset->addField('query_id', 'hidden', array(
00078                 'name'      => 'query_id',
00079             ));
00080         }
00081 
00082         $fieldset->addField('query_text', 'text', array(
00083             'name'      => 'query_text',
00084             'label'     => Mage::helper('catalog')->__('Search Query'),
00085             'title'     => Mage::helper('catalog')->__('Search Query'),
00086             'required'  => true,
00087         ));
00088 
00089         if (!Mage::app()->isSingleStoreMode()) {
00090             $fieldset->addField('store_id', 'select', array(
00091                 'name'      => 'store_id',
00092                 'label'     => Mage::helper('catalog')->__('Store'),
00093                 'title'     => Mage::helper('catalog')->__('Store'),
00094                 'values'    => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(true, false),
00095                 'required'  => true,
00096             ));
00097         }
00098         else {
00099             $fieldset->addField('store_id', 'hidden', array(
00100                 'name'      => 'store_id'
00101             ));
00102             $model->setStoreId(Mage::app()->getStore(true)->getId());
00103         }
00104 
00105         if ($model->getId()) {
00106             $fieldset->addField('num_results', 'text', array(
00107                 'name'      => 'num_results',
00108                 'label'     => Mage::helper('catalog')->__('Number of results<br/>(For last time placed)'),
00109                 'title'     => Mage::helper('catalog')->__('Number of results<br/>(For last time placed)'),
00110                 'required'  => true,
00111             ));
00112 
00113             $fieldset->addField('popularity', 'text', array(
00114                 'name'      => 'popularity',
00115                 'label'     => Mage::helper('catalog')->__('Number of Uses'),
00116                 'title'     => Mage::helper('catalog')->__('Number of Uses'),
00117                 'required'  => true,
00118             ));
00119         }
00120 
00121         $afterElementHtml = '<p class="nm"><small>'
00122             . Mage::helper('catalog')->__('(Will make search for the query above return results for this search.)')
00123             . '</small></p>';
00124 
00125         $fieldset->addField('synonim_for', 'text', array(
00126             'name'      => 'synonim_for',
00127             'label'     => Mage::helper('catalog')->__('Synonym For'),
00128             'title'     => Mage::helper('catalog')->__('Synonym For'),
00129             'after_element_html' => $afterElementHtml,
00130         ));
00131 
00132         $afterElementHtml = '<p class="nm"><small>'
00133             . Mage::helper('catalog')->__('ex. http://domain.com')
00134             . '</small></p>';
00135 
00136         $fieldset->addField('redirect', 'text', array(
00137             'name'      => 'redirect',
00138             'label'     => Mage::helper('catalog')->__('Redirect URL'),
00139             'title'     => Mage::helper('catalog')->__('Redirect URL'),
00140             'after_element_html' => $afterElementHtml,
00141         ));
00142 
00143         $fieldset->addField('display_in_terms', 'select', array(
00144             'name'      => 'display_in_terms',
00145             'label'     => Mage::helper('catalog')->__('Display in Suggested Terms'),
00146             'title'     => Mage::helper('catalog')->__('Display in Suggested Terms'),
00147             'values'    => $yesno,
00148         ));
00149 
00150         $form->setValues($model->getData());
00151         $form->setUseContainer(true);
00152         $this->setForm($form);
00153 
00154         return parent::_prepareForm();
00155     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:46 2009 for Magento by  doxygen 1.5.8