*/ class Mage_XmlConnect_Block_Adminhtml_Mobile_Widget_Form extends Mage_Adminhtml_Block_Widget_Form { /** * Add color chooser to fieldset * * @param Varien_Data_Form_Element_Fieldset $fieldset * @param string $fieldName * @param string $title */ protected function addColor($fieldset, $fieldName, $title) { $fieldset->addField($fieldName, 'color', array( 'name' => $fieldName, 'label' => $title, )); } /** * Add image uploader to fieldset * * @param Varien_Data_Form_Element_Fieldset $fieldset * @param string $fieldName * @param string $title * @param string|null $note * @param string $default * @param boolean $required */ public function addImage($fieldset, $fieldName, $title, $note = null, $default = '', $required = false) { $fieldset->addField($fieldName, 'image', array( 'name' => $fieldName, 'label' => $title, 'note' => $note, 'default_value' => $default, 'required' => $required, )); } /** * Add font selector to fieldset * * @param Varien_Data_Form_Element_Fieldset $fieldset * @param string $fieldPrefix * @param string $title */ public function addFont($fieldset, $fieldPrefix, $title) { $element = $fieldset->addField($fieldPrefix, 'font', array( 'name' => $fieldPrefix, 'label' => $title, )); $element->initFields(array( 'name' => $fieldPrefix, 'fontNames' => Mage::helper('xmlconnect')->getDeviceHelper()->getFontList(), 'fontSizes' => Mage::helper('xmlconnect')->getDeviceHelper()->getFontSizes(), )); } /** * Configure image element type * * @return array */ protected function _getAdditionalElementTypes() { $config = Mage::getConfig(); return array( 'image' => $config->getBlockClassName('xmlconnect/adminhtml_mobile_form_element_image'), 'font' => $config->getBlockClassName('xmlconnect/adminhtml_mobile_form_element_font'), 'color' => $config->getBlockClassName('xmlconnect/adminhtml_mobile_form_element_color'), 'tabs' => $config->getBlockClassName('xmlconnect/adminhtml_mobile_form_element_tabs'), 'theme' => $config->getBlockClassName('xmlconnect/adminhtml_mobile_form_element_theme'), 'page' => $config->getBlockClassName('xmlconnect/adminhtml_mobile_form_element_page'), 'addrow'=> $config->getBlockClassName('xmlconnect/adminhtml_mobile_form_element_addrow'), 'datetime' => $config->getBlockClassName('xmlconnect/adminhtml_mobile_form_element_datetime'), ); } }