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_Api2_Adminhtml_Api2_AttributeController
  • Mage_Api2_Adminhtml_Api2_RoleController
  • Mage_Api2_Block_Adminhtml_Attribute
  • Mage_Api2_Block_Adminhtml_Attribute_Buttons
  • Mage_Api2_Block_Adminhtml_Attribute_Edit
  • Mage_Api2_Block_Adminhtml_Attribute_Edit_Form
  • Mage_Api2_Block_Adminhtml_Attribute_Grid
  • Mage_Api2_Block_Adminhtml_Attribute_Tab_Resource
  • Mage_Api2_Block_Adminhtml_Attribute_Tabs
  • Mage_Api2_Block_Adminhtml_Permissions_User_Edit_Tab_Roles
  • Mage_Api2_Block_Adminhtml_Roles
  • Mage_Api2_Block_Adminhtml_Roles_Buttons
  • Mage_Api2_Block_Adminhtml_Roles_Grid
  • Mage_Api2_Block_Adminhtml_Roles_Tab_Info
  • Mage_Api2_Block_Adminhtml_Roles_Tab_Resources
  • Mage_Api2_Block_Adminhtml_Roles_Tab_Users
  • Mage_Api2_Block_Adminhtml_Roles_Tabs
  • Mage_Api2_Helper_Data
  • Mage_Api2_Model_Acl
  • Mage_Api2_Model_Acl_Filter
  • Mage_Api2_Model_Acl_Filter_Attribute
  • Mage_Api2_Model_Acl_Filter_Attribute_Operation
  • Mage_Api2_Model_Acl_Filter_Attribute_ResourcePermission
  • Mage_Api2_Model_Acl_Global
  • Mage_Api2_Model_Acl_Global_Role
  • Mage_Api2_Model_Acl_Global_Rule
  • Mage_Api2_Model_Acl_Global_Rule_Permission
  • Mage_Api2_Model_Acl_Global_Rule_Privilege
  • Mage_Api2_Model_Acl_Global_Rule_ResourcePermission
  • Mage_Api2_Model_Acl_Global_Rule_Tree
  • Mage_Api2_Model_Auth
  • Mage_Api2_Model_Auth_Adapter
  • Mage_Api2_Model_Auth_Adapter_Abstract
  • Mage_Api2_Model_Auth_Adapter_Oauth
  • Mage_Api2_Model_Auth_User
  • Mage_Api2_Model_Auth_User_Abstract
  • Mage_Api2_Model_Auth_User_Admin
  • Mage_Api2_Model_Auth_User_Customer
  • Mage_Api2_Model_Auth_User_Guest
  • Mage_Api2_Model_Config
  • Mage_Api2_Model_Dispatcher
  • Mage_Api2_Model_Multicall
  • Mage_Api2_Model_Observer
  • Mage_Api2_Model_Renderer
  • Mage_Api2_Model_Renderer_Json
  • Mage_Api2_Model_Renderer_Query
  • Mage_Api2_Model_Renderer_Xml
  • Mage_Api2_Model_Renderer_Xml_Writer
  • Mage_Api2_Model_Request
  • Mage_Api2_Model_Request_Internal
  • Mage_Api2_Model_Request_Interpreter
  • Mage_Api2_Model_Request_Interpreter_Json
  • Mage_Api2_Model_Request_Interpreter_Query
  • Mage_Api2_Model_Request_Interpreter_Xml
  • Mage_Api2_Model_Resource
  • Mage_Api2_Model_Resource_Acl_Filter_Attribute
  • Mage_Api2_Model_Resource_Acl_Filter_Attribute_Collection
  • Mage_Api2_Model_Resource_Acl_Global_Role
  • Mage_Api2_Model_Resource_Acl_Global_Role_Collection
  • Mage_Api2_Model_Resource_Acl_Global_Rule
  • Mage_Api2_Model_Resource_Acl_Global_Rule_Collection
  • Mage_Api2_Model_Resource_Setup
  • Mage_Api2_Model_Resource_Validator
  • Mage_Api2_Model_Resource_Validator_Eav
  • Mage_Api2_Model_Resource_Validator_Fields
  • Mage_Api2_Model_Response
  • Mage_Api2_Model_Route_Abstract
  • Mage_Api2_Model_Route_ApiType
  • Mage_Api2_Model_Route_Rest
  • Mage_Api2_Model_Router
  • Mage_Api2_Model_Server

Interfaces

  • Mage_Api2_Model_Acl_PermissionInterface
  • Mage_Api2_Model_Renderer_Interface
  • Mage_Api2_Model_Request_Interpreter_Interface
  • Mage_Api2_Model_Route_Interface

Exceptions

  • Mage_Api2_Exception
  • 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_Api2
 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:  * Roles grid block
 29:  *
 30:  * @category   Mage
 31:  * @package    Mage_Api2
 32:  * @author     Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_Api2_Block_Adminhtml_Roles_Grid extends Mage_Adminhtml_Block_Widget_Grid
 35: {
 36:     /**
 37:      * Construct grid block
 38:      */
 39:     public function __construct()
 40:     {
 41:         parent::__construct();
 42:         $this->setId('rolesGrid');
 43:         $this->setUseAjax(true);
 44:         $this->setSaveParametersInSession(true);
 45:         $this->setDefaultSort('entity_id')
 46:             ->setDefaultDir(Varien_Db_Select::SQL_DESC);
 47:     }
 48: 
 49:     /**
 50:      * Prepare collection
 51:      *
 52:      * @return Mage_Api2_Block_Adminhtml_Roles_Grid
 53:      */
 54:     protected function _prepareCollection()
 55:     {
 56:         /** @var $collection Mage_Api2_Model_Resource_Acl_Global_Role_Collection */
 57:         $collection = Mage::getModel('api2/acl_global_role')->getCollection();
 58:         $this->setCollection($collection);
 59:         parent::_prepareCollection();
 60:         return $this;
 61:     }
 62: 
 63:     /**
 64:      * Prepare columns
 65:      *
 66:      * @return Mage_Api2_Block_Adminhtml_Roles_Grid
 67:      */
 68:     protected function _prepareColumns()
 69:     {
 70:         $this->addColumn('entity_id', array(
 71:             'header' => Mage::helper('oauth')->__('ID'),
 72:             'index'  => 'entity_id',
 73:             'align'  => 'right',
 74:             'width'  => '50px',
 75:         ));
 76: 
 77:         $this->addColumn('role_name', array(
 78:             'header' => Mage::helper('oauth')->__('Role Name'),
 79:             'index'  => 'role_name',
 80:             'escape' => true,
 81:         ));
 82: 
 83:         $this->addColumn('tole_user_type', array(
 84:             'header'         => Mage::helper('oauth')->__('User Type'),
 85:             'sortable'       => false,
 86:             'frame_callback' => array($this, 'decorateUserType')
 87:         ));
 88: 
 89:         $this->addColumn('created_at', array(
 90:             'header' => Mage::helper('oauth')->__('Created At'),
 91:             'index'  => 'created_at'
 92:         ));
 93: 
 94:         parent::_prepareColumns();
 95:         return $this;
 96:     }
 97: 
 98:     /**
 99:      * Get grid URL
100:      *
101:      * @return string
102:      */
103:     public function getGridUrl()
104:     {
105:         return $this->getUrl('*/*/grid', array('_current' => true));
106:     }
107: 
108:     /**
109:      * Get row URL
110:      *
111:      * @param Mage_Api2_Model_Acl_Global_Role $row
112:      * @return string|null
113:      */
114:     public function getRowUrl($row)
115:     {
116:         /** @var $session Mage_Admin_Model_Session */
117:         $session = Mage::getSingleton('admin/session');
118: 
119:         if ($session->isAllowed('system/api/roles/edit')) {
120:             return $this->getUrl('*/*/edit', array('id' => $row->getId()));
121:         }
122:         return null;
123:     }
124: 
125:     /**
126:      * Decorate 'User Type' column
127:      *
128:      * @param string $renderedValue Rendered value
129:      * @param Mage_Api2_Model_Acl_Global_Role $row
130:      * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
131:      * @param bool $isExport
132:      * @return string
133:      */
134:     public function decorateUserType($renderedValue, $row, $column, $isExport)
135:     {
136:         switch ($row->getEntityId()) {
137:             case Mage_Api2_Model_Acl_Global_Role::ROLE_GUEST_ID:
138:                 $userType = Mage::helper('api2')->__('Guest');
139:                 break;
140:             case Mage_Api2_Model_Acl_Global_Role::ROLE_CUSTOMER_ID:
141:                 $userType = Mage::helper('api2')->__('Customer');
142:                 break;
143:             default:
144:                 $userType = Mage::helper('api2')->__('Admin');
145:                 break;
146:         }
147:         return $userType;
148:     }
149: }
150: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0