index.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Template (front controller in MVC pattern) used for distpaching to the controllers depend on the current action
  5. * @author Christian Fasanando <christian1827@gmail.com>
  6. * @package chamilo.dashboard
  7. */
  8. /**
  9. * Init
  10. */
  11. // name of the language file that needs to be included
  12. $language_file = array ('index', 'tracking', 'userInfo', 'admin', 'gradebook');
  13. $cidReset = true;
  14. // including files
  15. require_once '../inc/global.inc.php';
  16. require_once 'dashboard_controller.php';
  17. require_once 'block.class.php';
  18. // protect script
  19. api_block_anonymous_users();
  20. // defining constants
  21. // current section
  22. $this_section = SECTION_DASHBOARD;
  23. unset($_SESSION['this_section']);//for hmtl editor repository
  24. // get actions
  25. $actions = array('listing', 'store_user_block', 'disable_block');
  26. $action = 'listing';
  27. if (isset($_GET['action']) && in_array($_GET['action'],$actions)) {
  28. $action = $_GET['action'];
  29. }
  30. // load styles from dashboard plugins
  31. $dashboar_plugin_styles = DashboardManager::get_links_for_styles_from_dashboard_plugins();
  32. $htmlHeadXtra[] = $dashboar_plugin_styles;
  33. // interbreadcrumb
  34. //$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('Dashboard'));
  35. // course description controller object
  36. $dashboard_controller = new DashboardController();
  37. if (isset($_GET['path'])) {
  38. $path = $_GET['path'];
  39. }
  40. // distpacher actions to controller
  41. switch ($action) {
  42. case 'listing':
  43. $dashboard_controller->display();
  44. break;
  45. case 'store_user_block':
  46. $dashboard_controller->store_user_block();
  47. break;
  48. case 'disable_block':
  49. $dashboard_controller->close_user_block($path);
  50. break;
  51. default :
  52. $dashboard_controller->display();
  53. }