Fix PHP warnings, format code.

1.10.x
Julio Montoya 11 years ago
parent bf4e9d3888
commit 5920b0b59e
  1. 1
      main/admin/resume_session.php
  2. 4
      main/blog/blog_admin.php
  3. 1
      main/exercice/exercise.class.php
  4. 1
      main/gradebook/gradebook_edit_all.php
  5. 3
      main/gradebook/lib/user_data_generator.class.php
  6. 7
      main/inc/lib/api.lib.php
  7. 15
      main/notebook/index.php

@ -307,7 +307,6 @@ if ($session['nbr_courses'] == 0) {
foreach ($courses as $course) {
//select the number of users
$sql = "SELECT count(*)
FROM $tbl_session_rel_user sru,
$tbl_session_rel_course_rel_user srcru

@ -39,10 +39,6 @@ if (api_is_allowed_to_edit()) {
$current_section=get_lang('EditBlog');
$my_url='action=edit&blog_id='.Security::remove_XSS($_GET['blog_id']);
}
/*$interbreadcrumb[] = array(
'url' => 'blog_admin.php?' . $my_url,
'name' => $current_section
);*/
Display::display_header('');
}
echo '<div class="actions">';

@ -2543,7 +2543,6 @@ class Exercise
$choice[$j] = api_htmlentities(trim($choice[$j]));
}
$user_tags[] = $choice[$j];
//put the contents of the [] answer tag into correct_tags[]
$correct_tags[] = api_substr($temp, 0, $pos);

@ -7,7 +7,6 @@
* @author Julio Montoya - fixes in order to use gradebook models + some code cleaning
*/
$language_file= 'gradebook';
$cidReset = true;
require_once '../inc/global.inc.php';
$this_section = SECTION_COURSES;

@ -34,11 +34,12 @@ class UserDataGenerator
{
$this->userid = $userid;
$evals_filtered = array();
$result = array();
foreach ($evals as $eval) {
$toadd = true;
$coursecode = $eval->get_course_code();
if (isset($coursecode)) {
$result = Result :: load (null, $userid, $eval->get_id());
$result = Result :: load(null, $userid, $eval->get_id());
if (count($result) == 0) {
$toadd = false;
}

@ -3159,9 +3159,10 @@ function api_is_allowed_to_session_edit($tutor = false, $coach = false)
* @author Julio Montoya
* @version 1.0
*/
function api_is_allowed($tool, $action, $task_id = 0) {
global $_course;
global $_user;
function api_is_allowed($tool, $action, $task_id = 0)
{
$_user = api_get_user_info();
$_course = api_get_course_info();
if (api_is_course_admin()) {
return true;

@ -99,10 +99,8 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
$form->setConstants(array('sec_token' => $token));
$form->display();
}
}
// Action handling: Editing a note
elseif (isset($_GET['action']) && $_GET['action'] == 'editnote' && is_numeric($_GET['notebook_id'])) {
} elseif (isset($_GET['action']) && $_GET['action'] == 'editnote' && is_numeric($_GET['notebook_id'])) {
// Action handling: Editing a note
if (!empty($_GET['isStudentView'])) {
NotebookManager::display_notes();
@ -162,11 +160,12 @@ elseif (isset($_GET['action']) && $_GET['action'] == 'deletenote' && is_numeric(
}
NotebookManager::display_notes();
}
// Action handling: changing the view (sorting order)
elseif ($_GET['action'] == 'changeview' AND in_array($_GET['view'], array('creation_date', 'update_date', 'title'))) {
} elseif (
isset($_GET['action']) && $_GET['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'] OR $_GET['direction'] == 'ASC') {

Loading…
Cancel
Save