*/ class Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Content extends Mage_XmlConnect_Block_Adminhtml_Mobile_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface { protected $_pages; /** * Class constructor * Setting view option */ public function __construct() { parent::__construct(); $this->setShowGlobalIcon(true); } /** * Add page input to fieldset * * @param Varien_Data_Form_Element_Fieldset $fieldset * @param string $fieldPrefix */ protected function _addPage($fieldset, $fieldPrefix) { $element = $fieldset->addField($fieldPrefix, 'page', array( 'name' => $fieldPrefix, )); $element->initFields(array( 'name' => $fieldPrefix, 'values' => $this->_pages, )); } /** * Prepare form before rendering HTML * Setting Form Fieldsets and fields * * @return Mage_Adminhtml_Block_Widget_Form */ protected function _prepareForm() { $model = Mage::helper('xmlconnect')->getApplication(); $conf = $model->getConf(); $form = new Varien_Data_Form(); $this->setForm($form); $pages = Mage::getResourceModel('xmlconnect/cms_page_collection')->toOptionIdArray(); $dummy = array(array( 'value' => '', 'label' => '' )); $this->_pages = array_merge($dummy, $pages); $fieldset = $form->addFieldset('cms_pages', array('legend' => $this->__('Pages'))); $this->_addElementTypes($fieldset); $fieldset->addField('page_row_add', 'addrow', array( 'onclick' => 'insertNewTableRow(this)', 'options' => $this->_pages, 'class' => ' scalable save ', 'label' => $this->__('Label'), 'before_element_html' => $this->__('Get Content from CMS Page').'