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) { foreach ($courses as $course) {
//select the number of users //select the number of users
$sql = "SELECT count(*) $sql = "SELECT count(*)
FROM $tbl_session_rel_user sru, FROM $tbl_session_rel_user sru,
$tbl_session_rel_course_rel_user srcru $tbl_session_rel_course_rel_user srcru

@ -39,10 +39,6 @@ if (api_is_allowed_to_edit()) {
$current_section=get_lang('EditBlog'); $current_section=get_lang('EditBlog');
$my_url='action=edit&blog_id='.Security::remove_XSS($_GET['blog_id']); $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(''); Display::display_header('');
} }
echo '<div class="actions">'; echo '<div class="actions">';

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

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

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

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

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

Loading…
Cancel
Save