BxDolStudioPermissions.php 1.6 KB

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