本文整理汇总了PHP中Mage_Api2_Model_Acl_Global_Role::isSystemRole方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Api2_Model_Acl_Global_Role::isSystemRole方法的具体用法?PHP Mage_Api2_Model_Acl_Global_Role::isSystemRole怎么用?PHP Mage_Api2_Model_Acl_Global_Role::isSystemRole使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Api2_Model_Acl_Global_Role
的用法示例。
在下文中一共展示了Mage_Api2_Model_Acl_Global_Role::isSystemRole方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _beforeToHtml
/**
* Hook before html rendering
*
* @return Mage_Api2_Block_Adminhtml_Roles_Tabs
*/
protected function _beforeToHtml()
{
$role = $this->getRole();
if ($role && Mage_Api2_Model_Acl_Global_Role::isSystemRole($role)) {
$this->setActiveTab('api2_role_section_resources');
} else {
$this->setActiveTab('api2_role_section_info');
}
return parent::_beforeToHtml();
}
示例2: isHidden
/**
* Whether tab is hidden
*
* @return bool
*/
public function isHidden()
{
return $this->getRole() && Mage_Api2_Model_Acl_Global_Role::isSystemRole($this->getRole());
}
示例3: getDeleteButtonHtml
/**
* Get delete button HTML
*
* @return string
*/
public function getDeleteButtonHtml()
{
if (!$this->getRole() || !$this->getRole()->getId() || Mage_Api2_Model_Acl_Global_Role::isSystemRole($this->getRole())) {
return '';
}
$this->getChildBlock('deleteButton')->setData('onclick', sprintf("deleteConfirm('%s', '%s')", Mage::helper('Mage_Adminhtml_Helper_Data')->__('Are you sure you want to do this?'), $this->getUrl('*/*/delete', array('id' => $this->getRole()->getId()))));
return $this->getChildHtml('deleteButton');
}
示例4: _beforeDelete
/**
* Perform checks before role delete
*
* @return Mage_Api2_Model_Acl_Global_Role
*/
protected function _beforeDelete()
{
if (Mage_Api2_Model_Acl_Global_Role::isSystemRole($this)) {
/** @var $helper Mage_Core_Helper_Data */
$helper = Mage::helper('core');
Mage::throwException(Mage::helper('api2')->__('%s role is a special one and can\'t be deleted.', $helper->escapeHtml($this->getRoleName())));
}
parent::_beforeDelete();
return $this;
}