Minor - format code

- Replaced 'Security :: remove_XSS' to 'Security::remove_XSS'
- Replaced 'unset ()' to 'unset()'
remotes/angel/1.11.x
jmontoyaa 8 years ago
parent cf80a30457
commit 8d17f5dbcc
  1. 4
      main/document/create_audio.php
  2. 4
      main/document/create_draw.php
  3. 4
      main/document/create_paint.php
  4. 4
      main/document/record_audio.php
  5. 4
      main/document/webcam_clip.php
  6. 2
      main/exercise/exercise.class.php
  7. 2
      main/exercise/exercise_report.php
  8. 6
      main/exercise/exercise_submit.php
  9. 2
      main/exercise/overview.php
  10. 16
      main/gradebook/gradebook.php
  11. 12
      main/gradebook/index.php
  12. 9
      main/inc/lib/api.lib.php
  13. 4
      main/inc/lib/link.lib.php
  14. 12
      main/lp/learnpath.class.php
  15. 14
      main/mySpace/myStudents.php

@ -119,8 +119,8 @@ Event::event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir; $display_dir = $dir;
if (isset ($group)) { if (isset ($group)) {
$display_dir = explode('/', $dir); $display_dir = explode('/', $dir);
unset ($display_dir[0]); unset($display_dir[0]);
unset ($display_dir[1]); unset($display_dir[1]);
$display_dir = implode('/', $display_dir); $display_dir = implode('/', $display_dir);
} }

@ -109,8 +109,8 @@ Event::event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir; $display_dir = $dir;
if (isset ($group)) { if (isset ($group)) {
$display_dir = explode('/', $dir); $display_dir = explode('/', $dir);
unset ($display_dir[0]); unset($display_dir[0]);
unset ($display_dir[1]); unset($display_dir[1]);
$display_dir = implode('/', $display_dir); $display_dir = implode('/', $display_dir);
} }

@ -109,8 +109,8 @@ Event::event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir; $display_dir = $dir;
if (isset ($group)) { if (isset ($group)) {
$display_dir = explode('/', $dir); $display_dir = explode('/', $dir);
unset ($display_dir[0]); unset($display_dir[0]);
unset ($display_dir[1]); unset($display_dir[1]);
$display_dir = implode('/', $display_dir); $display_dir = implode('/', $display_dir);
} }

@ -111,8 +111,8 @@ Event::event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir; $display_dir = $dir;
if (isset ($group)) { if (isset ($group)) {
$display_dir = explode('/', $dir); $display_dir = explode('/', $dir);
unset ($display_dir[0]); unset($display_dir[0]);
unset ($display_dir[1]); unset($display_dir[1]);
$display_dir = implode('/', $display_dir); $display_dir = implode('/', $display_dir);
} }

@ -97,8 +97,8 @@ Event::event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir; $display_dir = $dir;
if (isset ($group)) { if (isset ($group)) {
$display_dir = explode('/', $dir); $display_dir = explode('/', $dir);
unset ($display_dir[0]); unset($display_dir[0]);
unset ($display_dir[1]); unset($display_dir[1]);
$display_dir = implode('/', $display_dir); $display_dir = implode('/', $display_dir);
} }

@ -5106,7 +5106,7 @@ class Exercise
} }
// } // }
} }
unset ($objAnswerTmp); unset($objAnswerTmp);
$totalWeighting += $questionWeighting; $totalWeighting += $questionWeighting;
// Store results directly in the database // Store results directly in the database

@ -241,7 +241,7 @@ if (isset($_REQUEST['comments']) &&
Database::query($sql); Database::query($sql);
if ($origin == 'tracking_course') { if ($origin == 'tracking_course') {
//Redirect to the course detail in lp //Redirect to the course detail in lp
header('location: '.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?course='.Security :: remove_XSS($_GET['course'])); header('location: '.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?course='.Security::remove_XSS($_GET['course']));
exit; exit;
} else { } else {
// Redirect to the reporting // Redirect to the reporting

@ -719,10 +719,10 @@ if ($question_count != 0) {
} }
if (!empty ($_GET['gradebook']) && $_GET['gradebook'] == 'view') { if (!empty ($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
$_SESSION['gradebook'] = Security :: remove_XSS($_GET['gradebook']); $_SESSION['gradebook'] = Security::remove_XSS($_GET['gradebook']);
$gradebook = $_SESSION['gradebook']; $gradebook = $_SESSION['gradebook'];
} elseif (empty ($_GET['gradebook'])) { } elseif (empty ($_GET['gradebook'])) {
unset ($_SESSION['gradebook']); unset($_SESSION['gradebook']);
$gradebook = ''; $gradebook = '';
} }
@ -1201,7 +1201,7 @@ if (!empty($error)) {
$objQuestionTmp = Question::read($questionId); $objQuestionTmp = Question::read($questionId);
$questionName = $objQuestionTmp->selectTitle(); $questionName = $objQuestionTmp->selectTitle();
// destruction of the Question object // destruction of the Question object
unset ($objQuestionTmp); unset($objQuestionTmp);
Display :: display_normal_message(get_lang('AlreadyAnswered')); Display :: display_normal_message(get_lang('AlreadyAnswered'));
$i++; $i++;
break; break;

@ -30,7 +30,7 @@ if (!$result) {
api_not_allowed(true); api_not_allowed(true);
} }
$gradebook = isset($_GET['gradebook']) ? Security :: remove_XSS($_GET['gradebook']) : null; $gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null;
$learnpath_id = isset($_REQUEST['learnpath_id']) ? intval($_REQUEST['learnpath_id']) : null; $learnpath_id = isset($_REQUEST['learnpath_id']) ? intval($_REQUEST['learnpath_id']) : null;
$learnpath_item_id = isset($_REQUEST['learnpath_item_id']) ? intval($_REQUEST['learnpath_item_id']) : null; $learnpath_item_id = isset($_REQUEST['learnpath_item_id']) ? intval($_REQUEST['learnpath_item_id']) : null;
$learnpathItemViewId = isset($_REQUEST['learnpath_item_view_id']) ? intval($_REQUEST['learnpath_item_view_id']) : null; $learnpathItemViewId = isset($_REQUEST['learnpath_item_view_id']) ? intval($_REQUEST['learnpath_item_view_id']) : null;

@ -62,7 +62,7 @@ if (isset ($_GET['createallcategories'])) {
$cat->set_weight(0); $cat->set_weight(0);
$cat->set_visible(0); $cat->set_visible(0);
$cat->add(); $cat->add();
unset ($cat); unset($cat);
} }
} }
header('Location: '.$_SESSION['gradebook_dest'].'?addallcat=&selectcat=0'); header('Location: '.$_SESSION['gradebook_dest'].'?addallcat=&selectcat=0');
@ -133,9 +133,9 @@ if (isset ($_GET['moveeval'])) {
header('Location: ' . api_get_self() . '?evaluationmoved=&selectcat=' . $selectcat); header('Location: ' . api_get_self() . '?evaluationmoved=&selectcat=' . $selectcat);
exit; exit;
} }
unset ($targetcat); unset($targetcat);
} }
unset ($evals); unset($evals);
} }
//move a link //move a link
@ -154,7 +154,7 @@ if (isset ($_GET['movelink'])) {
if ($move_form->validate()) { if ($move_form->validate()) {
$targetcat= Category :: load($move_form->exportValue('move_cat')); $targetcat= Category :: load($move_form->exportValue('move_cat'));
$link[0]->move_to_cat($targetcat[0]); $link[0]->move_to_cat($targetcat[0]);
unset ($link); unset($link);
header('Location: ' . api_get_self(). '?linkmoved=&selectcat=' . $selectcat); header('Location: ' . api_get_self(). '?linkmoved=&selectcat=' . $selectcat);
exit; exit;
} }
@ -172,7 +172,7 @@ if (isset ($_GET['visiblecat'])) {
$cats[0]->set_visible($visibility_command); $cats[0]->set_visible($visibility_command);
$cats[0]->save(); $cats[0]->save();
$cats[0]->apply_visibility_to_children(); $cats[0]->apply_visibility_to_children();
unset ($cats); unset($cats);
if ($visibility_command) { if ($visibility_command) {
$confirmation_message = get_lang('ViMod'); $confirmation_message = get_lang('ViMod');
$filter_confirm_msg = false; $filter_confirm_msg = false;
@ -206,7 +206,7 @@ if (isset ($_GET['visibleeval'])) {
$eval= Evaluation :: load($_GET['visibleeval']); $eval= Evaluation :: load($_GET['visibleeval']);
$eval[0]->set_visible($visibility_command); $eval[0]->set_visible($visibility_command);
$eval[0]->save(); $eval[0]->save();
unset ($eval); unset($eval);
if ($visibility_command) { if ($visibility_command) {
$confirmation_message = get_lang('ViMod'); $confirmation_message = get_lang('ViMod');
$filter_confirm_msg = false; $filter_confirm_msg = false;
@ -235,7 +235,7 @@ if (isset ($_GET['visiblelink'])) {
$link= LinkFactory :: load($_GET['visiblelink']); $link= LinkFactory :: load($_GET['visiblelink']);
$link[0]->set_visible($visibility_command); $link[0]->set_visible($visibility_command);
$link[0]->save(); $link[0]->save();
unset ($link); unset($link);
if ($visibility_command) { if ($visibility_command) {
$confirmation_message = get_lang('ViMod'); $confirmation_message = get_lang('ViMod');
$filter_confirm_msg = false; $filter_confirm_msg = false;
@ -252,7 +252,7 @@ if (isset ($_GET['deletelink'])) {
if ($link[0] != null) { if ($link[0] != null) {
$link[0]->delete(); $link[0]->delete();
} }
unset ($link); unset($link);
$confirmation_message = get_lang('LinkDeleted'); $confirmation_message = get_lang('LinkDeleted');
$filter_confirm_msg = false; $filter_confirm_msg = false;
} }

@ -169,9 +169,9 @@ if (isset($_GET['movecat'])) {
header('Location: ' . api_get_self() . '?categorymoved=&selectcat=' . $selectCat); header('Location: ' . api_get_self() . '?categorymoved=&selectcat=' . $selectCat);
exit; exit;
} }
unset ($targetcat); unset($targetcat);
} }
unset ($cats); unset($cats);
} }
//move an evaluation //move an evaluation
@ -244,7 +244,7 @@ if (isset($_GET['visiblecat'])) {
$cats[0]->set_visible($visibility_command); $cats[0]->set_visible($visibility_command);
$cats[0]->save(); $cats[0]->save();
$cats[0]->apply_visibility_to_children(); $cats[0]->apply_visibility_to_children();
unset ($cats); unset($cats);
if ($visibility_command) { if ($visibility_command) {
$confirmation_message = get_lang('ViMod'); $confirmation_message = get_lang('ViMod');
$filter_confirm_msg = false; $filter_confirm_msg = false;
@ -280,7 +280,7 @@ if (isset($_GET['visibleeval'])) {
$eval= Evaluation :: load($_GET['visibleeval']); $eval= Evaluation :: load($_GET['visibleeval']);
$eval[0]->set_visible($visibility_command); $eval[0]->set_visible($visibility_command);
$eval[0]->save(); $eval[0]->save();
unset ($eval); unset($eval);
if ($visibility_command) { if ($visibility_command) {
$confirmation_message = get_lang('ViMod'); $confirmation_message = get_lang('ViMod');
$filter_confirm_msg = false; $filter_confirm_msg = false;
@ -332,7 +332,7 @@ if (isset($_GET['visiblelink'])) {
$link[0]->set_visible($visibility_command); $link[0]->set_visible($visibility_command);
$link[0]->save(); $link[0]->save();
} }
unset ($link); unset($link);
if ($visibility_command) { if ($visibility_command) {
$confirmation_message = get_lang('ViMod'); $confirmation_message = get_lang('ViMod');
$filter_confirm_msg = false; $filter_confirm_msg = false;
@ -372,7 +372,7 @@ if (isset($_GET['deletelink'])) {
Database::query($sql); Database::query($sql);
$link[0]->delete(); $link[0]->delete();
} }
unset ($link); unset($link);
$confirmation_message = get_lang('LinkDeleted'); $confirmation_message = get_lang('LinkDeleted');
$filter_confirm_msg = false; $filter_confirm_msg = false;
} }

@ -2816,10 +2816,11 @@ function api_is_session_in_category($session_id, $category_name)
* 'subTitle' * 'subTitle'
* @return void * @return void
*/ */
function api_display_tool_title($title_element) { function api_display_tool_title($title_element)
{
if (is_string($title_element)) { if (is_string($title_element)) {
$tit = $title_element; $tit = $title_element;
unset ($title_element); unset($title_element);
$title_element['mainTitle'] = $tit; $title_element['mainTitle'] = $tit;
} }
echo '<h3>'; echo '<h3>';
@ -3743,7 +3744,7 @@ function api_item_property_update(
$result = Database::query($sql); $result = Database::query($sql);
} }
break; break;
case 'visible' : // Change item to visible. case 'visible': // Change item to visible.
$visibility = '1'; $visibility = '1';
if (!empty($session_id)) { if (!empty($session_id)) {
// Check whether session id already exist into item_properties for updating visibility or add it. // Check whether session id already exist into item_properties for updating visibility or add it.
@ -3785,7 +3786,7 @@ function api_item_property_update(
$result = Database::query($sql); $result = Database::query($sql);
} }
break; break;
case 'invisible' : // Change item to invisible. case 'invisible': // Change item to invisible.
$visibility = '0'; $visibility = '0';
if (!empty($session_id)) { if (!empty($session_id)) {
// Check whether session id already exist into item_properties for updating visibility or add it // Check whether session id already exist into item_properties for updating visibility or add it

@ -1105,7 +1105,7 @@ class Link extends Model
$url = api_get_path(WEB_CODE_PATH).'link/link_goto.php?' . api_get_cidreq() .'&link_id=' . $linkId .'&link_url=' . urlencode($myrow['url']); $url = api_get_path(WEB_CODE_PATH).'link/link_goto.php?' . api_get_cidreq() .'&link_id=' . $linkId .'&link_url=' . urlencode($myrow['url']);
$content .= Display::tag( $content .= Display::tag(
'a', 'a',
Security:: remove_XSS($myrow['title']), Security::remove_XSS($myrow['title']),
array( array(
'href' => $url, 'href' => $url,
'target' => $myrow['target'] 'target' => $myrow['target']
@ -1126,7 +1126,7 @@ class Link extends Model
$url = api_get_path(WEB_CODE_PATH).'link/link_goto.php?' . api_get_cidreq() .'&link_id=' . $linkId . "&link_url=" . urlencode($myrow['url']); $url = api_get_path(WEB_CODE_PATH).'link/link_goto.php?' . api_get_cidreq() .'&link_id=' . $linkId . "&link_url=" . urlencode($myrow['url']);
$content .= Display::tag( $content .= Display::tag(
'a', 'a',
Security:: remove_XSS($myrow['title']), Security::remove_XSS($myrow['title']),
array( array(
'href' => $url, 'href' => $url,
'target' => '_blank', 'target' => '_blank',

@ -3227,7 +3227,7 @@ class learnpath
if ($is_allowed_to_edit && $hide_teacher_icons_lp == false) { if ($is_allowed_to_edit && $hide_teacher_icons_lp == false) {
$gradebook = ''; $gradebook = '';
if (!empty($_GET['gradebook'])) { if (!empty($_GET['gradebook'])) {
$gradebook = Security:: remove_XSS($_GET['gradebook']); $gradebook = Security::remove_XSS($_GET['gradebook']);
} }
if ($this->get_lp_session_id() == api_get_session_id()) { if ($this->get_lp_session_id() == api_get_session_id()) {
$html .= '<div id="actions_lp" class="actions_lp"><hr>'; $html .= '<div id="actions_lp" class="actions_lp"><hr>';
@ -5545,7 +5545,7 @@ class learnpath
$this->tree_array($arrLP); $this->tree_array($arrLP);
$arrLP = isset($this->arrMenu) ? $this->arrMenu : null; $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
unset ($this->arrMenu); unset($this->arrMenu);
$default_data = null; $default_data = null;
$default_content = null; $default_content = null;
$elements = array(); $elements = array();
@ -6722,7 +6722,7 @@ class learnpath
$this->tree_array($arrLP); $this->tree_array($arrLP);
$arrLP = isset($this->arrMenu) ? $this->arrMenu : null; $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
unset ($this->arrMenu); unset($this->arrMenu);
$form = new FormValidator( $form = new FormValidator(
'quiz_form', 'quiz_form',
@ -7343,7 +7343,7 @@ class learnpath
$this->tree_array($arrLP); $this->tree_array($arrLP);
$arrLP = isset($this->arrMenu) ? $this->arrMenu : null; $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
unset ($this->arrMenu); unset($this->arrMenu);
$form = new FormValidator( $form = new FormValidator(
'thread_form', 'thread_form',
@ -7820,7 +7820,7 @@ class learnpath
$this->tree_array($arrLP); $this->tree_array($arrLP);
$arrLP = isset($this->arrMenu) ? $this->arrMenu : null; $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
unset ($this->arrMenu); unset($this->arrMenu);
if ($action == 'add') { if ($action == 'add') {
$return .= get_lang('CreateTheDocument'); $return .= get_lang('CreateTheDocument');
@ -8181,7 +8181,7 @@ class learnpath
$this->tree_array($arrLP); $this->tree_array($arrLP);
$arrLP = isset($this->arrMenu) ? $this->arrMenu : null; $arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
unset ($this->arrMenu); unset($this->arrMenu);
if ($action == 'add') { if ($action == 'add') {
$legend = get_lang('CreateTheLink'); $legend = get_lang('CreateTheLink');

@ -14,7 +14,7 @@ api_block_anonymous_users();
$export = isset($_GET['export']) ? $_GET['export'] : false; $export = isset($_GET['export']) ? $_GET['export'] : false;
$sessionId = isset($_GET['id_session']) ? intval($_GET['id_session']) : 0; $sessionId = isset($_GET['id_session']) ? intval($_GET['id_session']) : 0;
$origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : ''; $origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '';
$course_code = isset($_GET['course']) ? Security :: remove_XSS($_GET['course']) : ''; $course_code = isset($_GET['course']) ? Security::remove_XSS($_GET['course']) : '';
$courseInfo = api_get_course_info($course_code); $courseInfo = api_get_course_info($course_code);
$student_id = intval($_GET['student']); $student_id = intval($_GET['student']);
@ -121,11 +121,11 @@ if (isset($_GET['details'])) {
); );
if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) { if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
$interbreadcrumb[] = array ( $interbreadcrumb[] = array (
"url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']), "url" => "student.php?id_coach=" . Security::remove_XSS($_GET['id_coach']),
"name" => get_lang("CoachStudents") "name" => get_lang("CoachStudents")
); );
$interbreadcrumb[] = array ( $interbreadcrumb[] = array (
"url" => "myStudents.php?student=" . $student_id. '&id_coach=' . Security :: remove_XSS($_GET['id_coach']), "url" => "myStudents.php?student=" . $student_id. '&id_coach=' . Security::remove_XSS($_GET['id_coach']),
"name" => get_lang("StudentDetails") "name" => get_lang("StudentDetails")
); );
} else { } else {
@ -162,12 +162,12 @@ if (isset($_GET['details'])) {
if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) { if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
if ($sessionId) { if ($sessionId) {
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
"url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']) . "&id_session=" . $sessionId, "url" => "student.php?id_coach=" . Security::remove_XSS($_GET['id_coach']) . "&id_session=" . $sessionId,
"name" => get_lang("CoachStudents") "name" => get_lang("CoachStudents")
); );
} else { } else {
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
"url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']), "url" => "student.php?id_coach=" . Security::remove_XSS($_GET['id_coach']),
"name" => get_lang("CoachStudents") "name" => get_lang("CoachStudents")
); );
} }
@ -360,10 +360,10 @@ if (!empty($student_id)) {
echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'. echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="' . api_get_self() . '?' . Security :: remove_XSS($_SERVER['QUERY_STRING']) . '&export=csv">'. echo '<a href="' . api_get_self() . '?' . Security::remove_XSS($_SERVER['QUERY_STRING']) . '&export=csv">'.
Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'',ICON_SIZE_MEDIUM).'</a> '; Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'',ICON_SIZE_MEDIUM).'</a> ';
echo '<a href="' . api_get_self() . '?' . Security :: remove_XSS($_SERVER['QUERY_STRING']) . '&export=xls">'. echo '<a href="' . api_get_self() . '?' . Security::remove_XSS($_SERVER['QUERY_STRING']) . '&export=xls">'.
Display::return_icon('export_excel.png', get_lang('ExportAsXLS'),'',ICON_SIZE_MEDIUM).'</a> '; Display::return_icon('export_excel.png', get_lang('ExportAsXLS'),'',ICON_SIZE_MEDIUM).'</a> ';
if (!empty ($user_info['email'])) { if (!empty ($user_info['email'])) {

Loading…
Cancel
Save