event_controller.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use Chamilo\CoreBundle\Framework\Container;
  4. /**
  5. * Global events controller class
  6. * @package chamilo.admin
  7. */
  8. $cidReset = true;
  9. if (api_get_setting('mail.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' => Container::getRouter()->generate('administration'), 'name' => get_lang('PlatformAdmin'));
  61. $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Events'));
  62. $tpl = new Template($tool_name);
  63. $tpl->assign('actions', $actions);
  64. $tpl->assign('message', $message);
  65. $tpl->assign('content', $content);
  66. $tpl->display_one_col_template();