diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php index 1a672f5d98..b82a19f05d 100644 --- a/main/inc/lib/api.lib.php +++ b/main/inc/lib/api.lib.php @@ -8221,6 +8221,9 @@ function api_protect_limit_for_session_admin() } } +/** + * @return bool + */ function api_is_student_view_active() { $studentView = Session::read('studentview'); diff --git a/main/notebook/index.php b/main/notebook/index.php index 8103831139..56513fb616 100755 --- a/main/notebook/index.php +++ b/main/notebook/index.php @@ -1,5 +1,8 @@ <?php /* For licensing terms, see /license.txt */ + +use ChamiloSession as Session; + /** * @package chamilo.notebook * @author Christian Fasanando, initial version @@ -38,12 +41,18 @@ $action = isset($_GET['action']) ? $_GET['action'] : ''; // Tool name if ($action === 'addnote') { - $tool = 'NoteAddNew'; - $interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq(), 'name' => get_lang('ToolNotebook')); + $tool = 'NoteAddNew'; + $interbreadcrumb[] = array( + 'url' => 'index.php?'.api_get_cidreq(), + 'name' => get_lang('ToolNotebook') + ); } if ($action === 'editnote') { - $tool = 'ModifyNote'; - $interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq(), 'name' => get_lang('ToolNotebook')); + $tool = 'ModifyNote'; + $interbreadcrumb[] = array( + 'url' => 'index.php?'.api_get_cidreq(), + 'name' => get_lang('ToolNotebook') + ); } // Displaying the header @@ -63,7 +72,7 @@ if ($action === 'addnote') { exit; } - $_SESSION['notebook_view'] = 'creation_date'; + Session::write('notebook_view', 'creation_date'); $form = new FormValidator( 'note', @@ -99,7 +108,14 @@ if ($action === 'addnote') { NotebookManager::display_notes(); } else { echo '<div class="actions">'; - echo '<a href="index.php">'.Display::return_icon('back.png', get_lang('BackToNotesList'), '', ICON_SIZE_MEDIUM).'</a>'; + echo '<a href="index.php">'. + Display::return_icon( + 'back.png', + get_lang('BackToNotesList'), + '', + ICON_SIZE_MEDIUM + ). + '</a>'; echo '</div>'; $token = Security::get_token(); $form->addElement('hidden', 'sec_token'); @@ -124,7 +140,12 @@ if ($action === 'addnote') { $form->addElement('header', '', get_lang('ModifyNote')); $form->addElement('hidden', 'notebook_id'); $form->addElement('text', 'note_title', get_lang('NoteTitle'), array('size' => '100')); - $form->addElement('html_editor', 'note_comment', get_lang('NoteComment'), null, api_is_allowed_to_edit() + $form->addElement( + 'html_editor', + 'note_comment', + get_lang('NoteComment'), + null, + api_is_allowed_to_edit() ? array('ToolbarSet' => 'Notebook', 'Width' => '100%', 'Height' => '300') : array('ToolbarSet' => 'NotebookStudent', 'Width' => '100%', 'Height' => '300', 'UserStatus' => 'student') ); @@ -153,7 +174,13 @@ if ($action === 'addnote') { } else { echo '<div class="actions">'; echo '<a href="index.php">'. - Display::return_icon('back.png', get_lang('BackToNotesList'), '', ICON_SIZE_MEDIUM).'</a>'; + Display::return_icon( + 'back.png', + get_lang('BackToNotesList'), + '', + ICON_SIZE_MEDIUM + ). + '</a>'; echo '</div>'; $token = Security::get_token(); $form->addElement('hidden', 'sec_token'); @@ -168,34 +195,52 @@ if ($action === 'addnote') { } NotebookManager::display_notes(); -} elseif ( - $action === 'changeview' && in_array($_GET['view'], array('creation_date', 'update_date', 'title'))) { - +} elseif ($action === 'changeview' && + in_array($_GET['view'], array('creation_date', 'update_date', 'title')) +) { // Action handling: changing the view (sorting order) switch ($_GET['view']) { case 'creation_date': if (!$_GET['direction'] || $_GET['direction'] == 'ASC') { - echo Display::return_message(get_lang('NotesSortedByCreationDateAsc'), 'confirmation'); + echo Display::return_message( + get_lang('NotesSortedByCreationDateAsc'), + 'confirmation' + ); } else { - echo Display::return_message(get_lang('NotesSortedByCreationDateDESC'), 'confirmation'); + echo Display::return_message( + get_lang('NotesSortedByCreationDateDESC'), + 'confirmation' + ); } break; case 'update_date': if (!$_GET['direction'] || $_GET['direction'] == 'ASC') { - echo Display::return_message(get_lang('NotesSortedByUpdateDateAsc'), 'confirmation'); + echo Display::return_message( + get_lang('NotesSortedByUpdateDateAsc'), + 'confirmation' + ); } else { - echo Display::return_message(get_lang('NotesSortedByUpdateDateDESC'), 'confirmation'); + echo Display::return_message( + get_lang('NotesSortedByUpdateDateDESC'), + 'confirmation' + ); } break; case 'title': if (!$_GET['direction'] || $_GET['direction'] == 'ASC') { - echo Display::return_message(get_lang('NotesSortedByTitleAsc'), 'confirmation'); + echo Display::return_message( + get_lang('NotesSortedByTitleAsc'), + 'confirmation' + ); } else { - echo Display::return_message(get_lang('NotesSortedByTitleDESC'), 'confirmation'); + echo Display::return_message( + get_lang('NotesSortedByTitleDESC'), + 'confirmation' + ); } break; } - $_SESSION['notebook_view'] = $_GET['view']; + Session::write('notebook_view', $_GET['view']); NotebookManager::display_notes(); } else { NotebookManager::display_notes(); diff --git a/plugin/dashboard/block_evaluation_graph/block_evaluation_graph.class.php b/plugin/dashboard/block_evaluation_graph/block_evaluation_graph.class.php index 64af16a700..5a97cf13ee 100755 --- a/plugin/dashboard/block_evaluation_graph/block_evaluation_graph.class.php +++ b/plugin/dashboard/block_evaluation_graph/block_evaluation_graph.class.php @@ -140,7 +140,7 @@ class BlockEvaluationGraph extends Block $alllinks = $cats[0]->get_links(null, true); $users = GradebookUtils::get_all_users($alleval, $alllinks); $datagen = new FlatViewDataGenerator($users, $alleval, $alllinks); - $evaluation_sumary = $datagen->get_evaluation_sumary_results(); + $evaluation_sumary = $datagen->getEvaluationSummaryResults(); if (!empty($evaluation_sumary)) { $items = array_keys($evaluation_sumary); $max = $min = $avg = array(); @@ -318,7 +318,7 @@ class BlockEvaluationGraph extends Block $alllinks = $cats[0]->get_links(null, true); $users = GradebookUtils::get_all_users($alleval, $alllinks); $datagen = new FlatViewDataGenerator($users, $alleval, $alllinks); - $evaluation_sumary = $datagen->get_evaluation_sumary_results(); + $evaluation_sumary = $datagen->getEvaluationSummaryResults(); if (!empty($evaluation_sumary)) { $items = array_keys($evaluation_sumary); $max = $min = $avg = array();