index.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. $cidReset = true;
  9. // including files
  10. require_once '../inc/global.inc.php';
  11. require_once 'dashboard_controller.php';
  12. require_once 'block.class.php';
  13. // protect script
  14. api_block_anonymous_users();
  15. // defining constants
  16. // current section
  17. $this_section = SECTION_DASHBOARD;
  18. unset($_SESSION['this_section']);//for hmtl editor repository
  19. // get actions
  20. $actions = array('listing', 'store_user_block', 'disable_block');
  21. $action = 'listing';
  22. if (isset($_GET['action']) && in_array($_GET['action'],$actions)) {
  23. $action = $_GET['action'];
  24. }
  25. // load styles from dashboard plugins
  26. $dashboar_plugin_styles = DashboardManager::get_links_for_styles_from_dashboard_plugins();
  27. $htmlHeadXtra[] = $dashboar_plugin_styles;
  28. // course description controller object
  29. $dashboard_controller = new DashboardController();
  30. if (isset($_GET['path'])) {
  31. $path = $_GET['path'];
  32. }
  33. // distpacher actions to controller
  34. switch ($action) {
  35. case 'listing':
  36. $dashboard_controller->display();
  37. break;
  38. case 'store_user_block':
  39. $dashboard_controller->store_user_block();
  40. break;
  41. case 'disable_block':
  42. $dashboard_controller->close_user_block($path);
  43. break;
  44. default :
  45. $dashboard_controller->display();
  46. }