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_Admin_Helper_Data
  • Mage_Admin_Model_Acl
  • Mage_Admin_Model_Acl_Assert_Ip
  • Mage_Admin_Model_Acl_Assert_Time
  • Mage_Admin_Model_Acl_Resource
  • Mage_Admin_Model_Acl_Role
  • Mage_Admin_Model_Acl_Role_Generic
  • Mage_Admin_Model_Acl_Role_Group
  • Mage_Admin_Model_Acl_Role_Registry
  • Mage_Admin_Model_Acl_Role_User
  • Mage_Admin_Model_Config
  • Mage_Admin_Model_Mysql4_Acl
  • Mage_Admin_Model_Mysql4_Acl_Role
  • Mage_Admin_Model_Mysql4_Acl_Role_Collection
  • Mage_Admin_Model_Mysql4_Permissions_Collection
  • Mage_Admin_Model_Mysql4_Role
  • Mage_Admin_Model_Mysql4_Role_Collection
  • Mage_Admin_Model_Mysql4_Roles
  • Mage_Admin_Model_Mysql4_Roles_Collection
  • Mage_Admin_Model_Mysql4_Roles_User_Collection
  • Mage_Admin_Model_Mysql4_Rules
  • Mage_Admin_Model_Mysql4_Rules_Collection
  • Mage_Admin_Model_Mysql4_User
  • Mage_Admin_Model_Mysql4_User_Collection
  • Mage_Admin_Model_Observer
  • Mage_Admin_Model_Resource_Acl
  • Mage_Admin_Model_Resource_Acl_Role_Collection
  • Mage_Admin_Model_Resource_Permissions_Collection
  • Mage_Admin_Model_Resource_Role
  • Mage_Admin_Model_Resource_Role_Collection
  • Mage_Admin_Model_Resource_Roles
  • Mage_Admin_Model_Resource_Roles_Collection
  • Mage_Admin_Model_Resource_Roles_User_Collection
  • Mage_Admin_Model_Resource_Rules
  • Mage_Admin_Model_Resource_Rules_Collection
  • Mage_Admin_Model_Resource_User
  • Mage_Admin_Model_Resource_User_Collection
  • Mage_Admin_Model_Role
  • Mage_Admin_Model_Roles
  • Mage_Admin_Model_Rules
  • Mage_Admin_Model_Session
  • Mage_Admin_Model_User
  • 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_Admin
 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: /**
 29:  * Configuration for Admin model
 30:  *
 31:  * @category   Mage
 32:  * @package    Mage_Admin
 33:  * @author      Magento Core Team <core@magentocommerce.com>
 34:  */
 35: class Mage_Admin_Model_Config extends Varien_Simplexml_Config
 36: {
 37:     /**
 38:      * adminhtml.xml merged config
 39:      *
 40:      * @var Varien_Simplexml_Config
 41:      */
 42:     protected $_adminhtmlConfig;
 43: 
 44:     /**
 45:      * Load config from merged adminhtml.xml files
 46:      */
 47:     public function __construct()
 48:     {
 49:         parent::__construct();
 50:         $this->setCacheId('adminhtml_acl_menu_config');
 51: 
 52:         /* @var $adminhtmlConfig Varien_Simplexml_Config */
 53:         $adminhtmlConfig = Mage::app()->loadCache($this->getCacheId());
 54:         if ($adminhtmlConfig) {
 55:             $this->_adminhtmlConfig = new Varien_Simplexml_Config($adminhtmlConfig);
 56:         } else {
 57:             $adminhtmlConfig = new Varien_Simplexml_Config;
 58:             $adminhtmlConfig->loadString('<?xml version="1.0"?><config></config>');
 59:             Mage::getConfig()->loadModulesConfiguration('adminhtml.xml', $adminhtmlConfig);
 60:             $this->_adminhtmlConfig = $adminhtmlConfig;
 61: 
 62:             /**
 63:              * @deprecated after 1.4.0.0-alpha2
 64:              * support backwards compatibility with config.xml
 65:              */
 66:             $aclConfig  = Mage::getConfig()->getNode('adminhtml/acl');
 67:             if ($aclConfig) {
 68:                 $adminhtmlConfig->getNode()->extendChild($aclConfig, true);
 69:             }
 70:             $menuConfig = Mage::getConfig()->getNode('adminhtml/menu');
 71:             if ($menuConfig) {
 72:                 $adminhtmlConfig->getNode()->extendChild($menuConfig, true);
 73:             }
 74: 
 75:             if (Mage::app()->useCache('config')) {
 76:                 Mage::app()->saveCache($adminhtmlConfig->getXmlString(), $this->getCacheId(),
 77:                     array(Mage_Core_Model_Config::CACHE_TAG));
 78:             }
 79:         }
 80:     }
 81: 
 82:     /**
 83:      * Load Acl resources from config
 84:      *
 85:      * @param Mage_Admin_Model_Acl $acl
 86:      * @param Mage_Core_Model_Config_Element $resource
 87:      * @param string $parentName
 88:      * @return Mage_Admin_Model_Config
 89:      */
 90:     public function loadAclResources(Mage_Admin_Model_Acl $acl, $resource = null, $parentName = null)
 91:     {
 92:         if (is_null($resource)) {
 93:             $resource = $this->getAdminhtmlConfig()->getNode("acl/resources");
 94:             $resourceName = null;
 95:         } else {
 96:             $resourceName = (is_null($parentName) ? '' : $parentName . '/') . $resource->getName();
 97:             $acl->add(Mage::getModel('admin/acl_resource', $resourceName), $parentName);
 98:         }
 99: 
100:         if (isset($resource->all)) {
101:             $acl->add(Mage::getModel('admin/acl_resource', 'all'), null);
102:         }
103: 
104:         if (isset($resource->admin)) {
105:             $children = $resource->admin;
106:         } elseif (isset($resource->children)){
107:             $children = $resource->children->children();
108:         }
109: 
110: 
111: 
112:         if (empty($children)) {
113:             return $this;
114:         }
115: 
116:         foreach ($children as $res) {
117:             if (1 == $res->disabled) {
118:                 continue;
119:             }
120:             $this->loadAclResources($acl, $res, $resourceName);
121:         }
122:         return $this;
123:     }
124: 
125:     /**
126:      * Get acl assert config
127:      *
128:      * @param string $name
129:      * @return Mage_Core_Model_Config_Element|boolean
130:      */
131:     public function getAclAssert($name = '')
132:     {
133:         $asserts = $this->getNode("admin/acl/asserts");
134:         if ('' === $name) {
135:             return $asserts;
136:         }
137: 
138:         if (isset($asserts->$name)) {
139:             return $asserts->$name;
140:         }
141: 
142:         return false;
143:     }
144: 
145:     /**
146:      * Retrieve privilege set by name
147:      *
148:      * @param string $name
149:      * @return Mage_Core_Model_Config_Element|boolean
150:      */
151:     public function getAclPrivilegeSet($name = '')
152:     {
153:         $sets = $this->getNode("admin/acl/privilegeSets");
154:         if ('' === $name) {
155:             return $sets;
156:         }
157: 
158:         if (isset($sets->$name)) {
159:             return $sets->$name;
160:         }
161: 
162:         return false;
163:     }
164: 
165:     /**
166:      * Retrieve xml config
167:      *
168:      * @return Varien_Simplexml_Config
169:      */
170:     public function getAdminhtmlConfig()
171:     {
172:         return $this->_adminhtmlConfig;
173:     }
174: 
175:     /**
176:      * Get menu item label by item path
177:      *
178:      * @param string $path
179:      * @return string
180:      */
181:     public function getMenuItemLabel($path)
182:     {
183:         $moduleName = 'adminhtml';
184:         $menuNode = $this->getAdminhtmlConfig()->getNode('menu/' . str_replace('/', '/children/', trim($path, '/')));
185:         if ($menuNode->getAttribute('module')) {
186:             $moduleName = (string)$menuNode->getAttribute('module');
187:         }
188:         return Mage::helper($moduleName)->__((string)$menuNode->title);
189:     }
190: }
191: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0