index.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. // name of the language file that needs to be included
  9. $language_file = array('index', 'tracking', 'userInfo', 'admin', 'gradebook');
  10. $cidReset = true;
  11. // including files
  12. require_once '../inc/global.inc.php';
  13. require_once api_get_path(LIBRARY_PATH).'dashboard.lib.php';
  14. require_once api_get_path(LIBRARY_PATH).'app_view.php';
  15. require_once 'dashboard_controller.php';
  16. require_once 'block.class.php';
  17. // protect script
  18. api_block_anonymous_users();
  19. // defining constants
  20. // current section
  21. $this_section = SECTION_DASHBOARD;
  22. unset($_SESSION['this_section']);//for hmtl editor repository
  23. // get actions
  24. $actions = array('listing', 'store_user_block', 'disable_block');
  25. $action = 'listing';
  26. if (isset($_GET['action']) && in_array($_GET['action'],$actions)) {
  27. $action = $_GET['action'];
  28. }
  29. // load styles from dashboard plugins
  30. $dashboar_plugin_styles = DashboardManager::get_links_for_styles_from_dashboard_plugins();
  31. $htmlHeadXtra[] = $dashboar_plugin_styles;
  32. // interbreadcrumb
  33. //$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('Dashboard'));
  34. // course description controller object
  35. $dashboard_controller = new DashboardController();
  36. if (isset($_GET['path'])) {
  37. $path = $_GET['path'];
  38. }
  39. // distpacher actions to controller
  40. switch ($action) {
  41. case 'listing':
  42. $dashboard_controller->display();
  43. break;
  44. case 'store_user_block':
  45. $dashboard_controller->store_user_block();
  46. break;
  47. case 'disable_block':
  48. $dashboard_controller->close_user_block($path);
  49. break;
  50. default :
  51. $dashboard_controller->display();
  52. }