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 grid 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_Grid extends Mage_Adminhtml_Block_Widget_Grid
 35: {
 36:     /**
 37:      * Internal constructor
 38:      *
 39:      */
 40:     protected function _construct()
 41:     {
 42:         parent::_construct();
 43:         $this->setId('widgetInstanceGrid');
 44:         $this->setDefaultSort('instance_id');
 45:         $this->setDefaultDir('ASC');
 46:     }
 47: 
 48:     /**
 49:      * Prepare grid collection object
 50:      *
 51:      * @return Mage_Widget_Block_Adminhtml_Widget_Instance_Grid
 52:      */
 53:     protected function _prepareCollection()
 54:     {
 55:         /* @var $collection Mage_Widget_Model_Mysql4_Widget_Instance_Collection */
 56:         $collection = Mage::getModel('widget/widget_instance')->getCollection();
 57:         $this->setCollection($collection);
 58:         return parent::_prepareCollection();
 59:     }
 60: 
 61:     /**
 62:      * Prepare grid columns
 63:      *
 64:      * @return Mage_Widget_Block_Adminhtml_Widget_Instance_Grid
 65:      */
 66:     protected function _prepareColumns()
 67:     {
 68:         $this->addColumn('instance_id', array(
 69:             'header'    => Mage::helper('widget')->__('Widget ID'),
 70:             'align'     => 'left',
 71:             'index'     => 'instance_id',
 72:         ));
 73: 
 74:         $this->addColumn('title', array(
 75:             'header'    => Mage::helper('widget')->__('Widget Instance Title'),
 76:             'align'     => 'left',
 77:             'index'     => 'title',
 78:         ));
 79: 
 80:         $this->addColumn('type', array(
 81:             'header'    => Mage::helper('widget')->__('Type'),
 82:             'align'     => 'left',
 83:             'index'     => 'instance_type',
 84:             'type'      => 'options',
 85:             'options'   => $this->getTypesOptionsArray()
 86:         ));
 87: 
 88:         $this->addColumn('package_theme', array(
 89:             'header'    => Mage::helper('widget')->__('Design Package/Theme'),
 90:             'align'     => 'left',
 91:             'index'     => 'package_theme',
 92:             'type'      => 'theme',
 93:             'with_empty' => true,
 94:         ));
 95: 
 96:         $this->addColumn('sort_order', array(
 97:             'header'    => Mage::helper('widget')->__('Sort Order'),
 98:             'width'     => '100',
 99:             'align'     => 'center',
100:             'index'     => 'sort_order',
101:         ));
102: 
103:         return parent::_prepareColumns();
104:     }
105: 
106:     /**
107:      * Retrieve array (widget_type => widget_name) of available widgets
108:      *
109:      * @return array
110:      */
111:     public function getTypesOptionsArray()
112:     {
113:         $widgets = array();
114:         $widgetsOptionsArr = Mage::getModel('widget/widget_instance')->getWidgetsOptionArray();
115:         foreach ($widgetsOptionsArr as $widget) {
116:             $widgets[$widget['value']] = $widget['label'];
117:         }
118:         return $widgets;
119:     }
120: 
121:     /**
122:      * Retrieve design package/theme options array
123:      *
124:      * @return array
125:      */
126:     public function getPackageThemeOptionsArray()
127:     {
128:         $packageThemeArray = array();
129:         $packageThemeOptions = Mage::getModel('core/design_source_design')
130:             ->setIsFullLabel(true)->getAllOptions(false);
131:         foreach ($packageThemeOptions as $item) {
132:             if (is_array($item['value'])) {
133:                 foreach ($item['value'] as $valueItem) {
134:                     $packageThemeArray[$valueItem['value']] = $valueItem['label'];
135:                 }
136:             } else {
137:                 $packageThemeArray[$item['value']] = $item['label'];
138:             }
139:         }
140:         return $packageThemeArray;
141:     }
142: 
143:     /**
144:      * Row click url
145:      *
146:      * @return string
147:      */
148:     public function getRowUrl($row)
149:     {
150:         return $this->getUrl('*/*/edit', array('instance_id' => $row->getId()));
151:     }
152: }
153: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0