event_controller.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Global events controller class.
  5. *
  6. * @deprecated to be removed in 2.x
  7. *
  8. * @package chamilo.admin
  9. */
  10. $cidReset = true;
  11. require_once __DIR__.'/../inc/global.inc.php';
  12. if (api_get_setting('activate_email_template') != 'true') {
  13. api_not_allowed();
  14. }
  15. $action = isset($_GET['action']) ? $_GET['action'] : null;
  16. $action_links = '';
  17. $tool_name = '';
  18. $message = '';
  19. switch ($action) {
  20. case 'show':
  21. break;
  22. case 'add':
  23. break;
  24. case 'new':
  25. break;
  26. case 'delete':
  27. $event_email_template = new EventEmailTemplate();
  28. $event_email_template->delete($_GET['id']);
  29. $content = $event_email_template->display();
  30. break;
  31. default:
  32. case 'listing':
  33. $event_email_template = new EventEmailTemplate();
  34. $content = $event_email_template->display();
  35. break;
  36. }
  37. //jqgrid will use this URL to do the selects
  38. $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_event_email_template';
  39. //The order is important you need to check the the $column variable in the model.ajax.php file
  40. $columns = [
  41. get_lang('Subject'),
  42. get_lang('EventTypeName'),
  43. get_lang('Language'),
  44. get_lang('Status'),
  45. get_lang('Actions'),
  46. ];
  47. //Column config
  48. $column_model = [
  49. ['name' => 'subject', 'index' => 'subject', 'width' => '80', 'align' => 'left'],
  50. // array('name'=>'message', 'index'=>'message', 'width'=>'500', 'align'=>'left','sortable'=>'false'),
  51. ['name' => 'event_type_name', 'index' => 'event_type_name', 'width' => '80', 'align' => 'left'],
  52. ['name' => 'language_id', 'index' => 'language_id', 'width' => '80', 'align' => 'left'],
  53. ['name' => 'activated', 'index' => 'activated', 'width' => '80', 'align' => 'left'],
  54. ['name' => 'actions', 'index' => 'actions', 'width' => '100'],
  55. ];
  56. //Autowidth
  57. $extra_params['autowidth'] = 'true';
  58. //height auto
  59. $extra_params['height'] = 'auto';
  60. $htmlHeadXtra[] = api_get_jqgrid_js();
  61. $htmlHeadXtra[] = '<script>
  62. $(function() {
  63. '.Display::grid_js('event_email_template', $url, $columns, $column_model, $extra_params, [], $action_links, true).'
  64. });
  65. </script>';
  66. $interbreadcrumb[] = ['url' => 'index.php', 'name' => get_lang('PlatformAdmin')];
  67. $interbreadcrumb[] = ['url' => '#', 'name' => get_lang('Events')];
  68. $tpl = new Template($tool_name);
  69. $tpl->assign('message', $message);
  70. $tpl->assign('content', $content);
  71. $tpl->display_one_col_template();