| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php defined('BX_DOL') or die('hack attempt');
- /**
- * Copyright (c) UNA, Inc - https://una.io
- * MIT License - https://opensource.org/licenses/MIT
- *
- * @defgroup UnaView UNA Studio Representation classes
- * @ingroup UnaStudio
- * @{
- */
- class BxBaseStudioRoles extends BxDolStudioRoles
- {
- protected $sSubpageUrl;
- function __construct($sPage = '')
- {
- parent::__construct($sPage);
- $this->sSubpageUrl = BX_DOL_URL_STUDIO . 'builder_roles.php?page=';
- }
- function getPageCss()
- {
- return array_merge(parent::getPageCss(), array('forms.css', 'paginate.css', 'roles.css'));
- }
- function getPageJs()
- {
- return array_merge(parent::getPageJs(), array('roles.js'));
- }
- function getPageJsObject()
- {
- return 'oBxDolStudioRoles';
- }
- function getPageMenu($aMenu = array(), $aMarkers = array())
- {
- $sJsObject = $this->getPageJsObject();
- $aMenu = array();
- $aMenuItems = array(
- BX_DOL_STUDIO_RL_TYPE_LEVELS => array('icon' => 'sliders-h'),
- BX_DOL_STUDIO_RL_TYPE_ACTIONS => array('icon' => 'exchange-alt')
- );
- foreach($aMenuItems as $sMenuItem => $aItem)
- $aMenu[] = array(
- 'name' => $sMenuItem,
- 'icon' => $aItem['icon'],
- 'link' => $this->sSubpageUrl . $sMenuItem,
- 'title' => _t('_adm_lmi_cpt_' . $sMenuItem),
- 'selected' => $sMenuItem == $this->sPage
- );
- return parent::getPageMenu($aMenu);
- }
- function getPageCode()
- {
- $sResult = parent::getPageCode();
- if($sResult === false)
- return false;
- $sMethod = 'get' . ucfirst($this->sPage);
- if(!method_exists($this, $sMethod))
- return '';
- return $sResult . $this->$sMethod();
- }
- protected function getRlevels()
- {
- return $this->getGrid('sys_studio_roles');
- }
- protected function getRactions()
- {
- return $this->getGrid('sys_studio_roles_actions');
- }
- protected function getGrid($sObjectName)
- {
- $oGrid = BxDolGrid::getObjectInstance($sObjectName);
- if(!$oGrid)
- return '';
- return BxDolStudioTemplate::getInstance()->parseHtmlByName('roles.html', array(
- 'js_object' => $this->getPageJsObject(),
- 'content' => $this->getBlockCode(array(
- 'items' => $oGrid->getCode()
- ))
- ));
- }
- }
- /** @} */
|