/** * Setup the form fields * * @return $this */ protected function _prepareForm() { parent::_prepareForm(); $fieldset = $this->getForm()->addFieldset('splash_page_information', array('legend' => $this->__('Page Information'))); $fieldset->addField('display_name', 'text', array('name' => 'display_name', 'label' => $this->__('Name'), 'title' => $this->__('Name'), 'required' => true, 'class' => 'required-entry')); $field = $fieldset->addField('url_key', 'text', array('name' => 'url_key', 'label' => $this->__('URL Key'), 'title' => $this->__('URL Key'))); $field->setRenderer($this->getLayout()->createBlock('attributeSplash/adminhtml_form_field_urlkey')->setSplashType('page')); if ($page = Mage::registry('splash_page')) { $fieldset->addField('attribute_id', 'hidden', array('name' => 'attribute_id', 'value' => $page->getAttributeId())); $fieldset->addField('option_id', 'hidden', array('name' => 'option_id', 'value' => $page->getOptionId())); } $fieldset->addField('category_id', 'text', array('name' => 'category_id', 'label' => $this->__('Category ID'), 'title' => $this->__('Category ID'), 'note' => $this->__('Used to populate category filters in the layered navigation'))); if (!Mage::app()->isSingleStoreMode()) { $field = $fieldset->addField('store_ids', 'multiselect', array('name' => 'store_ids[]', 'label' => Mage::helper('cms')->__('Store View'), 'title' => Mage::helper('cms')->__('Store View'), 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true))); $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element'); if ($renderer) { $field->setRenderer($renderer); } } else { if (($page = Mage::registry('splash_page')) !== null) { $page->setStoreId(Mage::app()->getStore()->getId()); } } $fieldset->addField('is_enabled', 'select', array('name' => 'is_enabled', 'title' => $this->__('Enabled'), 'label' => $this->__('Enabled'), 'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray())); $fieldset->addField('is_featured', 'select', array('name' => 'is_featured', 'title' => $this->__('Featured'), 'label' => $this->__('Featured'), 'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray())); $this->getForm()->setValues($this->_getFormData()); return $this; }
protected function _prepareLayout() { parent::_prepareLayout(); if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) { $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); } }
/** * Setup the form fields * * @return $this */ protected function _prepareForm() { parent::_prepareForm(); $fieldset = $this->getForm()->addFieldset('splash_image', array('legend' => $this->__('Images'))); $this->_addElementTypes($fieldset); $fieldset->addField('image', 'image', array('name' => 'image', 'label' => $this->__('Banner'), 'title' => $this->__('Banner'))); $fieldset->addField('thumbnail', 'image', array('name' => 'thumbnail', 'label' => $this->__('Logo'), 'title' => $this->__('Logo'))); $this->getForm()->setValues($this->_getFormData()); return $this; }
/** * Add the meta fields to the form * * @return $this */ protected function _prepareForm() { parent::_prepareForm(); $fieldset = $this->getForm()->addFieldset('splash_page_meta', array('legend' => $this->helper('adminhtml')->__('Meta Data'), 'class' => 'fieldset-wide')); $fieldset->addField('page_title', 'text', array('name' => 'page_title', 'label' => $this->__('Page Title'), 'title' => $this->__('Page Title'))); $fieldset->addField('meta_description', 'editor', array('name' => 'meta_description', 'label' => $this->__('Description'), 'title' => $this->__('Description'), 'style' => 'width:98%; height:110px;')); $fieldset->addField('meta_keywords', 'editor', array('name' => 'meta_keywords', 'label' => $this->__('Keywords'), 'title' => $this->__('Keywords'), 'style' => 'width:98%; height:110px;')); $this->getForm()->setValues($this->_getFormData()); return $this; }
/** * Add the design elements to the form * * @return $this */ protected function _prepareForm() { parent::_prepareForm(); $fieldset = $this->getForm()->addFieldset('splash_attributes', array('legend' => $this->helper('adminhtml')->__('Attributes'), 'class' => 'fieldset-wide')); $page = Mage::registry('splash_page'); $fieldset->addField('attribute_id', 'select', array('name' => 'attribute_id', 'label' => $this->__('Attribute'), 'title' => $this->__('Attribute'), 'values' => Mage::getSingleton('attributeSplash/system_config_source_attribute_splashable')->toOptionArray(true), 'required' => true, 'disabled' => !is_null($page))); $fieldset->addField('option_id', 'select', array('name' => 'option_id', 'label' => $this->__('Option'), 'title' => $this->__('Option'), 'values' => $this->_getPageOptionValues($page), 'required' => true, 'disabled' => !is_null($page))); $this->getForm()->setValues($this->_getFormData()); return $this; }
/** * Add the design elements to the form * * @return $this */ protected function _prepareForm() { parent::_prepareForm(); $fieldset = $this->getForm()->addFieldset('splash_customfields', array('legend' => $this->helper('adminhtml')->__('Custom Fields'), 'class' => 'fieldset-wide')); if ($page = Mage::registry('splash_page')) { foreach ($page->getAllAvailableCustomFields() as $alias => $title) { $fieldset->addField($alias, 'editor', array('name' => 'custom_fields[' . $alias . ']', 'label' => $this->__($title), 'title' => $this->__($title), 'style' => 'width:600px;', 'note' => '<?php echo $page->get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $alias))) . '(); ?>')); } } $this->getForm()->setValues($this->_getFormData()); return $this; }
/** * Add the design elements to the form * * @return $this */ protected function _prepareForm() { parent::_prepareForm(); $fieldset = $this->getForm()->addFieldset('splash_design_menu', array('legend' => $this->helper('adminhtml')->__('Menu'), 'class' => 'fieldset-wide')); $fieldset->addField('include_in_menu', 'select', array('name' => 'include_in_menu', 'label' => $this->__('Include in Navigation Menu'), 'title' => $this->__('Include in Navigation Menu'), 'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray())); $fieldset = $this->getForm()->addFieldset('splash_design_page_layout', array('legend' => $this->helper('adminhtml')->__('Page Layout'), 'class' => 'fieldset-wide')); $fieldset->addField('page_layout', 'select', array('name' => 'page_layout', 'label' => $this->__('Page Layout'), 'title' => $this->__('Page Layout'), 'values' => Mage::getSingleton('attributeSplash/system_config_source_layout')->toOptionArray())); $fieldset->addField('layout_update_xml', 'editor', array('name' => 'layout_update_xml', 'label' => $this->__('Layout Update XML'), 'title' => $this->__('Layout Update XML'), 'style' => 'width:600px;')); $fieldset = $this->getForm()->addFieldset('splash_design_display_settings', array('legend' => $this->helper('adminhtml')->__('Display Settings'), 'class' => 'fieldset-wide')); $fieldset->addField('display_mode', 'select', array('name' => 'display_mode', 'label' => $this->__('Display Mode'), 'title' => $this->__('Display Mode'), 'values' => Mage::getModel('catalog/category_attribute_source_mode')->getAllOptions())); $fieldset->addField('cms_block', 'select', array('name' => 'cms_block', 'label' => $this->__('CMS Block'), 'title' => $this->__('CMS Block'), 'values' => Mage::getModel('catalog/category_attribute_source_page')->getAllOptions())); $this->getForm()->setValues($this->_getFormData()); return $this; }