<?php
/**
* Landofcoder
*
* NOTICE OF LICENSE
*
* This source file is subject to the Landofcoder.com license that is
* available through the world-wide-web at this URL:
* https://landofcoder.com/license-agreement.html
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Landofcoder
* @package Lofmp_Blog
* @copyright Copyright (c) 2016 Landofcoder (https://landofcoder.com/)
* @license https://landofcoder.com/LICENSE-1.0.html
*/
namespace Lofmp\Blog\Block\Adminhtml;
class Category extends \Magento\Backend\Block\Widget\Grid\Container
{
/**
* Block constructor
*
* @return void
*/
protected function _construct()
{
$this->_controller = 'adminhtml_category';
$this->_blockGroup = 'Lofmp_Blog';
$this->_headerText = __('Manage Categories');
parent::_construct();
if ($this->_isAllowedAction('Lofmp_Blog::category_new')) {
$this->buttonList->update('add', 'label', __('Add New Category'));
} else {
$this->buttonList->remove('add');
}
}
/**
* Check permission for passed action
*
* @param string $resourceId
* @return bool
*/
protected function _isAllowedAction($resourceId)
{
return $this->_authorization->isAllowed($resourceId);
}
}
|