Feature #1744 - Cleaning logical conditions (4).

skala
Ivan Tcholakov 15 years ago
parent c7b44cc1e9
commit dfcfaf5d8d
  1. 2
      index.php
  2. 2
      main/install/install.lib.php
  3. 8
      main/install/update-db-scorm-1.6.x-1.8.0.inc.php
  4. 2
      main/link/linkfunctions.php
  5. 6
      main/metadata/phpdig/search_function.php
  6. 24
      main/mySpace/myspace.lib.php
  7. 2
      main/newscorm/aicc.class.php
  8. 4
      main/newscorm/aicc_api.php
  9. 22
      main/newscorm/js/api_wrapper.js
  10. 8
      main/newscorm/learnpath.class.php
  11. 10
      main/newscorm/learnpathItem.class.php
  12. 2
      main/newscorm/lp_add_item.php
  13. 6
      main/newscorm/lp_controller.php
  14. 2
      main/newscorm/lp_header.php
  15. 2
      main/newscorm/lp_upload.php
  16. 2
      main/newscorm/lp_view.php
  17. 2
      main/newscorm/resourcelinker.inc.php
  18. 13
      main/newscorm/scorm_api.php
  19. 2
      main/notebook/index.php
  20. 2
      main/online/online_message.php
  21. 4
      main/permissions/permissions_functions.inc.php
  22. 2
      main/reservation/m_item.php
  23. 2
      main/reservation/m_item_origineel.php
  24. 2
      main/social/profile.php
  25. 2
      main/survey/create_new_survey.php
  26. 2
      main/upload/index.php
  27. 2
      main/user/userInfoLib.php
  28. 2
      main/webservices/registration.soap.php
  29. 4
      main/webservices/webservice_course.php
  30. 4
      main/webservices/webservice_session.php
  31. 4
      main/webservices/webservice_user.php
  32. 2
      main/wiki/diff.inc.php
  33. 8
      main/wiki/index.php
  34. 8
      main/wiki/wiki.inc.php
  35. 16
      main/work/work.lib.php
  36. 6
      main/work/work.php
  37. 2
      tests/simpletest/unit_tester.php
  38. 2
      user.php
  39. 2
      user_portal.php

@ -707,7 +707,7 @@ function display_anonymous_course_list() {
foreach ($course_list as $course) { foreach ($course_list as $course) {
// $setting_show_also_closed_courses // $setting_show_also_closed_courses
if ($setting_show_also_closed_courses == false) { if (!$setting_show_also_closed_courses) {
// If we do not show the closed courses // If we do not show the closed courses
// we only show the courses that are open to the world (to everybody) // we only show the courses that are open to the world (to everybody)
// and the courses that are open to the platform (if the current user is a registered user // and the courses that are open to the platform (if the current user is a registered user

@ -1346,7 +1346,7 @@ function display_license_agreement() {
<td align="center"> <td align="center">
<button type="submit" class="back" name="step1" value="&lt; <?php echo get_lang('Previous'); ?>" ><?php echo get_lang('Previous'); ?></button> <button type="submit" class="back" name="step1" value="&lt; <?php echo get_lang('Previous'); ?>" ><?php echo get_lang('Previous'); ?></button>
<input type="hidden" name="is_executable" id="is_executable" value="-" /> <input type="hidden" name="is_executable" id="is_executable" value="-" />
<button type="submit" class="next" name="step3" onclick="javascript:if(document.getElementById('accept_licence').checked == false) { alert('<?php echo get_lang('YouMustAcceptLicence')?>');return false;}" value="<?php echo get_lang('Next'); ?> &gt;" ><?php echo get_lang('Next'); ?></button> <button type="submit" class="next" name="step3" onclick="javascript: if(!document.getElementById('accept_licence').checked) { alert('<?php echo get_lang('YouMustAcceptLicence')?>');return false;}" value="<?php echo get_lang('Next'); ?> &gt;" ><?php echo get_lang('Next'); ?></button>
</td> </td>
</tr> </tr>
</table> </table>

@ -137,7 +137,7 @@ foreach ($courses_id_full_table_prefix_list as $course_code => $db) {
"'".Database::escape_string($row['learnpath_description'])."',$dsp_ord,'Dokeos')"; "'".Database::escape_string($row['learnpath_description'])."',$dsp_ord,'Dokeos')";
$ins_lp_res = Database::query($ins_lp_sql); $ins_lp_res = Database::query($ins_lp_sql);
$in_id = Database::insert_id(); $in_id = Database::insert_id();
if (empty($in_id) or $in_id == false) die('Could not insert lp: '.$ins_lp_sql); if (!$in_id) die('Could not insert lp: '.$ins_lp_sql);
$lp_ids[$row['learnpath_id']] = $in_id; $lp_ids[$row['learnpath_id']] = $in_id;
$dsp_ord++; $dsp_ord++;
$max_dsp_lp = $dsp_ord; $max_dsp_lp = $dsp_ord;
@ -181,7 +181,7 @@ foreach ($courses_id_full_table_prefix_list as $course_code => $db) {
$ins_res = Database::query($ins_lp_sql); $ins_res = Database::query($ins_lp_sql);
$in_id = Database::insert_id(); $in_id = Database::insert_id();
//echo "&nbsp;&nbsp;Inserted item $in_id<br />\n"; //echo "&nbsp;&nbsp;Inserted item $in_id<br />\n";
if (empty($in_id) OR $in_id == false) die('Could not insert lp: '.$ins_sql); if (!$in_id) die('Could not insert lp: '.$ins_sql);
$parent_chaps[$row['id']] = $row['parent_chapter_id']; $parent_chaps[$row['id']] = $row['parent_chapter_id'];
$lp_chap_items[$row['id']] = $in_id; $lp_chap_items[$row['id']] = $in_id;
$parent_lps[$row['id']] = $row['learnpath_id']; $parent_lps[$row['id']] = $row['learnpath_id'];
@ -330,7 +330,7 @@ foreach ($courses_id_full_table_prefix_list as $course_code => $db) {
$ins_res = Database::query($ins_lp_sql); $ins_res = Database::query($ins_lp_sql);
$in_id = Database::insert_id(); $in_id = Database::insert_id();
//echo "&nbsp;&nbsp;Inserted item $in_id (".$row['title'].")<br />\n"; //echo "&nbsp;&nbsp;Inserted item $in_id (".$row['title'].")<br />\n";
if (empty($in_id) OR $in_id == false) die('Could not insert lp_item: '.$ins_sql); if (!$in_id) die('Could not insert lp_item: '.$ins_sql);
$lp_items[$parent_lps[$row['chapter_id']]][$row['id']] = $in_id; $lp_items[$parent_lps[$row['chapter_id']]][$row['id']] = $in_id;
$lp_ordered_items[$parent_lps[$row['chapter_id']]][$row['chapter_id']][] = $in_id; $lp_ordered_items[$parent_lps[$row['chapter_id']]][$row['chapter_id']][] = $in_id;
} }
@ -973,7 +973,7 @@ foreach ($scorms as $my_course_code => $paths_list) {
if ($loglevel > 1) { error_log("$sql_ins", 0); } if ($loglevel > 1) { error_log("$sql_ins", 0); }
$sql_res = Database::query($sql_ins); $sql_res = Database::query($sql_ins);
$in_id = Database::insert_id(); $in_id = Database::insert_id();
if (empty($in_id) or $in_id == false) die('Could not insert scorm lp: '.$sql_ins); if (!$in_id) die('Could not insert scorm lp: '.$sql_ins);
//echo "&nbsp;&nbsp;Inserted item $in_id<br />\n"; //echo "&nbsp;&nbsp;Inserted item $in_id<br />\n";
$lp_ids[$my_content_id] = $in_id; //contains the old LP ID => the new LP ID $lp_ids[$my_content_id] = $in_id; //contains the old LP ID => the new LP ID
$lp_course[$my_content_id] = $courses_id_list[$my_course_code]; // Contains the old learnpath ID => the course DB name $lp_course[$my_content_id] = $courses_id_list[$my_course_code]; // Contains the old learnpath ID => the course DB name

@ -53,7 +53,7 @@ function addlinkcategory($type) {
$description = trim($description); $description = trim($description);
// If title is empty, an error occurs // If title is empty, an error occurs
if (filter_var($urllink, FILTER_VALIDATE_URL) == false) { if (!filter_var($urllink, FILTER_VALIDATE_URL)) {
$msgErr = get_lang('GiveURL'); $msgErr = get_lang('GiveURL');
Display::display_error_message(get_lang('GiveURL')); Display::display_error_message(get_lang('GiveURL'));
$ok = false; $ok = false;

@ -342,7 +342,7 @@ if ($ncrit && is_array($strings)) {
reset($final_result); reset($final_result);
$query_for_phrase_array = explode(" ",$query_for_phrase); $query_for_phrase_array = explode(" ",$query_for_phrase);
$reg_strings = str_replace('@#@',' ',phpdigPregQuotes(str_replace('\\','',implode('@#@',$query_for_phrase_array)))); $reg_strings = str_replace('@#@',' ',phpdigPregQuotes(str_replace('\\','',implode('@#@',$query_for_phrase_array))));
$stop_regs = "[][(){}[:blank:]=&?!&#%\$£*@+%:;,/\.'\"]"; $stop_regs = "[][(){}[:blank:]=&?!&#%\$<EFBFBD>*@+%:;,/\.'\"]";
$reg_strings = "($stop_regs{1}|^)($reg_strings)($stop_regs{1}|\$)"; $reg_strings = "($stop_regs{1}|^)($reg_strings)($stop_regs{1}|\$)";
while (list($spider_id,$weight) = each($final_result)) { while (list($spider_id,$weight) = each($final_result)) {
$content_file = $relative_script_path.'/'.TEXT_CONTENT_PATH.$spider_id.'.txt'; $content_file = $relative_script_path.'/'.TEXT_CONTENT_PATH.$spider_id.'.txt';
@ -416,7 +416,7 @@ if ((is_array($final_result)) && (count($final_result) > 0)) {
else { else {
$reg_strings = str_replace('@#@','|',phpdigPregQuotes(str_replace('\\','',implode('@#@',$strings)))); $reg_strings = str_replace('@#@','|',phpdigPregQuotes(str_replace('\\','',implode('@#@',$strings))));
} }
$stop_regs = "[][(){}[:blank:]=&?!&#%\$£*@+%:;,/\.'\"]"; $stop_regs = "[][(){}[:blank:]=&?!&#%\$<EFBFBD>*@+%:;,/\.'\"]";
switch($option) { switch($option) {
case 'any': case 'any':
@ -641,7 +641,7 @@ else {
} }
$timer->start('Logs'); $timer->start('Logs');
if (PHPDIG_LOGS == true && !$browse && !$refine && $adlog_flag == 0) { if (PHPDIG_LOGS && !$browse && !$refine && $adlog_flag == 0) {
if (is_array($final_result)) { if (is_array($final_result)) {
phpdigAddLog ($id_connect,$option,$strings,$exclude,count($final_result),$search_time); phpdigAddLog ($id_connect,$option,$strings,$exclude,count($final_result),$search_time);
} }

@ -479,9 +479,9 @@ class MySpace {
$nb_assignments += Tracking::count_student_assignments($row->user_id, $course_code); $nb_assignments += Tracking::count_student_assignments($row->user_id, $course_code);
$last_login_date_tmp = Tracking :: get_last_connection_date_on_the_course ($row->user_id, $course_code, null, false); $last_login_date_tmp = Tracking :: get_last_connection_date_on_the_course ($row->user_id, $course_code, null, false);
if($last_login_date_tmp != false && $last_login_date == false) { if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned
$last_login_date = $last_login_date_tmp; $last_login_date = $last_login_date_tmp;
} else if($last_login_date_tmp != false && $last_login_date == false) { } else if($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned.
// Find the max and assign it to first_login_date // Find the max and assign it to first_login_date
if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) { if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
$last_login_date = $last_login_date_tmp; $last_login_date = $last_login_date_tmp;
@ -503,7 +503,7 @@ class MySpace {
} else { } else {
$avg_score = '-'; $avg_score = '-';
} }
if($last_login_date != false) { if($last_login_date) {
$last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get()); $last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get());
} else { } else {
$last_login_date = '-'; $last_login_date = '-';
@ -623,9 +623,9 @@ class MySpace {
$nb_assignments += Tracking::count_student_assignments($row->user_id, $course_code); $nb_assignments += Tracking::count_student_assignments($row->user_id, $course_code);
$last_login_date_tmp = Tracking :: get_last_connection_date_on_the_course ($row->user_id, $course_code, null, false); $last_login_date_tmp = Tracking :: get_last_connection_date_on_the_course ($row->user_id, $course_code, null, false);
if($last_login_date_tmp != false && $last_login_date == false) { if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned.
$last_login_date = $last_login_date_tmp; $last_login_date = $last_login_date_tmp;
} else if($last_login_date_tmp != false && $last_login_date == false) { } else if($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned.
// Find the max and assign it to first_login_date // Find the max and assign it to first_login_date
if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) { if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
$last_login_date = $last_login_date_tmp; $last_login_date = $last_login_date_tmp;
@ -647,7 +647,7 @@ class MySpace {
} else { } else {
$avg_score = '-'; $avg_score = '-';
} }
if($last_login_date != false) { if($last_login_date) {
$last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get()); $last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get());
} else { } else {
$last_login_date = '-'; $last_login_date = '-';
@ -835,9 +835,9 @@ class MySpace {
$nb_assignments += Tracking::count_student_assignments($row_user->user_id, $row->code, $session_id); $nb_assignments += Tracking::count_student_assignments($row_user->user_id, $row->code, $session_id);
$last_login_date_tmp = Tracking :: get_last_connection_date_on_the_course ($row_user->user_id, $row->code, $session_id, false); $last_login_date_tmp = Tracking :: get_last_connection_date_on_the_course ($row_user->user_id, $row->code, $session_id, false);
if($last_login_date_tmp != false && $last_login_date == false) { if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned.
$last_login_date = $last_login_date_tmp; $last_login_date = $last_login_date_tmp;
} else if($last_login_date_tmp != false && $last_login_date == false) { } else if($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition! To be cleaned.
// Find the max and assign it to first_login_date // Find the max and assign it to first_login_date
if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) { if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
$last_login_date = $last_login_date_tmp; $last_login_date = $last_login_date_tmp;
@ -859,7 +859,7 @@ class MySpace {
} else { } else {
$avg_score = '-'; $avg_score = '-';
} }
if($last_login_date != false) { if($last_login_date) {
$last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get()); $last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get());
} else { } else {
$last_login_date = '-'; $last_login_date = '-';
@ -985,9 +985,9 @@ class MySpace {
$nb_assignments += Tracking::count_student_assignments($row_user->user_id, $row->code, $session_id); $nb_assignments += Tracking::count_student_assignments($row_user->user_id, $row->code, $session_id);
$last_login_date_tmp = Tracking :: get_last_connection_date_on_the_course ($row_user->user_id, $row->code, $session_id, false); $last_login_date_tmp = Tracking :: get_last_connection_date_on_the_course ($row_user->user_id, $row->code, $session_id, false);
if($last_login_date_tmp != false && $last_login_date == false) { if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned.
$last_login_date = $last_login_date_tmp; $last_login_date = $last_login_date_tmp;
} else if($last_login_date_tmp != false && $last_login_date == false) { } else if($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned.
// Find the max and assign it to first_login_date // Find the max and assign it to first_login_date
if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) { if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
$last_login_date = $last_login_date_tmp; $last_login_date = $last_login_date_tmp;
@ -1009,7 +1009,7 @@ class MySpace {
} else { } else {
$avg_score = '-'; $avg_score = '-';
} }
if($last_login_date != false) { if($last_login_date) {
$last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get()); $last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get());
} else { } else {
$last_login_date = '-'; $last_login_date = '-';

@ -450,7 +450,7 @@ class aicc extends learnpath {
} }
} }
if($package_type== '' OR $mandatory!=true) if ($package_type == '' || !$mandatory)
// && defined('CHECK_FOR_AICC') && CHECK_FOR_AICC) // && defined('CHECK_FOR_AICC') && CHECK_FOR_AICC)
{ {
return api_failure::set_failure('not_aicc_content'); return api_failure::set_failure('not_aicc_content');

@ -312,10 +312,10 @@ function LMSCommit(val) {
return('true'); return('true');
} }
function LMSFinish(val) { function LMSFinish(val) {
if (( commit == false )) { if ( !commit ) {
logit_scorm('LMSFinish() (no LMSCommit())',1); logit_scorm('LMSFinish() (no LMSCommit())',1);
} }
if ( commit == true ) { if ( commit ) {
logit_scorm('LMSFinish() called',1); logit_scorm('LMSFinish() called',1);
savedata('finish'); savedata('finish');
} }

@ -98,7 +98,7 @@ function ErrorHandler()
if(errCode == _NotImplementedError) if(errCode == _NotImplementedError)
{ {
var errDescription = "The LMS doesn't support this feature"; var errDescription = "The LMS doesn't support this feature";
if(_debug == true) if(_debug)
{ {
errDescription += "\n"; errDescription += "\n";
errDescription += api.LMSGetDiagnostic(null); errDescription += api.LMSGetDiagnostic(null);
@ -108,7 +108,7 @@ function ErrorHandler()
else else
{ {
var errDescription = API.LMSGetErrorString(errCode); var errDescription = API.LMSGetErrorString(errCode);
if(_debug == true) if(_debug)
{ {
errDescription += "\n"; errDescription += "\n";
errDescription += api.LMSGetDiagnostic(null); errDescription += api.LMSGetDiagnostic(null);
@ -278,7 +278,7 @@ var exitPageStatus;
function loadPage() function loadPage()
{ {
var result = doLMSInitialize(); var result = doLMSInitialize();
if(result != false) if(result)
{ {
var status = doLMSGetValue("cmi.core.lesson_status"); var status = doLMSGetValue("cmi.core.lesson_status");
if(status == "not attempted") if(status == "not attempted")
@ -407,7 +407,7 @@ function doQuit()
*/ */
function unloadPage(status) function unloadPage(status)
{ {
if (exitPageStatus != true) if (!exitPageStatus)
{ {
// doQuit( status ); // doQuit( status );
} }
@ -445,7 +445,7 @@ function checkAnswers(interrupted)
{ {
var idAnswer = questions_answers[idQuestion][j]; var idAnswer = questions_answers[idQuestion][j];
var answer = document.getElementById('question_'+(idQuestion)+'_multiple_'+(idAnswer)); var answer = document.getElementById('question_'+(idQuestion)+'_multiple_'+(idAnswer));
if(answer.checked == true) if(answer.checked)
{ {
interactionAnswers += idAnswer+'__|';// changed by isaac flores interactionAnswers += idAnswer+'__|';// changed by isaac flores
myScore +=questions_answers_ponderation[idQuestion][idAnswer]; myScore +=questions_answers_ponderation[idQuestion][idAnswer];
@ -482,7 +482,7 @@ function checkAnswers(interrupted)
{ {
var idAnswer = questions_answers[idQuestion][j]; var idAnswer = questions_answers[idQuestion][j];
var answer = document.getElementById('question_'+(idQuestion)+'_unique_'+(idAnswer)); var answer = document.getElementById('question_'+(idQuestion)+'_unique_'+(idAnswer));
if(answer.checked == true) if(answer.checked)
{ {
interactionAnswers += idAnswer; interactionAnswers += idAnswer;
if(questions_answers_correct[idQuestion] == idAnswer) if(questions_answers_correct[idQuestion] == idAnswer)
@ -511,7 +511,7 @@ function checkAnswers(interrupted)
{ {
var idAnswer = questions_answers[idQuestion][j]; var idAnswer = questions_answers[idQuestion][j];
var answer = document.getElementById('question_'+(idQuestion)+'_tf_'+(idAnswer)); var answer = document.getElementById('question_'+(idQuestion)+'_tf_'+(idAnswer));
if(answer.checked.value == true) if(answer.checked.value)
{ {
interactionAnswers += idAnswer; interactionAnswers += idAnswer;
for(k=0;k<questions_answers_correct[idQuestion].length;k++) for(k=0;k<questions_answers_correct[idQuestion].length;k++)
@ -637,7 +637,7 @@ function checkAnswers(interrupted)
for(var j=0; j<questions_answers[idQuestion].length;j++) { for(var j=0; j<questions_answers[idQuestion].length;j++) {
var idAnswer = questions_answers[idQuestion][j]; var idAnswer = questions_answers[idQuestion][j];
var answer = document.getElementById('question_'+(idQuestion)+'_multiple_'+(idAnswer)); var answer = document.getElementById('question_'+(idQuestion)+'_multiple_'+(idAnswer));
if (answer.checked == true) { if (answer.checked) {
if(questions_answers_ponderation[idQuestion][idAnswer] != 0 ) { if(questions_answers_ponderation[idQuestion][idAnswer] != 0 ) {
real_answers[j] = true; real_answers[j] = true;
} else { } else {
@ -655,12 +655,12 @@ function checkAnswers(interrupted)
var final_answer = true; var final_answer = true;
for(var z=0; z<real_answers.length ;z++) { for(var z=0; z<real_answers.length ;z++) {
if (real_answers[z] == false) { if (!real_answers[z]) {
final_answer = false; final_answer = false;
} }
} }
if (final_answer == true) { if (final_answer) {
//getting only the first score where we save the weight of all the question //getting only the first score where we save the weight of all the question
myScore += questions_answers_ponderation[idQuestion][1]; myScore += questions_answers_ponderation[idQuestion][1];
} }
@ -709,7 +709,7 @@ function checkAnswers(interrupted)
} }
doLMSSetValue('cmi.core.lesson_status',status); doLMSSetValue('cmi.core.lesson_status',status);
if((interrupted==true) && (status != 'completed') && (status != 'passed')) if (interrupted && (status != 'completed') && (status != 'passed'))
{ {
doLMSSetValue('cmi.core.exit','suspended'); doLMSSetValue('cmi.core.exit','suspended');
} }

@ -712,7 +712,7 @@ class learnpath {
} }
} }
} }
if ($completed == true) { //if all the children were completed if ($completed) { //if all the children were completed
$parent->set_status('completed'); $parent->set_status('completed');
$parent->save(false, $this->prerequisites_match($parent->get_id())); $parent->save(false, $this->prerequisites_match($parent->get_id()));
$this->update_queue[$parent->get_id()] = $parent->get_status(); $this->update_queue[$parent->get_id()] = $parent->get_status();
@ -1469,7 +1469,7 @@ class learnpath {
if (count($this->ordered_items) == 0) { if (count($this->ordered_items) == 0) {
$this->index = 0; $this->index = 0;
} }
if (!empty ($this->last_item_seen) && !empty ($this->items[$this->last_item_seen]) && $this->items[$this->last_item_seen]->get_type() != 'dir' && $this->items[$this->last_item_seen]->get_type() != 'dokeos_chapter' && $this->items[$this->last_item_seen]->is_done() != true) { if (!empty ($this->last_item_seen) && !empty ($this->items[$this->last_item_seen]) && $this->items[$this->last_item_seen]->get_type() != 'dir' && $this->items[$this->last_item_seen]->get_type() != 'dokeos_chapter' && !$this->items[$this->last_item_seen]->is_done()) {
if ($this->debug > 2) { if ($this->debug > 2) {
error_log('New LP - In learnpath::first() - Last item seen is ' . $this->last_item_seen . ' of type ' . $this->items[$this->last_item_seen]->get_type(), 0); error_log('New LP - In learnpath::first() - Last item seen is ' . $this->last_item_seen . ' of type ' . $this->items[$this->last_item_seen]->get_type(), 0);
} }
@ -1751,7 +1751,7 @@ class learnpath {
$package_type = 'scorm'; $package_type = 'scorm';
break; //exit the foreach loop break; //exit the foreach loop
} }
elseif (preg_match('/aicc\//i', $thisContent['filename']) != false) { elseif (preg_match('/aicc\//i', $thisContent['filename'])) {
//if found an aicc directory... (!= false means it cannot be false (error) or 0 (no match)) //if found an aicc directory... (!= false means it cannot be false (error) or 0 (no match))
$package_type = 'aicc'; $package_type = 'aicc';
//break;//don't exit the loop, because if we find an imsmanifest afterwards, we want it, not the AICC //break;//don't exit the loop, because if we find an imsmanifest afterwards, we want it, not the AICC
@ -2509,7 +2509,7 @@ class learnpath {
} }
} }
if ($this->debug > 2) { if ($this->debug > 2) {
error_log('New LP - In learnpath::get_type() - Returning ' . ($res == false ? 'false' : $res), 0); error_log('New LP - In learnpath::get_type() - Returning ' . ($res ? $res : 'false'), 0);
} }
return $res; return $res;
} }

@ -1016,7 +1016,7 @@ class learnpathItem {
$res = Database::query($sql); $res = Database::query($sql);
if (Database::num_rows($res)==1) { if (Database::num_rows($res)==1) {
$row = Database::fetch_array($res); $row = Database::fetch_array($res);
if($update_local==true){ if ($update_local) {
$this->set_status($row['status']); $this->set_status($row['status']);
} }
if(self::debug>2){error_log('New LP - In learnpathItem::get_status() - Returning db value '.$row['status'],0);} if(self::debug>2){error_log('New LP - In learnpathItem::get_status() - Returning db value '.$row['status'],0);}
@ -1297,7 +1297,7 @@ class learnpathItem {
$andstatus = true; $andstatus = true;
foreach($list as $condition){ foreach($list as $condition){
$andstatus = $andstatus && $this->parse_prereq($condition,$items,$refs_list,$user_id); $andstatus = $andstatus && $this->parse_prereq($condition,$items,$refs_list,$user_id);
if($andstatus==false){ if (!$andstatus) {
if(self::debug>1){error_log('New LP - One condition in AND was false, short-circuit',0);} if(self::debug>1){error_log('New LP - One condition in AND was false, short-circuit',0);}
break; break;
} }
@ -1621,7 +1621,7 @@ class learnpathItem {
foreach($list as $condition){ foreach($list as $condition){
if(self::debug>1){error_log('New LP - Found OR, adding it ('.$condition.')',0);} if(self::debug>1){error_log('New LP - Found OR, adding it ('.$condition.')',0);}
$orstatus = $orstatus || $this->parse_prereq($condition,$items,$refs_list,$user_id); $orstatus = $orstatus || $this->parse_prereq($condition,$items,$refs_list,$user_id);
if($orstatus == true){ if ($orstatus) {
//shortcircuit OR //shortcircuit OR
if(self::debug>1){error_log('New LP - One condition in OR was true, short-circuit',0);} if(self::debug>1){error_log('New LP - One condition in OR was true, short-circuit',0);}
break; break;
@ -1711,7 +1711,7 @@ class learnpathItem {
}else{ }else{
if(self::debug>1){error_log('New LP - In learnpathItem::save() - SCORM save request received',0);} if(self::debug>1){error_log('New LP - In learnpathItem::save() - SCORM save request received',0);}
//get all new settings from the URL //get all new settings from the URL
if($from_outside==true){ if ($from_outside) {
if(self::debug>1){error_log('New LP - In learnpathItem::save() - Getting item data from outside',0);} if(self::debug>1){error_log('New LP - In learnpathItem::save() - Getting item data from outside',0);}
foreach($_GET as $param => $value) foreach($_GET as $param => $value)
{ {
@ -2304,7 +2304,7 @@ class learnpathItem {
//depending on what we want (really), we'll update or insert a new row //depending on what we want (really), we'll update or insert a new row
//now save into DB //now save into DB
$res = 0; $res = 0;
if( $inserted==false && Database::num_rows($check_res)<1){ if (!$inserted && Database::num_rows($check_res) < 1) {
/*$my_status = ''; /*$my_status = '';
if ($this->type!=TOOL_QUIZ) { if ($this->type!=TOOL_QUIZ) {
$my_status = $this->get_status(false); $my_status = $this->get_status(false);

@ -50,7 +50,7 @@ function FCKeditor_OnComplete( editorInstance ) {
} }
function check_for_title() { function check_for_title() {
if (temp==true) { if (temp) {
// This functions shows that you can interact directly with the editor area // This functions shows that you can interact directly with the editor area
// DOM. In this way you have the freedom to do anything you want with it. // DOM. In this way you have the freedom to do anything you want with it.

@ -71,7 +71,7 @@ if($debug>0) error_log('New LP - Included aiccItem',0);
require_once('back_compat.inc.php'); require_once('back_compat.inc.php');
if($debug>0) error_log('New LP - Included back_compat',0); if($debug>0) error_log('New LP - Included back_compat',0);
if ($is_allowed_in_course == false){ if (!$is_allowed_in_course) {
api_not_allowed(true); api_not_allowed(true);
} }
@ -115,9 +115,9 @@ if(isset($_SESSION['lpobject']))
} }
} }
if($debug>0) error_log('New LP - Passed data remains check',0); if ($debug>0) error_log('New LP - Passed data remains check',0);
if($lp_found == false || (!empty($_REQUEST['lp_id']) && $_SESSION['oLP']->get_id() != $_REQUEST['lp_id'])) { if (!$lp_found || (!empty($_REQUEST['lp_id']) && $_SESSION['oLP']->get_id() != $_REQUEST['lp_id'])) {
if($debug>0) error_log('New LP - oLP is not object, has changed or refresh been asked, getting new',0); if($debug>0) error_log('New LP - oLP is not object, has changed or refresh been asked, getting new',0);
//regenerate a new lp object? Not always as some pages don't need the object (like upload?) //regenerate a new lp object? Not always as some pages don't need the object (like upload?)
if(!empty($_REQUEST['lp_id']) || !empty($myrefresh_id)){ if(!empty($_REQUEST['lp_id']) || !empty($myrefresh_id)){

@ -23,7 +23,7 @@ $path_name = $_SESSION['oLP']->get_name();
$path_id = $_SESSION['oLP']->get_id(); $path_id = $_SESSION['oLP']->get_id();
// use the flag set in lp_view.php to check if this script has been loaded // use the flag set in lp_view.php to check if this script has been loaded
// as a frame of lp_view.php. Otherwise, redirect to lp_controller // as a frame of lp_view.php. Otherwise, redirect to lp_controller
if(!isset($_SESSION['loaded_lp_view']) || $_SESSION['loaded_lp_view']==false) if (!$_SESSION['loaded_lp_view'])
{ {
header('location: lp_controller.php?'.api_get_cidreq().'&action=view&item_id='.$path_id); header('location: lp_controller.php?'.api_get_cidreq().'&action=view&item_id='.$path_id);
} }

@ -55,7 +55,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST'
require_once('scorm.class.php'); require_once('scorm.class.php');
$oScorm = new scorm(); $oScorm = new scorm();
$manifest = $oScorm->import_package($_FILES['user_file'],$current_dir); $manifest = $oScorm->import_package($_FILES['user_file'],$current_dir);
if ($manifest == false ) { //if api_set_failure if (!$manifest) { //if api_set_failure
return api_failure::set_failure(api_failure::get_last_failure()); return api_failure::set_failure(api_failure::get_last_failure());
} }
if(!empty($manifest)){ if(!empty($manifest)){

@ -35,7 +35,7 @@ require_once 'learnpath.class.php';
require_once 'learnpathItem.class.php'; require_once 'learnpathItem.class.php';
//require_once('lp_comm.common.php'); //xajax functions //require_once('lp_comm.common.php'); //xajax functions
if ($is_allowed_in_course == false) api_not_allowed(); if (!$is_allowed_in_course) api_not_allowed();
// we set the encoding of the lp // we set the encoding of the lp
if (!empty($_SESSION['oLP']->encoding)) { if (!empty($_SESSION['oLP']->encoding)) {

@ -1705,7 +1705,7 @@ function rl_get_html_resource_link($course_code, $type, $id, $style='', $new_win
// styling the link of the added resource // styling the link of the added resource
if ($style <> '') $styling = ' class="'.$style.'"'; if ($style <> '') $styling = ' class="'.$style.'"';
if($new_window == true){ $target = ' target = "_blank" ';}else{$target = ' target = "_self" ';} if ($new_window) { $target = ' target = "_blank" '; } else { $target = ' target = "_self" '; }
$output = ''; $output = '';

@ -854,12 +854,11 @@ function LMSFinish(val) {
olms.G_LastErrorMessage = 'No error'; olms.G_LastErrorMessage = 'No error';
// if olms.commit == false, then the SCORM didn't ask for a commit, so we // if olms.commit == false, then the SCORM didn't ask for a commit, so we
// should at least report that // should at least report that
if (( olms.commit == false )) { if ( !olms.commit ) {
logit_scorm('LMSFinish() (no LMSCommit())',1); logit_scorm('LMSFinish() (no LMSCommit())',1);
} }
//if ( olms.commit == true ) { //if ( olms.commit ) {
logit_scorm('LMSFinish() called',1); logit_scorm('LMSFinish() called',1);
savedata('finish'); savedata('finish');
olms.commit = false; olms.commit = false;
@ -1017,7 +1016,7 @@ function addListeners(){
*/ */
function lms_save_asset(){ function lms_save_asset(){
// only for dokeos lps // only for dokeos lps
if (olms.execute_stats==true) { if (olms.execute_stats) {
olms.execute_stats=false; olms.execute_stats=false;
} else { } else {
olms.execute_stats=true; olms.execute_stats=true;
@ -1178,7 +1177,7 @@ function update_toc(update_action,update_id,change_ids)
* Update the stats frame using a reload of the frame to avoid unsynched data * Update the stats frame using a reload of the frame to avoid unsynched data
*/ */
function update_stats() { function update_stats() {
if (olms.execute_stats==true) { if (olms.execute_stats) {
try { try {
cont_f = document.getElementById('content_id'); cont_f = document.getElementById('content_id');
cont_f.src="lp_controller.php?action=stats"; cont_f.src="lp_controller.php?action=stats";
@ -1254,7 +1253,7 @@ function process_scorm_values () {
for (i=0;i<olms.scorm_variables.length;i++) { for (i=0;i<olms.scorm_variables.length;i++) {
if (olms.updatable_vars_list[olms.scorm_variables[i]]==true) { if (olms.updatable_vars_list[olms.scorm_variables[i]]) {
olms.variable_to_send.push(olms.scorm_variables[i]); olms.variable_to_send.push(olms.scorm_variables[i]);
} }
} }
@ -1269,7 +1268,7 @@ function reinit_updatable_vars_list () {
for (i=0;i<olms.scorm_variables.length;i++) { for (i=0;i<olms.scorm_variables.length;i++) {
if (olms.updatable_vars_list[olms.scorm_variables[i]]==true) { if (olms.updatable_vars_list[olms.scorm_variables[i]]) {
olms.updatable_vars_list[olms.scorm_variables[i]]=false; olms.updatable_vars_list[olms.scorm_variables[i]]=false;
} }
} }

@ -92,7 +92,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
if ($check) { if ($check) {
$values = $form->exportValues(); $values = $form->exportValues();
$res = NotebookManager::save_note($values); $res = NotebookManager::save_note($values);
if ($res == true){ if ($res) {
Display::display_confirmation_message(get_lang('NoteAdded')); Display::display_confirmation_message(get_lang('NoteAdded'));
} }
} }

@ -118,7 +118,7 @@ include('header_frame.inc.php');
<table border="0" cellpadding="5" cellspacing="0" width="100%"> <table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr> <tr>
<td width="90%"><input type="text" name="message" size="50" value="" style="width: 100%;"></td> <td width="90%"><input type="text" name="message" size="50" value="" style="width: 100%;"></td>
<td width="9%" nowrap="nowrap"><?php echo get_lang('Question'); ?>&nbsp;<input type="checkbox" name="question" value="1" style="vertical-align: middle;" onclick="javascript:if(this.checked == true && !confirm('<?php echo addslashes(api_htmlentities(get_lang('OnlyCheckForImportantQuestion'),ENT_QUOTES,$charset)); ?>')) this.checked=false; document.formMessage.message.focus();"></td> <td width="9%" nowrap="nowrap"><?php echo get_lang('Question'); ?>&nbsp;<input type="checkbox" name="question" value="1" style="vertical-align: middle;" onclick="javascript: if(this.checked && !confirm('<?php echo addslashes(api_htmlentities(get_lang('OnlyCheckForImportantQuestion'),ENT_QUOTES,$charset)); ?>')) this.checked=false; document.formMessage.message.focus();"></td>
<td width="1%"><input type="submit" value="OK" style="width: 30px;"></td> <td width="1%"><input type="submit" value="OK" style="width: 30px;"></td>
</tr> </tr>
</table> </table>

@ -247,7 +247,7 @@ function display_checkbox_matrix($permission_array, $tool, $permission, $inherit
*/ */
function display_image_matrix($permission_array, $tool, $permission,$inherited_permissions=array(), $course_admin=false, $editable=true) function display_image_matrix($permission_array, $tool, $permission,$inherited_permissions=array(), $course_admin=false, $editable=true)
{ {
if($course_admin==true) if ($course_admin)
{ {
echo "\t\t\t<img src=\"../img/checkbox_on3.gif\" border=\"0\"/ title=\"".get_lang('PermissionGrantedByGroupOrRole')."\">"; echo "\t\t\t<img src=\"../img/checkbox_on3.gif\" border=\"0\"/ title=\"".get_lang('PermissionGrantedByGroupOrRole')."\">";
} }
@ -331,7 +331,7 @@ function display_image_matrix($permission_array, $tool, $permission,$inherited_p
function display_image_matrix_for_blogs($permission_array, $user_id, $tool, $permission,$inherited_permissions=array(), $course_admin=false, $editable=true) function display_image_matrix_for_blogs($permission_array, $user_id, $tool, $permission,$inherited_permissions=array(), $course_admin=false, $editable=true)
{ {
if($course_admin==true) if ($course_admin)
{ {
echo "\t\t\t<img src=\"../img/checkbox_on3.gif\" border=\"0\"/ title=\"".get_lang('PermissionGrantedByGroupOrRole')."\">"; echo "\t\t\t<img src=\"../img/checkbox_on3.gif\" border=\"0\"/ title=\"".get_lang('PermissionGrantedByGroupOrRole')."\">";
} }

@ -85,7 +85,7 @@ if (isset ($_POST['action'])) {
if (count($ids) > 0) { if (count($ids) > 0) {
foreach ($ids as $id) { foreach ($ids as $id) {
$result = Rsys :: delete_item($id); $result = Rsys :: delete_item($id);
if ($result != 0 && $warning <> true) if ($result != 0 && $warning <> true) // TODO: A strange looking logical condition, to be cleaned.
$warning = true; $warning = true;
} }
ob_start(); ob_start();

@ -79,7 +79,7 @@ if (isset ($_POST['action'])) {
if (count($ids) > 0) { if (count($ids) > 0) {
foreach ($ids as $id) { foreach ($ids as $id) {
$result = Rsys :: delete_item($id); $result = Rsys :: delete_item($id);
if ($result != 0 && $warning <> true) if ($result != 0 && $warning <> true) // TODO: A strange looking logical condition, to be cleaned.
$warning = true; $warning = true;
} }
ob_start(); ob_start();

@ -27,7 +27,7 @@ if (isset($_GET['u'])) {
if (api_get_user_id() != $user_id) { if (api_get_user_id() != $user_id) {
$user_info = UserManager::get_user_info_by_id($user_id); $user_info = UserManager::get_user_info_by_id($user_id);
$show_full_profile = false; $show_full_profile = false;
if ($user_info==false) { if (!$user_info) {
// user does no exist !! // user does no exist !!
api_not_allowed(); api_not_allowed();
} else { } else {

@ -208,7 +208,7 @@ if ($survey_data['survey_type'] == 1 || $_GET['action'] == 'add') {
if ((isset($_GET['action']) && $_GET['action'] == 'edit') && !empty($survey_id)) { if ((isset($_GET['action']) && $_GET['action'] == 'edit') && !empty($survey_id)) {
if ($survey_data['anonymous'] == 0) { if ($survey_data['anonymous'] == 0) {
$form->addElement('checkbox', 'show_form_profile', get_lang('ShowFormProfile'), '', 'onclick="javascript: if(this.checked==true){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"'); $form->addElement('checkbox', 'show_form_profile', get_lang('ShowFormProfile'), '', 'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
if ($survey_data['show_form_profile'] == 1) { if ($survey_data['show_form_profile'] == 1) {
$form -> addElement('html', '<div id="options_field" style="display:block">'); $form -> addElement('html', '<div id="options_field" style="display:block">');

@ -33,7 +33,7 @@ $htmlHeadXtra[] =
"<script type=\"text/javascript\"> "<script type=\"text/javascript\">
<!-- // <!-- //
function check_unzip() { function check_unzip() {
if(document.upload.unzip.checked==true){ if(document.upload.unzip.checked){
document.upload.if_exists[0].disabled=true; document.upload.if_exists[0].disabled=true;
document.upload.if_exists[1].checked=true; document.upload.if_exists[1].checked=true;
document.upload.if_exists[2].disabled=true; document.upload.if_exists[2].disabled=true;

@ -115,7 +115,7 @@ function remove_cat_def($id, $force = false)
return false; return false;
} }
$sqlCondition = " WHERE id = '$id'"; $sqlCondition = " WHERE id = '$id'";
if ($force == false) if (!$force)
{ {
$sql = "SELECT * FROM $TBL_USERINFO_CONTENT $sqlCondition"; $sql = "SELECT * FROM $TBL_USERINFO_CONTENT $sqlCondition";
$result = Database::query($sql); $result = Database::query($sql);

@ -3491,7 +3491,7 @@ function WSSubscribeUsersToCourse($params) {
$result['result'] = 0; $result['result'] = 0;
} else { } else {
$course_code = CourseManager::get_course_code_from_course_id($course_id); $course_code = CourseManager::get_course_code_from_course_id($course_id);
if(CourseManager::add_user_to_course($user_id, $course_code, $status) == false) { if (!CourseManager::add_user_to_course($user_id, $course_code, $status)) {
$result['result'] = 0; $result['result'] = 0;
} }
} }

@ -110,7 +110,7 @@ class WSCourse extends WS {
$wanted_code = generate_course_code($title); $wanted_code = generate_course_code($title);
} }
$result = create_course($wanted_code, $title, $tutor_name, $category_code, $language, $course_admin_id, $this->_configuration['db_prefix'], 0); $result = create_course($wanted_code, $title, $tutor_name, $category_code, $language, $course_admin_id, $this->_configuration['db_prefix'], 0);
if($result == false) { if (!$result) {
return new WSError(202, 'There was an error creating the course'); return new WSError(202, 'There was an error creating the course');
} else { } else {
// Update extra fields // Update extra fields
@ -478,7 +478,7 @@ class WSCourse extends WS {
$exists = true; $exists = true;
} }
} }
if($exists == false) { if (!$exists) {
$cd->set_progress(0); $cd->set_progress(0);
$cd->insert($course_info['db_name']); $cd->insert($course_info['db_name']);
} else { } else {

@ -241,7 +241,7 @@ class WSSession extends WS {
SessionManager::suscribe_users_to_session($session_id, array($user_id)); SessionManager::suscribe_users_to_session($session_id, array($user_id));
} else { } else {
$result = SessionManager::unsubscribe_user_from_session($session_id, $user_id); $result = SessionManager::unsubscribe_user_from_session($session_id, $user_id);
if($result == false) { if (!$result) {
return new WSError(303, 'There was an error unsubscribing this user from the session'); return new WSError(303, 'There was an error unsubscribing this user from the session');
} }
} }
@ -317,7 +317,7 @@ class WSSession extends WS {
return true; return true;
} else { } else {
$result = SessionManager::unsubscribe_course_from_session($session_id, $course_id); $result = SessionManager::unsubscribe_course_from_session($session_id, $course_id);
if($result == true) { if ($result) {
return true; return true;
} else { } else {
return new WSError(304, 'Error unsubscribing course from session'); return new WSError(304, 'Error unsubscribing course from session');

@ -228,7 +228,7 @@ class WSUser extends WS {
$extras_associative[$extra['field_name']] = $extra['field_value']; $extras_associative[$extra['field_name']] = $extra['field_value'];
} }
$result = UserManager::create_user($firstname, $lastname, $status, $email, $login, $password, '', $language, $phone, '', PLATFORM_AUTH_SOURCE, $expiration_date, $visibility, 0, $extras_associative, $encrypt_method); $result = UserManager::create_user($firstname, $lastname, $status, $email, $login, $password, '', $language, $phone, '', PLATFORM_AUTH_SOURCE, $expiration_date, $visibility, 0, $extras_associative, $encrypt_method);
if($result == false) { if (!$result) {
$failure = $api_failureList[0]; $failure = $api_failureList[0];
if($failure == 'login-pass already taken') { if($failure == 'login-pass already taken') {
return new WSError(102, 'This username is already taken'); return new WSError(102, 'This username is already taken');
@ -341,7 +341,7 @@ class WSUser extends WS {
$extras = null; $extras = null;
} }
$result = UserManager::update_user($user_id, $firstname, $lastname, $loginname, $password, PLATFORM_AUTH_SOURCE, $email, $status, '', $phone, $user_info['picture_uri'], $expiration_date, $user_info['active'], null, $user_info['hr_dept_id'], $extras, $encrypt_method); $result = UserManager::update_user($user_id, $firstname, $lastname, $loginname, $password, PLATFORM_AUTH_SOURCE, $email, $status, '', $phone, $user_info['picture_uri'], $expiration_date, $user_info['active'], null, $user_info['hr_dept_id'], $extras, $encrypt_method);
if($result == false) { if (!$result) {
$failure = $api_failureList[0]; $failure = $api_failureList[0];
if($failure == 'encrypt_method invalid') { if($failure == 'encrypt_method invalid') {
return new WSError(103, 'The encryption of the password is invalid'); return new WSError(103, 'The encryption of the password is invalid');

@ -95,7 +95,7 @@
} }
// line unchanged // line unchanged
elseif ( $show_equals == true ) elseif ( $show_equals )
{ {
$output .= $format_line_function( $i, DIFF_EQUAL, $newArr[$i] ); $output .= $format_line_function( $i, DIFF_EQUAL, $newArr[$i] );

@ -1457,7 +1457,7 @@ if ($_GET['action']=='edit')
echo '<div id="options" style="display:none; margin: 20px;" >'; echo '<div id="options" style="display:none; margin: 20px;" >';
//task //task
echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checktask" onclick="if(this.checked==true){document.getElementById(\'option4\').style.display=\'block\';}else{document.getElementById(\'option4\').style.display=\'none\';}"/>&nbsp;<img src="../img/wiki/task.gif" title="'.get_lang('DefineTask').'" alt="'.get_lang('DefineTask').'"/>'.get_lang('DescriptionOfTheTask').''; echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checktask" onclick="javascript: if(this.checked){document.getElementById(\'option4\').style.display=\'block\';}else{document.getElementById(\'option4\').style.display=\'none\';}"/>&nbsp;<img src="../img/wiki/task.gif" title="'.get_lang('DefineTask').'" alt="'.get_lang('DefineTask').'"/>'.get_lang('DescriptionOfTheTask').'';
echo '&nbsp;&nbsp;&nbsp;<span id="msg_error4" style="display:none;color:red"></span>'; echo '&nbsp;&nbsp;&nbsp;<span id="msg_error4" style="display:none;color:red"></span>';
echo '<div id="option4" style="padding:4px; margin:5px; border:1px dotted; display:none;">'; echo '<div id="option4" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
@ -1472,7 +1472,7 @@ if ($_GET['action']=='edit')
echo '</div>'; echo '</div>';
//feedback //feedback
echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checkfeedback" onclick="if(this.checked==true){document.getElementById(\'option2\').style.display=\'block\';}else{document.getElementById(\'option2\').style.display=\'none\';}"/>&nbsp;'.get_lang('AddFeedback').''; echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checkfeedback" onclick="javascript: if(this.checked){document.getElementById(\'option2\').style.display=\'block\';}else{document.getElementById(\'option2\').style.display=\'none\';}"/>&nbsp;'.get_lang('AddFeedback').'';
echo '&nbsp;&nbsp;&nbsp;<span id="msg_error2" style="display:none;color:red"></span>'; echo '&nbsp;&nbsp;&nbsp;<span id="msg_error2" style="display:none;color:red"></span>';
echo '<div id="option2" style="padding:4px; margin:5px; border:1px dotted; display:none;">'; echo '<div id="option2" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
@ -1535,7 +1535,7 @@ if ($_GET['action']=='edit')
echo '</div>'; echo '</div>';
//time limit //time limit
echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checktimelimit" onclick="if(this.checked==true){document.getElementById(\'option1\').style.display=\'block\'; $pepe=\'a\';}else{document.getElementById(\'option1\').style.display=\'none\';}"/>&nbsp;'.get_lang('PutATimeLimit').''; echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checktimelimit" onclick="javascript: if(this.checked){document.getElementById(\'option1\').style.display=\'block\'; $pepe=\'a\';}else{document.getElementById(\'option1\').style.display=\'none\';}"/>&nbsp;'.get_lang('PutATimeLimit').'';
echo '&nbsp;&nbsp;&nbsp;<span id="msg_error1" style="display:none;color:red"></span>'; echo '&nbsp;&nbsp;&nbsp;<span id="msg_error1" style="display:none;color:red"></span>';
echo '<div id="option1" style="padding:4px; margin:5px; border:1px dotted; display:none;">'; echo '<div id="option1" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
echo '<table width="100%" border="0" style="font-weight:normal">'; echo '<table width="100%" border="0" style="font-weight:normal">';
@ -1578,7 +1578,7 @@ if ($_GET['action']=='edit')
echo '</div>'; echo '</div>';
//other limit //other limit
echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checkotherlimit" onclick="if(this.checked==true){document.getElementById(\'option3\').style.display=\'block\';}else{document.getElementById(\'option3\').style.display=\'none\';}"/>&nbsp;'.get_lang('OtherSettings').''; echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checkotherlimit" onclick="javascript: if(this.checked){document.getElementById(\'option3\').style.display=\'block\';}else{document.getElementById(\'option3\').style.display=\'none\';}"/>&nbsp;'.get_lang('OtherSettings').'';
echo '&nbsp;&nbsp;&nbsp;<span id="msg_error3" style="display:none;color:red"></span>'; echo '&nbsp;&nbsp;&nbsp;<span id="msg_error3" style="display:none;color:red"></span>';
echo '<div id="option3" style="padding:4px; margin:5px; border:1px dotted; display:none;">'; echo '<div id="option3" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
echo '<div style="font-weight:normal"; align="center">'.get_lang('NMaxWords').':&nbsp;<input type="text" name="max_text" size="3" value="'.$row['max_text'].'">&nbsp;&nbsp;'.get_lang('NMaxVersion').':&nbsp;<input type="text" name="max_version" size="3" value="'.$row['max_version'].'"></div>'; echo '<div style="font-weight:normal"; align="center">'.get_lang('NMaxWords').':&nbsp;<input type="text" name="max_text" size="3" value="'.$row['max_text'].'">&nbsp;&nbsp;'.get_lang('NMaxVersion').':&nbsp;<input type="text" name="max_version" size="3" value="'.$row['max_version'].'"></div>';

@ -577,7 +577,7 @@ return true;
echo '<div id="options" style="display:none; margin: 20px;" >'; echo '<div id="options" style="display:none; margin: 20px;" >';
//task //task
echo '<input type="checkbox" value="1" name="checktask" onclick="if(this.checked==true){document.getElementById(\'option4\').style.display=\'block\';}else{document.getElementById(\'option4\').style.display=\'none\';}"/>&nbsp;<img src="../img/wiki/task.gif" title="'.get_lang('DefineTask').'" alt="'.get_lang('DefineTask').'"/>'.get_lang('DescriptionOfTheTask').''; echo '<input type="checkbox" value="1" name="checktask" onclick="javascript: if(this.checked){document.getElementById(\'option4\').style.display=\'block\';}else{document.getElementById(\'option4\').style.display=\'none\';}"/>&nbsp;<img src="../img/wiki/task.gif" title="'.get_lang('DefineTask').'" alt="'.get_lang('DefineTask').'"/>'.get_lang('DescriptionOfTheTask').'';
echo '&nbsp;&nbsp;&nbsp;<span id="msg_error4" style="display:none;color:red"></span>'; echo '&nbsp;&nbsp;&nbsp;<span id="msg_error4" style="display:none;color:red"></span>';
echo '<div id="option4" style="padding:4px; margin:5px; border:1px dotted; display:none;">'; echo '<div id="option4" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
@ -593,7 +593,7 @@ return true;
echo '</div>'; echo '</div>';
//feedback //feedback
echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checkfeedback" onclick="if(this.checked==true){document.getElementById(\'option2\').style.display=\'block\';}else{document.getElementById(\'option2\').style.display=\'none\';}"/>&nbsp;'.get_lang('AddFeedback').''; echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checkfeedback" onclick="javascript: if(this.checked){document.getElementById(\'option2\').style.display=\'block\';}else{document.getElementById(\'option2\').style.display=\'none\';}"/>&nbsp;'.get_lang('AddFeedback').'';
echo '&nbsp;&nbsp;&nbsp;<span id="msg_error2" style="display:none;color:red"></span>'; echo '&nbsp;&nbsp;&nbsp;<span id="msg_error2" style="display:none;color:red"></span>';
echo '<div id="option2" style="padding:4px; margin:5px; border:1px dotted; display:none;">'; echo '<div id="option2" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
@ -656,7 +656,7 @@ return true;
echo '</div>'; echo '</div>';
//time limit //time limit
echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checktimelimit" onclick="if(this.checked==true){document.getElementById(\'option1\').style.display=\'block\';}else{document.getElementById(\'option1\').style.display=\'none\';}"/>&nbsp;'.get_lang('PutATimeLimit').''; echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checktimelimit" onclick="javascript: if(this.checked){document.getElementById(\'option1\').style.display=\'block\';}else{document.getElementById(\'option1\').style.display=\'none\';}"/>&nbsp;'.get_lang('PutATimeLimit').'';
echo '&nbsp;&nbsp;&nbsp;<span id="msg_error1" style="display:none;color:red"></span>'; echo '&nbsp;&nbsp;&nbsp;<span id="msg_error1" style="display:none;color:red"></span>';
echo '<div id="option1" style="padding:4px; margin:5px; border:1px dotted; display:none;">'; echo '<div id="option1" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
echo '<table width="100%" border="0" style="font-weight:normal">'; echo '<table width="100%" border="0" style="font-weight:normal">';
@ -680,7 +680,7 @@ return true;
echo '</div>'; echo '</div>';
//other limit //other limit
echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checkotherlimit" onclick="if(this.checked==true){document.getElementById(\'option3\').style.display=\'block\';}else{document.getElementById(\'option3\').style.display=\'none\';}"/>&nbsp;'.get_lang('OtherSettings').''; echo '<div>&nbsp;</div><input type="checkbox" value="1" name="checkotherlimit" onclick="javascript: if(this.checked){document.getElementById(\'option3\').style.display=\'block\';}else{document.getElementById(\'option3\').style.display=\'none\';}"/>&nbsp;'.get_lang('OtherSettings').'';
echo '&nbsp;&nbsp;&nbsp;<span id="msg_error3" style="display:none;color:red"></span>'; echo '&nbsp;&nbsp;&nbsp;<span id="msg_error3" style="display:none;color:red"></span>';
echo '<div id="option3" style="padding:4px; margin:5px; border:1px dotted; display:none;">'; echo '<div id="option3" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
echo '<div style="font-weight:normal"; align="center">'.get_lang('NMaxWords').':&nbsp;<input type="text" name="max_text" size="3">&nbsp;&nbsp;'.get_lang('NMaxVersion').':&nbsp;<input type="text" name="max_version" size="3"></div>'; echo '<div style="font-weight:normal"; align="center">'.get_lang('NMaxWords').':&nbsp;<input type="text" name="max_text" size="3">&nbsp;&nbsp;'.get_lang('NMaxVersion').':&nbsp;<input type="text" name="max_version" size="3"></div>';

@ -509,7 +509,7 @@ function display_student_publications_list($work_dir, $sub_course_dir, $currentC
list($d_year, $d_month, $d_day) = split('-', $parts[0]); list($d_year, $d_month, $d_day) = split('-', $parts[0]);
list($d_hour, $d_minute) = split(':', $parts[1]); list($d_hour, $d_minute) = split(':', $parts[1]);
if ((int)$row['weight'] == 0) { if ((int)$row['weight'] == 0) {
$form_folder -> addElement('checkbox', 'make_calification', null, get_lang('MakeQualifiable'), 'onclick="javascript: if(this.checked==true){document.getElementById(\'option3\').style.display = \'block\';}else{document.getElementById(\'option3\').style.display = \'none\';}"'); $form_folder -> addElement('checkbox', 'make_calification', null, get_lang('MakeQualifiable'), 'onclick="javascript: if(this.checked){document.getElementById(\'option3\').style.display = \'block\';}else{document.getElementById(\'option3\').style.display = \'none\';}"');
$form_folder -> addElement('html', '<div id=\'option3\' style="display:none">'); $form_folder -> addElement('html', '<div id=\'option3\' style="display:none">');
$weight_input2[] = FormValidator :: createElement('text', 'weight'); $weight_input2[] = FormValidator :: createElement('text', 'weight');
$form_folder -> addGroup($weight_input2, 'weight', get_lang('WeightInTheGradebook'), 'size="10"'); $form_folder -> addGroup($weight_input2, 'weight', get_lang('WeightInTheGradebook'), 'size="10"');
@ -519,7 +519,7 @@ function display_student_publications_list($work_dir, $sub_course_dir, $currentC
if ($homework['expires_on'] == '0000-00-00 00:00:00') { if ($homework['expires_on'] == '0000-00-00 00:00:00') {
$homework['expires_on'] = date('Y-m-d H:i:s'); $homework['expires_on'] = date('Y-m-d H:i:s');
$there_is_a_expire_date = true; $there_is_a_expire_date = true;
$form_folder -> addElement('checkbox', 'enableExpiryDate',null,get_lang('EnableExpiryDate'), 'onclick="javascript: if(this.checked==true){document.getElementById(\'option1\').style.display = \'block\';}else{document.getElementById(\'option1\').style.display = \'none\';}"'); $form_folder -> addElement('checkbox', 'enableExpiryDate',null,get_lang('EnableExpiryDate'), 'onclick="javascript: if(this.checked){document.getElementById(\'option1\').style.display = \'block\';}else{document.getElementById(\'option1\').style.display = \'none\';}"');
$form_folder -> addElement('html', '<div id=\'option1\' style="display:none">'); $form_folder -> addElement('html', '<div id=\'option1\' style="display:none">');
$form_folder -> addGroup(create_group_date_select(), 'expires', get_lang('ExpiresAt')); $form_folder -> addGroup(create_group_date_select(), 'expires', get_lang('ExpiresAt'));
$form_folder -> addElement('html', '</div>'); $form_folder -> addElement('html', '</div>');
@ -527,7 +527,7 @@ function display_student_publications_list($work_dir, $sub_course_dir, $currentC
if ($homework['ends_on'] == '0000-00-00 00:00:00') { if ($homework['ends_on'] == '0000-00-00 00:00:00') {
$homework['ends_on'] = date('Y-m-d H:i:s'); $homework['ends_on'] = date('Y-m-d H:i:s');
$there_is_a_end_date = true; $there_is_a_end_date = true;
$form_folder -> addElement('checkbox', 'enableEndDate', null, get_lang('EnableEndDate'), 'onclick="javascript: if(this.checked==true){document.getElementById(\'option2\').style.display = \'block\';}else{document.getElementById(\'option2\').style.display = \'none\';}"'); $form_folder -> addElement('checkbox', 'enableEndDate', null, get_lang('EnableEndDate'), 'onclick="javascript: if(this.checked){document.getElementById(\'option2\').style.display = \'block\';}else{document.getElementById(\'option2\').style.display = \'none\';}"');
$form_folder -> addElement('html', '<div id=\'option2\' style="display:none">'); $form_folder -> addElement('html', '<div id=\'option2\' style="display:none">');
$form_folder -> addGroup(create_group_date_select(), 'ends', get_lang('EndsAt')); $form_folder -> addGroup(create_group_date_select(), 'ends', get_lang('EndsAt'));
$form_folder -> addElement('html', '</div>'); $form_folder -> addElement('html', '</div>');
@ -562,7 +562,7 @@ function display_student_publications_list($work_dir, $sub_course_dir, $currentC
$values = $values['my_group']; $values = $values['my_group'];
$dir_name = replace_dangerous_char($values['dir_name']); $dir_name = replace_dangerous_char($values['dir_name']);
$dir_name = disable_dangerous_file($dir_name); $dir_name = disable_dangerous_file($dir_name);
if (is_work_exist_by_url('/'.$dir_name) == false) { if (!is_work_exist_by_url('/'.$dir_name)) {
$TABLEAGENDA = Database::get_course_table(TABLE_AGENDA); $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA);
if ($there_is_a_end_date || $there_is_a_expire_date) { if ($there_is_a_end_date || $there_is_a_expire_date) {
@ -1372,18 +1372,18 @@ function to_javascript_work() {
msg_id1.innerHTML="'.get_lang('FieldRequired', '').'"; msg_id1.innerHTML="'.get_lang('FieldRequired', '').'";
msg_id2.innerHTML="";msg_id3.innerHTML="";msg_id4.innerHTML="";msg_id5.innerHTML=""; msg_id2.innerHTML="";msg_id3.innerHTML="";msg_id4.innerHTML="";msg_id5.innerHTML="";
} }
else if(document.form1.type1.checked==true && document.form1.type2.checked==true && expires_date > ends_date) { else if(document.form1.type1.checked && document.form1.type2.checked && expires_date > ends_date) {
msg_id2.style.display ="block"; msg_id2.style.display ="block";
msg_id2.innerHTML="'.get_lang('EndDateCannotBeBeforeTheExpireDate', '').'"; msg_id2.innerHTML="'.get_lang('EndDateCannotBeBeforeTheExpireDate', '').'";
msg_id1.innerHTML="";msg_id3.innerHTML="";msg_id4.innerHTML="";msg_id5.innerHTML=""; msg_id1.innerHTML="";msg_id3.innerHTML="";msg_id4.innerHTML="";msg_id5.innerHTML="";
} }
else if (checkDate(expires_month,expires_day,expires_year) == false) else if (!checkDate(expires_month,expires_day,expires_year))
{ {
msg_id3.style.display ="block"; msg_id3.style.display ="block";
msg_id3.innerHTML="'.get_lang('InvalidDate', '').'"; msg_id3.innerHTML="'.get_lang('InvalidDate', '').'";
msg_id1.innerHTML="";msg_id2.innerHTML="";msg_id4.innerHTML="";msg_id5.innerHTML=""; msg_id1.innerHTML="";msg_id2.innerHTML="";msg_id4.innerHTML="";msg_id5.innerHTML="";
} }
else if (checkDate(ends_month,ends_day,ends_year) == false) else if (!checkDate(ends_month,ends_day,ends_year))
{ {
msg_id4.style.display ="block"; msg_id4.style.display ="block";
@ -1393,7 +1393,7 @@ function to_javascript_work() {
else else
{ {
if (document.form1.make_calification.checked == true) if (document.form1.make_calification.checked)
{ {
var weight = document.form1.weight.value; var weight = document.form1.weight.value;
if(weight==""){ if(weight==""){

@ -1331,7 +1331,7 @@ if ($is_course_member) {
$addtext .= '<table cellspacing="0" cellpading="0" border="0"><tr>'; $addtext .= '<table cellspacing="0" cellpading="0" border="0"><tr>';
$addtext .= '<td colspan="2">&nbsp;&nbsp;'.get_lang('QualificationNumeric').'&nbsp;'; $addtext .= '<td colspan="2">&nbsp;&nbsp;'.get_lang('QualificationNumeric').'&nbsp;';
$addtext .= '<input type="text" name="qualification_value" value="" size="5"/></td><tr><td colspan="2">'; $addtext .= '<input type="text" name="qualification_value" value="" size="5"/></td><tr><td colspan="2">';
$addtext .= '<input type="checkbox" value="1" name="make_calification" onclick="if(this.checked==true){document.getElementById(\'option1\').style.display=\'block\';}else{document.getElementById(\'option1\').style.display=\'none\';}"/>'.get_lang('MakeQualifiable').'</td></tr><tr>'; $addtext .= '<input type="checkbox" value="1" name="make_calification" onclick="javascript: if(this.checked){document.getElementById(\'option1\').style.display=\'block\';}else{document.getElementById(\'option1\').style.display=\'none\';}"/>'.get_lang('MakeQualifiable').'</td></tr><tr>';
$addtext .= '<td colspan="2"><div id="option1" style="display:none">'; $addtext .= '<td colspan="2"><div id="option1" style="display:none">';
$addtext .= '<div id="msg_error_weight" style="display:none;color:red"></div>'; $addtext .= '<div id="msg_error_weight" style="display:none;color:red"></div>';
$addtext .= '&nbsp;&nbsp;'.get_lang('WeightInTheGradebook').'&nbsp;'; $addtext .= '&nbsp;&nbsp;'.get_lang('WeightInTheGradebook').'&nbsp;';
@ -1339,12 +1339,12 @@ if ($is_course_member) {
$addtext .= '</tr></table>'; $addtext .= '</tr></table>';
$addtext .= '<br />'; $addtext .= '<br />';
$addtext .= '<b>'.get_lang('DatesAvailables').'</b><br />'; $addtext .= '<b>'.get_lang('DatesAvailables').'</b><br />';
$addtext .= '<input type="checkbox" value="1" name="type1" onclick="if(this.checked==true){document.getElementById(\'option2\').style.display=\'block\';}else{document.getElementById(\'option2\').style.display=\'none\';}"/>'.get_lang('EnableExpiryDate').''; $addtext .= '<input type="checkbox" value="1" name="type1" onclick="javascript: if(this.checked){document.getElementById(\'option2\').style.display=\'block\';}else{document.getElementById(\'option2\').style.display=\'none\';}"/>'.get_lang('EnableExpiryDate').'';
$addtext .= '&nbsp;&nbsp;&nbsp;<span id="msg_error2" style="display:none;color:red"></span>'; $addtext .= '&nbsp;&nbsp;&nbsp;<span id="msg_error2" style="display:none;color:red"></span>';
$addtext .= '&nbsp;&nbsp;&nbsp;<span id="msg_error3" style="display:none;color:red"></span>'; $addtext .= '&nbsp;&nbsp;&nbsp;<span id="msg_error3" style="display:none;color:red"></span>';
$addtext .= '<div id="option2" style="padding:4px;display:none">&nbsp;&nbsp;'; $addtext .= '<div id="option2" style="padding:4px;display:none">&nbsp;&nbsp;';
$addtext .= draw_date_picker('expires').'</div>'; $addtext .= draw_date_picker('expires').'</div>';
$addtext .= '<br /><input type="checkbox" value="1" name="type2" onclick="if(this.checked==true){document.getElementById(\'option3\').style.display=\'block\';}else{document.getElementById(\'option3\').style.display=\'none\';}"/>'.get_lang('EnableEndDate').''; $addtext .= '<br /><input type="checkbox" value="1" name="type2" onclick="javascript: if(this.checked){document.getElementById(\'option3\').style.display=\'block\';}else{document.getElementById(\'option3\').style.display=\'none\';}"/>'.get_lang('EnableEndDate').'';
$addtext .= '<div id="option3" style="padding:4px;display:none">'; $addtext .= '<div id="option3" style="padding:4px;display:none">';
$addtext .= '&nbsp;&nbsp;&nbsp;<div id="msg_error4" style="display:none;color:red"></div>'; $addtext .= '&nbsp;&nbsp;&nbsp;<div id="msg_error4" style="display:none;color:red"></div>';
$addtext .= draw_date_picker('ends').'<br />'; $addtext .= draw_date_picker('ends').'<br />';

@ -400,7 +400,7 @@ class UnitTestCase extends SimpleTestCase {
* @access private * @access private
*/ */
function _coerceExpectation($expected) { function _coerceExpectation($expected) {
if ($expected == false) { if (!$expected) {
return new TrueExpectation(); return new TrueExpectation();
} }
if (SimpleTestCompatibility::isA($expected, 'SimpleExpectation')) { if (SimpleTestCompatibility::isA($expected, 'SimpleExpectation')) {

@ -29,7 +29,7 @@ if (!empty($array_keys)) {
$username = substr($array_keys[0],0,20); // max len of an username $username = substr($array_keys[0],0,20); // max len of an username
$friend_id = UserManager::get_user_id_from_username($username); $friend_id = UserManager::get_user_id_from_username($username);
if ($friend_id != false) { if ($friend_id) {
SocialManager::display_individual_user($friend_id); SocialManager::display_individual_user($friend_id);
/* /*
if (api_get_setting('allow_social_tool') =='true') { if (api_get_setting('allow_social_tool') =='true') {

@ -1643,7 +1643,7 @@ echo '<div id="social_widget">';
echo ' <div id="social_widget_image">'; echo ' <div id="social_widget_image">';
if (api_get_setting('allow_social_tool') == 'true') { if (api_get_setting('allow_social_tool') == 'true') {
if ($no_image == false) { if (!$no_image) {
echo '<a href="'.api_get_path(WEB_PATH).'main/social/home.php"><img src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>'; echo '<a href="'.api_get_path(WEB_PATH).'main/social/home.php"><img src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>';
} else { } else {
echo '<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php"><img title="'.get_lang('EditProfile').'" src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>'; echo '<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php"><img title="'.get_lang('EditProfile').'" src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>';

Loading…
Cancel
Save