BxDolStudioPermissions.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 UnaStudio UNA Studio
  7. * @{
  8. */
  9. define('BX_DOL_STUDIO_PRM_TYPE_LEVELS', 'levels');
  10. define('BX_DOL_STUDIO_PRM_TYPE_ACTIONS', 'actions');
  11. define('BX_DOL_STUDIO_PRM_TYPE_DEFAULT', BX_DOL_STUDIO_PRM_TYPE_LEVELS);
  12. class BxDolStudioPermissions extends BxTemplStudioPage
  13. {
  14. protected $sPage;
  15. function __construct($sPage = "")
  16. {
  17. parent::__construct('builder_permissions');
  18. $this->oDb = new BxDolStudioPermissionsQuery();
  19. $this->sPage = BX_DOL_STUDIO_PRM_TYPE_DEFAULT;
  20. if(is_string($sPage) && !empty($sPage))
  21. $this->sPage = $sPage;
  22. }
  23. public function init()
  24. {
  25. if(($sAction = bx_get('pgt_action')) === false)
  26. return;
  27. $sAction = bx_process_input($sAction);
  28. $aResult = array('code' => 1, 'message' => _t('_adm_pgt_err_cannot_process_action'));
  29. switch($sAction) {
  30. case 'get-page-by-type':
  31. $sValue = bx_process_input(bx_get('pgt_value'));
  32. if(empty($sValue))
  33. break;
  34. $this->sPage = $sValue;
  35. $aResult = array('code' => 0, 'content' => $this->getPageCode());
  36. break;
  37. }
  38. echo json_encode($aResult);
  39. exit;
  40. }
  41. }
  42. /** @} */