You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.4 KiB
57 lines
1.4 KiB
|
16 years ago
|
<?php
|
||
|
|
/* For licensing terms, see /license.txt */
|
||
|
8 years ago
|
|
||
|
|
use ChamiloSession as Session;
|
||
|
|
|
||
|
16 years ago
|
/**
|
||
|
8 years ago
|
* Template (front controller in MVC pattern) used for distpaching to
|
||
|
|
* the controllers depend on the current action.
|
||
|
|
*
|
||
|
|
* @author Christian Fasanando <christian1827@gmail.com>
|
||
|
|
*/
|
||
|
16 years ago
|
$cidReset = true;
|
||
|
16 years ago
|
|
||
|
11 years ago
|
// including files
|
||
|
9 years ago
|
require_once __DIR__.'/../inc/global.inc.php';
|
||
|
16 years ago
|
require_once 'dashboard_controller.php';
|
||
|
|
require_once 'block.class.php';
|
||
|
|
|
||
|
|
// protect script
|
||
|
|
api_block_anonymous_users();
|
||
|
|
|
||
|
|
// current section
|
||
|
|
$this_section = SECTION_DASHBOARD;
|
||
|
8 years ago
|
Session::erase('this_section'); //for hmtl editor repository
|
||
|
16 years ago
|
|
||
|
|
// get actions
|
||
|
8 years ago
|
$actions = ['listing', 'store_user_block', 'disable_block'];
|
||
|
16 years ago
|
$action = 'listing';
|
||
|
9 years ago
|
if (isset($_GET['action']) && in_array($_GET['action'], $actions)) {
|
||
|
8 years ago
|
$action = $_GET['action'];
|
||
|
16 years ago
|
}
|
||
|
|
|
||
|
|
// load styles from dashboard plugins
|
||
|
8 years ago
|
$htmlHeadXtra[] = DashboardManager::getStyleSheet();
|
||
|
16 years ago
|
|
||
|
|
// course description controller object
|
||
|
8 years ago
|
$dashboardController = new DashboardController();
|
||
|
16 years ago
|
|
||
|
|
if (isset($_GET['path'])) {
|
||
|
8 years ago
|
$path = $_GET['path'];
|
||
|
16 years ago
|
}
|
||
|
|
|
||
|
|
// distpacher actions to controller
|
||
|
11 years ago
|
switch ($action) {
|
||
|
10 years ago
|
case 'listing':
|
||
|
8 years ago
|
$dashboardController->display();
|
||
|
10 years ago
|
break;
|
||
|
|
case 'store_user_block':
|
||
|
8 years ago
|
$dashboardController->store_user_block();
|
||
|
10 years ago
|
break;
|
||
|
|
case 'disable_block':
|
||
|
8 years ago
|
$dashboardController->close_user_block($path);
|
||
|
10 years ago
|
break;
|
||
|
10 years ago
|
default:
|
||
|
8 years ago
|
$dashboardController->display();
|
||
|
13 years ago
|
}
|