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:  * Widgets management controller
29:  *
30:  * @category    Mage
31:  * @package     Mage_Widget
32:  * @author      Magento Core Team <core@magentocommerce.com>
33:  */
34: class Mage_Widget_Adminhtml_WidgetController extends Mage_Adminhtml_Controller_Action
35: {
36:     /**
37:      * Wisywyg widget plugin main page
38:      */
39:     public function indexAction()
40:     {
41:         // save extra params for widgets insertion form
42:         $skipped = $this->getRequest()->getParam('skip_widgets');
43:         $skipped = Mage::getSingleton('widget/widget_config')->decodeWidgetsFromQuery($skipped);
44: 
45:         Mage::register('skip_widgets', $skipped);
46: 
47:         $this->loadLayout('empty')->renderLayout();
48:     }
49: 
50:     /**
51:      * Ajax responder for loading plugin options form
52:      */
53:     public function loadOptionsAction()
54:     {
55:         try {
56:             $this->loadLayout('empty');
57:             if ($paramsJson = $this->getRequest()->getParam('widget')) {
58:                 $request = Mage::helper('core')->jsonDecode($paramsJson);
59:                 if (is_array($request)) {
60:                     $optionsBlock = $this->getLayout()->getBlock('wysiwyg_widget.options');
61:                     if (isset($request['widget_type'])) {
62:                         $optionsBlock->setWidgetType($request['widget_type']);
63:                     }
64:                     if (isset($request['values'])) {
65:                         $optionsBlock->setWidgetValues($request['values']);
66:                     }
67:                 }
68:                 $this->renderLayout();
69:             }
70:         } catch (Mage_Core_Exception $e) {
71:             $result = array('error' => true, 'message' => $e->getMessage());
72:             $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
73:         }
74:     }
75: 
76:     /**
77:      * Format widget pseudo-code for inserting into wysiwyg editor
78:      */
79:     public function buildWidgetAction()
80:     {
81:         $type = $this->getRequest()->getPost('widget_type');
82:         $params = $this->getRequest()->getPost('parameters', array());
83:         $asIs = $this->getRequest()->getPost('as_is');
84:         $html = Mage::getSingleton('widget/widget')->getWidgetDeclaration($type, $params, $asIs);
85:         $this->getResponse()->setBody($html);
86:     }
87: }
88: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0