1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: 28: 29: 30: 31: 32: 33:
34: class Mage_Adminhtml_Block_Cms_Page_Edit_Tab_Meta
35: extends Mage_Adminhtml_Block_Widget_Form
36: implements Mage_Adminhtml_Block_Widget_Tab_Interface
37: {
38: public function __construct()
39: {
40: parent::__construct();
41: }
42:
43: protected function _prepareForm()
44: {
45: 46: 47:
48: if ($this->_isAllowedAction('save')) {
49: $isElementDisabled = false;
50: } else {
51: $isElementDisabled = true;
52: }
53:
54: $form = new Varien_Data_Form();
55:
56: $form->setHtmlIdPrefix('page_');
57:
58: $model = Mage::registry('cms_page');
59:
60: $fieldset = $form->addFieldset('meta_fieldset', array('legend' => Mage::helper('cms')->__('Meta Data'), 'class' => 'fieldset-wide'));
61:
62: $fieldset->addField('meta_keywords', 'textarea', array(
63: 'name' => 'meta_keywords',
64: 'label' => Mage::helper('cms')->__('Keywords'),
65: 'title' => Mage::helper('cms')->__('Meta Keywords'),
66: 'disabled' => $isElementDisabled
67: ));
68:
69: $fieldset->addField('meta_description', 'textarea', array(
70: 'name' => 'meta_description',
71: 'label' => Mage::helper('cms')->__('Description'),
72: 'title' => Mage::helper('cms')->__('Meta Description'),
73: 'disabled' => $isElementDisabled
74: ));
75:
76: Mage::dispatchEvent('adminhtml_cms_page_edit_tab_meta_prepare_form', array('form' => $form));
77:
78: $form->setValues($model->getData());
79:
80: $this->setForm($form);
81:
82: return parent::_prepareForm();
83: }
84:
85: 86: 87: 88: 89:
90: public function getTabLabel()
91: {
92: return Mage::helper('cms')->__('Meta Data');
93: }
94:
95: 96: 97: 98: 99:
100: public function getTabTitle()
101: {
102: return Mage::helper('cms')->__('Meta Data');
103: }
104:
105: 106: 107: 108: 109:
110: public function canShowTab()
111: {
112: return true;
113: }
114:
115: 116: 117: 118: 119:
120: public function isHidden()
121: {
122: return false;
123: }
124:
125: 126: 127: 128: 129: 130:
131: protected function _isAllowedAction($action)
132: {
133: return Mage::getSingleton('admin/session')->isAllowed('cms/page/' . $action);
134: }
135: }
136: