BxEventsModule.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 Events Events
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Groups profiles module.
  13. */
  14. class BxEventsModule extends BxBaseModGroupsModule
  15. {
  16. function __construct(&$aModule)
  17. {
  18. parent::__construct($aModule);
  19. }
  20. public function actionIntervals()
  21. {
  22. $sAction = bx_get('a');
  23. $sMethodName = 'subaction' . ucfirst($sAction);
  24. if (!method_exists($this, $sMethodName)) {
  25. $this->_oTemplate->pageNotFound();
  26. return;
  27. }
  28. $this->$sMethodName();
  29. }
  30. public function subactionRestore()
  31. {
  32. // TODO: check permissions
  33. $iContentId = (int)bx_get('c');
  34. $a = $this->_oDb->getIntervals($iContentId);
  35. foreach ($a as $iIntervalId => $r) {
  36. $a[$iIntervalId]['file_id'] = $r['interval_id'];
  37. $a[$iIntervalId]['repeat_stop'] = bx_process_output ($r['repeat_stop'], BX_DATA_DATE_TS);
  38. }
  39. if ('json' == bx_get('f')) {
  40. header('Content-type: text/html; charset=utf-8');
  41. echo json_encode($a);
  42. }
  43. }
  44. public function subactionDelete()
  45. {
  46. // TODO: check permissions
  47. }
  48. }
  49. /** @} */