1: <?php
2: /**
3: * Magento
4: *
5: * NOTICE OF LICENSE
6: *
7: * This source file is subject to the Open Software License (OSL 3.0)
8: * that is bundled with this package in the file LICENSE.txt.
9: * It is also available through the world-wide-web at this URL:
10: * http://opensource.org/licenses/osl-3.0.php
11: * If you did not receive a copy of the license and are unable to
12: * obtain it through the world-wide-web, please send an email
13: * to license@magentocommerce.com so we can send you a copy immediately.
14: *
15: * DISCLAIMER
16: *
17: * Do not edit or add to this file if you wish to upgrade Magento to newer
18: * versions in the future. If you wish to customize Magento for your
19: * needs please refer to http://www.magentocommerce.com for more information.
20: *
21: * @category Mage
22: * @package Mage_XmlConnect
23: * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24: * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25: */
26:
27: /**
28: * Tab for Settings Management
29: *
30: * @category Mage
31: * @package Mage_XmlConnect
32: * @author Magento Core Team <core@magentocommerce.com>
33: */
34: class Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Settings
35: extends Mage_Adminhtml_Block_Widget_Form
36: implements Mage_Adminhtml_Block_Widget_Tab_Interface
37: {
38: protected function _prepareLayout()
39: {
40: $this->setChild('continue_button',
41: $this->getLayout()->createBlock('adminhtml/widget_button')
42: ->setData(array(
43: 'label' => Mage::helper('catalog')->__('Continue'),
44: 'onclick' => "if (editForm.submit()) { return false }",
45: 'class' => 'save'
46: )
47: )
48: );
49: return parent::_prepareLayout();
50: }
51:
52: /**
53: * Prepare form before rendering HTML
54: * Setting Form Fieldsets and fields
55: *
56: * @return Mage_Adminhtml_Block_Widget_Form
57: */
58: protected function _prepareForm()
59: {
60:
61: $form = new Varien_Data_Form();
62: $form->setHtmlIdPrefix('app_');
63: $fieldset = $form->addFieldset('base_fieldset', array('legend' => $this->__('Device Information')));
64:
65: $fieldset->addField('type', 'select', array(
66: 'name' => 'type',
67: 'label' => $this->__('Device Type'),
68: 'title' => $this->__('Device Type'),
69: 'values' => Mage::helper('xmlconnect')->getDeviceTypeOptions(),
70: 'required' => true
71: ));
72:
73: $fieldset->addField('continue_button', 'note', array(
74: 'text' => $this->getChildHtml('continue_button'),
75: ));
76:
77: $this->setForm($form);
78: return parent::_prepareForm();
79: }
80:
81: /**
82: * Tab label getter
83: *
84: * @return string
85: */
86: public function getTabLabel()
87: {
88: return $this->__('Settings');
89: }
90:
91: /**
92: * Tab title getter
93: *
94: * @return string
95: */
96: public function getTabTitle()
97: {
98: return $this->__('Settings');
99: }
100:
101: /**
102: * Check if tab can be shown
103: *
104: * @return bool
105: */
106: public function canShowTab()
107: {
108: return (bool) Mage::getSingleton('adminhtml/session')->getNewApplication();
109: }
110:
111: /**
112: * Check if tab hidden
113: *
114: * @return bool
115: */
116: public function isHidden()
117: {
118: return false;
119: }
120: }
121: