BxDolStudioPermissions.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup DolphinStudio Dolphin Studio
  7. * @{
  8. */
  9. bx_import('BxTemplStudioPage');
  10. bx_import('BxDolStudioPermissionsQuery');
  11. define('BX_DOL_STUDIO_PRM_TYPE_LEVELS', 'levels');
  12. define('BX_DOL_STUDIO_PRM_TYPE_ACTIONS', 'actions');
  13. define('BX_DOL_STUDIO_PRM_TYPE_DEFAULT', BX_DOL_STUDIO_PRM_TYPE_LEVELS);
  14. class BxDolStudioPermissions extends BxTemplStudioPage
  15. {
  16. protected $sPage;
  17. function __construct($sPage = "")
  18. {
  19. parent::__construct('builder_permissions');
  20. $this->oDb = new BxDolStudioPermissionsQuery();
  21. $this->sPage = BX_DOL_STUDIO_PRM_TYPE_DEFAULT;
  22. if(is_string($sPage) && !empty($sPage))
  23. $this->sPage = $sPage;
  24. //--- Check actions ---//
  25. if(($sAction = bx_get('pgt_action')) !== false) {
  26. $sAction = bx_process_input($sAction);
  27. $aResult = array('code' => 1, 'message' => _t('_adm_pgt_err_cannot_process_action'));
  28. switch($sAction) {
  29. case 'get-page-by-type':
  30. $sValue = bx_process_input(bx_get('pgt_value'));
  31. if(empty($sValue))
  32. break;
  33. $this->sPage = $sValue;
  34. $aResult = array('code' => 0, 'content' => $this->getPageCode());
  35. break;
  36. }
  37. echo json_encode($aResult);
  38. exit;
  39. }
  40. }
  41. }
  42. /** @} */