1
0

BxBaseStudioRoles.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaView UNA Studio Representation classes
  7. * @ingroup UnaStudio
  8. * @{
  9. */
  10. class BxBaseStudioRoles extends BxDolStudioRoles
  11. {
  12. protected $sSubpageUrl;
  13. function __construct($sPage = '')
  14. {
  15. parent::__construct($sPage);
  16. $this->sSubpageUrl = BX_DOL_URL_STUDIO . 'builder_roles.php?page=';
  17. }
  18. function getPageCss()
  19. {
  20. return array_merge(parent::getPageCss(), array('forms.css', 'paginate.css', 'roles.css'));
  21. }
  22. function getPageJs()
  23. {
  24. return array_merge(parent::getPageJs(), array('roles.js'));
  25. }
  26. function getPageJsObject()
  27. {
  28. return 'oBxDolStudioRoles';
  29. }
  30. function getPageMenu($aMenu = array(), $aMarkers = array())
  31. {
  32. $sJsObject = $this->getPageJsObject();
  33. $aMenu = array();
  34. $aMenuItems = array(
  35. BX_DOL_STUDIO_RL_TYPE_LEVELS => array('icon' => 'sliders-h'),
  36. BX_DOL_STUDIO_RL_TYPE_ACTIONS => array('icon' => 'exchange-alt')
  37. );
  38. foreach($aMenuItems as $sMenuItem => $aItem)
  39. $aMenu[] = array(
  40. 'name' => $sMenuItem,
  41. 'icon' => $aItem['icon'],
  42. 'link' => $this->sSubpageUrl . $sMenuItem,
  43. 'title' => _t('_adm_lmi_cpt_' . $sMenuItem),
  44. 'selected' => $sMenuItem == $this->sPage
  45. );
  46. return parent::getPageMenu($aMenu);
  47. }
  48. protected function getRlevels()
  49. {
  50. return $this->getGrid('sys_studio_roles');
  51. }
  52. protected function getRactions()
  53. {
  54. return $this->getGrid('sys_studio_roles_actions');
  55. }
  56. protected function getGrid($sObjectName)
  57. {
  58. $oGrid = BxDolGrid::getObjectInstance($sObjectName);
  59. if(!$oGrid)
  60. return '';
  61. return BxDolStudioTemplate::getInstance()->parseHtmlByName('roles.html', array(
  62. 'js_object' => $this->getPageJsObject(),
  63. 'content' => $oGrid->getCode()
  64. ));
  65. }
  66. }
  67. /** @} */