BxDolStudioPermissions.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. protected $sPage;
  16. function __construct($sPage = "") {
  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. //--- Check actions ---//
  23. if(($sAction = bx_get('pgt_action')) !== false) {
  24. $sAction = bx_process_input($sAction);
  25. $aResult = array('code' => 1, 'message' => _t('_adm_pgt_err_cannot_process_action'));
  26. switch($sAction) {
  27. case 'get-page-by-type':
  28. $sValue = bx_process_input(bx_get('pgt_value'));
  29. if(empty($sValue))
  30. break;
  31. $this->sPage = $sValue;
  32. $aResult = array('code' => 0, 'content' => $this->getPageCode());
  33. break;
  34. }
  35. $oJson = new Services_JSON();
  36. echo $oJson->encode($aResult);
  37. exit;
  38. }
  39. }
  40. }
  41. /** @} */