Exemple #1
0
 /**
  * Not for Magento 1.3. Add 2 fields to admin cms page edit
  * @param object $observer
  */
 public function addFieldsToCmsMeta($observer)
 {
     $form = $observer->getForm();
     $fieldset = $form->getElement('meta_fieldset');
     $helper = Mage::helper('ascurl');
     $fieldset->addField('sitemap_include', 'select', array('name' => 'sitemap_include', 'label' => $helper->__('Include in Google Sitemap'), 'values' => array(array('value' => 0, 'label' => $helper->__('No')), array('value' => 1, 'label' => $helper->__('Yes')))));
     $fieldset->addField('meta_robots', 'select', array('name' => 'meta_robots', 'label' => $helper->__('Meta Robots'), 'values' => AW_Ascurl_Model_Source_Metarobots::toOptionArray()));
 }
Exemple #2
0
 /**
  * Hack for Magento 1.3. 2 additional fields added
  * @return Mage_Adminhtml_Block_Widget_Form
  */
 protected function _prepareForm()
 {
     if (!preg_match('/^1.3/', Mage::getVersion())) {
         return parent::_prepareForm();
     }
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('page_');
     $model = Mage::registry('cms_page');
     $fieldset = $form->addFieldset('meta_fieldset', array('legend' => Mage::helper('cms')->__('Meta Data'), 'class' => 'fieldset-wide'));
     $fieldset->addField('meta_keywords', 'editor', array('name' => 'meta_keywords', 'label' => Mage::helper('cms')->__('Keywords'), 'title' => Mage::helper('cms')->__('Meta Keywords')));
     $fieldset->addField('meta_description', 'editor', array('name' => 'meta_description', 'label' => Mage::helper('cms')->__('Description'), 'title' => Mage::helper('cms')->__('Meta Description')));
     $helper = Mage::helper('ascurl');
     $fieldset->addField('sitemap_include', 'select', array('name' => 'sitemap_include', 'label' => $helper->__('Include in Google Sitemap'), 'values' => array(array('value' => 0, 'label' => $helper->__('No')), array('value' => 1, 'label' => $helper->__('Yes')))));
     $fieldset->addField('meta_robots', 'select', array('name' => 'meta_robots', 'label' => $helper->__('Meta Robots'), 'values' => AW_Ascurl_Model_Source_Metarobots::toOptionArray()));
     $form->setValues($model->getData());
     $this->setForm($form);
     return Mage_Adminhtml_Block_Widget_Form::_prepareForm();
 }