event_controller.php 2.4 KB

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