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 Settings 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_Settings
 35:     extends Mage_Adminhtml_Block_Widget_Form
 36:     implements Mage_Adminhtml_Block_Widget_Tab_Interface
 37: {
 38:     protected function _construct()
 39:     {
 40:         parent::_construct();
 41:         $this->setActive(true);
 42:     }
 43: 
 44:     /**
 45:      * Prepare label for tab
 46:      *
 47:      * @return string
 48:      */
 49:     public function getTabLabel()
 50:     {
 51:         return Mage::helper('widget')->__('Settings');
 52:     }
 53: 
 54:     /**
 55:      * Prepare title for tab
 56:      *
 57:      * @return string
 58:      */
 59:     public function getTabTitle()
 60:     {
 61:         return Mage::helper('widget')->__('Settings');
 62:     }
 63: 
 64:     /**
 65:      * Returns status flag about this tab can be showen or not
 66:      *
 67:      * @return true
 68:      */
 69:     public function canShowTab()
 70:     {
 71:         return !(bool)$this->getWidgetInstance()->isCompleteToCreate();
 72:     }
 73: 
 74:     /**
 75:      * Returns status flag about this tab hidden or not
 76:      *
 77:      * @return true
 78:      */
 79:     public function isHidden()
 80:     {
 81:         return false;
 82:     }
 83: 
 84:     /**
 85:      * Getter
 86:      *
 87:      * @return Mage_Widget_Model_Widget_Instance
 88:      */
 89:     public function getWidgetInstance()
 90:     {
 91:         return Mage::registry('current_widget_instance');
 92:     }
 93: 
 94:     /**
 95:      * Prepare form before rendering HTML
 96:      *
 97:      * @return Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Settings
 98:      */
 99:     protected function _prepareForm()
100:     {
101:         $widgetInstance = $this->getWidgetInstance();
102:         $form = new Varien_Data_Form(array(
103:             'id' => 'edit_form',
104:             'action' => $this->getData('action'),
105:             'method' => 'post'
106:         ));
107: 
108:         $fieldset = $form->addFieldset('base_fieldset',
109:             array('legend'=>Mage::helper('widget')->__('Settings'))
110:         );
111: 
112:         $this->_addElementTypes($fieldset);
113: 
114:         $fieldset->addField('type', 'select', array(
115:             'name'     => 'type',
116:             'label'    => Mage::helper('widget')->__('Type'),
117:             'title'    => Mage::helper('widget')->__('Type'),
118:             'required' => true,
119:             'values'   => $this->getTypesOptionsArray()
120:         ));
121: 
122:         $fieldset->addField('package_theme', 'select', array(
123:             'name'     => 'package_theme',
124:             'label'    => Mage::helper('widget')->__('Design Package/Theme'),
125:             'title'    => Mage::helper('widget')->__('Design Package/Theme'),
126:             'required' => true,
127:             'values'   => $this->getPackegeThemeOptionsArray()
128:         ));
129:         $continueButton = $this->getLayout()
130:             ->createBlock('adminhtml/widget_button')
131:             ->setData(array(
132:                 'label'     => Mage::helper('widget')->__('Continue'),
133:                 'onclick'   => "setSettings('".$this->getContinueUrl()."', 'type', 'package_theme')",
134:                 'class'     => 'save'
135:             ));
136:         $fieldset->addField('continue_button', 'note', array(
137:             'text' => $continueButton->toHtml(),
138:         ));
139: 
140:         $this->setForm($form);
141: 
142:         return parent::_prepareForm();
143:     }
144: 
145:     /**
146:      * Return url for continue button
147:      *
148:      * @return string
149:      */
150:     public function getContinueUrl()
151:     {
152:         return $this->getUrl('*/*/*', array(
153:             '_current'  => true,
154:             'type'      => '{{type}}',
155:             'package'   => '{{package}}',
156:             'theme'     => '{{theme}}'
157:         ));
158:     }
159: 
160:     /**
161:      * Retrieve array (widget_type => widget_name) of available widgets
162:      *
163:      * @return array
164:      */
165:     public function getTypesOptionsArray()
166:     {
167:         $widgets = $this->getWidgetInstance()->getWidgetsOptionArray();
168:         array_unshift($widgets, array(
169:             'value' => '',
170:             'label' => Mage::helper('widget')->__('-- Please Select --')
171:         ));
172:         return $widgets;
173:     }
174: 
175:     /**
176:      * User-defined widgets sorting by Name
177:      *
178:      * @param array $a
179:      * @param array $b
180:      * @return boolean
181:      */
182:     protected function _sortWidgets($a, $b)
183:     {
184:         return strcmp($a["label"], $b["label"]);
185:     }
186: 
187:     /**
188:      * Retrieve package/theme options array
189:      *
190:      * @return array
191:      */
192:     public function getPackegeThemeOptionsArray()
193:     {
194:         return Mage::getModel('core/design_source_design')
195:             ->setIsFullLabel(true)->getAllOptions(true);
196:     }
197: }
198: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0