Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Widget_Adminhtml_Widget_InstanceController
  • Mage_Widget_Adminhtml_WidgetController
  • Mage_Widget_Block_Adminhtml_Widget_Form
  • Mage_Widget_Block_Adminhtml_Widget_Instance
  • Mage_Widget_Block_Adminhtml_Widget_Instance_Edit
  • Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Block
  • Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Layout
  • Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Template
  • Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Form
  • Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Main
  • Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Main_Layout
  • Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Properties
  • Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Settings
  • Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tabs
  • Mage_Widget_Block_Adminhtml_Widget_Instance_Grid
  • Mage_Widget_Block_Adminhtml_Widget_Options
  • Mage_Widget_Helper_Data
  • Mage_Widget_Model_Mysql4_Widget
  • Mage_Widget_Model_Mysql4_Widget_Instance
  • Mage_Widget_Model_Mysql4_Widget_Instance_Collection
  • Mage_Widget_Model_Observer
  • Mage_Widget_Model_Resource_Widget
  • Mage_Widget_Model_Resource_Widget_Instance
  • Mage_Widget_Model_Resource_Widget_Instance_Collection
  • Mage_Widget_Model_Template_Filter
  • Mage_Widget_Model_Widget
  • Mage_Widget_Model_Widget_Config
  • Mage_Widget_Model_Widget_Instance

Interfaces

  • Mage_Widget_Block_Interface
  • Overview
  • Package
  • Class
  • Tree
  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_Widget
 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:  * Widget Instance Main tab block
 29:  *
 30:  * @category    Mage
 31:  * @package     Mage_Widget
 32:  * @author      Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Main
 35:     extends Mage_Adminhtml_Block_Widget_Form
 36:     implements Mage_Adminhtml_Block_Widget_Tab_Interface
 37: {
 38:     /**
 39:      * Internal constructor
 40:      *
 41:      */
 42:     protected function _construct()
 43:     {
 44:         parent::_construct();
 45:         $this->setActive(true);
 46:     }
 47: 
 48:     /**
 49:      * Prepare label for tab
 50:      *
 51:      * @return string
 52:      */
 53:     public function getTabLabel()
 54:     {
 55:         return Mage::helper('widget')->__('Frontend Properties');
 56:     }
 57: 
 58:     /**
 59:      * Prepare title for tab
 60:      *
 61:      * @return string
 62:      */
 63:     public function getTabTitle()
 64:     {
 65:         return Mage::helper('widget')->__('Frontend Properties');
 66:     }
 67: 
 68:     /**
 69:      * Returns status flag about this tab can be showen or not
 70:      *
 71:      * @return true
 72:      */
 73:     public function canShowTab()
 74:     {
 75:         return $this->getWidgetInstance()->isCompleteToCreate();
 76:     }
 77: 
 78:     /**
 79:      * Returns status flag about this tab hidden or not
 80:      *
 81:      * @return true
 82:      */
 83:     public function isHidden()
 84:     {
 85:         return false;
 86:     }
 87: 
 88:     /**
 89:      * Getter
 90:      *
 91:      * @return Widget_Model_Widget_Instance
 92:      */
 93:     public function getWidgetInstance()
 94:     {
 95:         return Mage::registry('current_widget_instance');
 96:     }
 97: 
 98:     /**
 99:      * Prepare form before rendering HTML
100:      *
101:      * @return Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Main
102:      */
103:     protected function _prepareForm()
104:     {
105:         $widgetInstance = $this->getWidgetInstance();
106:         $form = new Varien_Data_Form(array(
107:             'id' => 'edit_form',
108:             'action' => $this->getData('action'),
109:             'method' => 'post'
110:         ));
111: 
112:         $fieldset = $form->addFieldset('base_fieldset',
113:             array('legend' => Mage::helper('widget')->__('Frontend Properties'))
114:         );
115: 
116:         if ($widgetInstance->getId()) {
117:             $fieldset->addField('instance_id', 'hidden', array(
118:                 'name' => 'isntance_id',
119:             ));
120:         }
121: 
122:         $this->_addElementTypes($fieldset);
123: 
124:         $fieldset->addField('type', 'select', array(
125:             'name'  => 'type',
126:             'label' => Mage::helper('widget')->__('Type'),
127:             'title' => Mage::helper('widget')->__('Type'),
128:             'class' => '',
129:             'values' => $this->getTypesOptionsArray(),
130:             'disabled' => true
131:         ));
132: 
133:         $fieldset->addField('package_theme', 'select', array(
134:             'name'  => 'package_theme',
135:             'label' => Mage::helper('widget')->__('Design Package/Theme'),
136:             'title' => Mage::helper('widget')->__('Design Package/Theme'),
137:             'required' => false,
138:             'values'   => $this->getPackegeThemeOptionsArray(),
139:             'disabled' => true
140:         ));
141: 
142:         $fieldset->addField('title', 'text', array(
143:             'name'  => 'title',
144:             'label' => Mage::helper('widget')->__('Widget Instance Title'),
145:             'title' => Mage::helper('widget')->__('Widget Instance Title'),
146:             'class' => '',
147:             'required' => true,
148:         ));
149: 
150:         if (!Mage::app()->isSingleStoreMode()) {
151:             $field = $fieldset->addField('store_ids', 'multiselect', array(
152:                 'name'      => 'store_ids[]',
153:                 'label'     => Mage::helper('widget')->__('Assign to Store Views'),
154:                 'title'     => Mage::helper('widget')->__('Assign to Store Views'),
155:                 'required'  => true,
156:                 'values'    => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
157:             ));
158:             $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
159:             $field->setRenderer($renderer);
160:         }
161: 
162:         $fieldset->addField('sort_order', 'text', array(
163:             'name'  => 'sort_order',
164:             'label' => Mage::helper('widget')->__('Sort Order'),
165:             'title' => Mage::helper('widget')->__('Sort Order'),
166:             'class' => '',
167:             'required' => false,
168:             'note' => Mage::helper('widget')->__('Sort Order of widget instances in the same block reference')
169:         ));
170: 
171:         /* @var $layoutBlock Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Main_Layout */
172:         $layoutBlock = $this->getLayout()
173:             ->createBlock('widget/adminhtml_widget_instance_edit_tab_main_layout')
174:             ->setWidgetInstance($widgetInstance);
175:         $fieldset = $form->addFieldset('layout_updates_fieldset',
176:             array('legend' => Mage::helper('widget')->__('Layout Updates'))
177:         );
178:         $fieldset->addField('layout_updates', 'note', array(
179:         ));
180:         $form->getElement('layout_updates_fieldset')->setRenderer($layoutBlock);
181:         $this->setForm($form);
182: 
183:         return parent::_prepareForm();
184:     }
185: 
186:     /**
187:      * Retrieve array (widget_type => widget_name) of available widgets
188:      *
189:      * @return array
190:      */
191:     public function getTypesOptionsArray()
192:     {
193:         return $this->getWidgetInstance()->getWidgetsOptionArray();
194:     }
195: 
196:     /**
197:      * Retrieve design package/theme options array
198:      *
199:      * @return array
200:      */
201:     public function getPackegeThemeOptionsArray()
202:     {
203:         return Mage::getModel('core/design_source_design')
204:             ->setIsFullLabel(true)->getAllOptions(true);
205:     }
206: 
207:     /**
208:      * Initialize form fileds values
209:      *
210:      * @return Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Main
211:      */
212:     protected function _initFormValues()
213:     {
214:         $this->getForm()->addValues($this->getWidgetInstance()->getData());
215:         return parent::_initFormValues();
216:     }
217: }
218: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0