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. 4
      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) {
// $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
// 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

@ -1346,7 +1346,7 @@ function display_license_agreement() {
<td align="center">
<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="-" />
<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>
</tr>
</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')";
$ins_lp_res = Database::query($ins_lp_sql);
$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;
$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);
$in_id = Database::insert_id();
//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'];
$lp_chap_items[$row['id']] = $in_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);
$in_id = Database::insert_id();
//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_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); }
$sql_res = Database::query($sql_ins);
$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";
$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

@ -53,7 +53,7 @@ function addlinkcategory($type) {
$description = trim($description);
// 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');
Display::display_error_message(get_lang('GiveURL'));
$ok = false;

@ -342,7 +342,7 @@ if ($ncrit && is_array($strings)) {
reset($final_result);
$query_for_phrase_array = explode(" ",$query_for_phrase);
$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}|\$)";
while (list($spider_id,$weight) = each($final_result)) {
$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 {
$reg_strings = str_replace('@#@','|',phpdigPregQuotes(str_replace('\\','',implode('@#@',$strings))));
}
$stop_regs = "[][(){}[:blank:]=&?!&#%\$£*@+%:;,/\.'\"]";
$stop_regs = "[][(){}[:blank:]=&?!&#%\$<EFBFBD>*@+%:;,/\.'\"]";
switch($option) {
case 'any':
@ -641,7 +641,7 @@ else {
}
$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)) {
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);
$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;
} 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
if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
$last_login_date = $last_login_date_tmp;
@ -503,7 +503,7 @@ class MySpace {
} else {
$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());
} else {
$last_login_date = '-';
@ -623,9 +623,9 @@ class MySpace {
$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);
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;
} 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
if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
$last_login_date = $last_login_date_tmp;
@ -647,7 +647,7 @@ class MySpace {
} else {
$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());
} else {
$last_login_date = '-';
@ -835,9 +835,9 @@ class MySpace {
$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);
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;
} 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
if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
$last_login_date = $last_login_date_tmp;
@ -859,7 +859,7 @@ class MySpace {
} else {
$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());
} else {
$last_login_date = '-';
@ -985,9 +985,9 @@ class MySpace {
$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);
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;
} 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
if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
$last_login_date = $last_login_date_tmp;
@ -1009,7 +1009,7 @@ class MySpace {
} else {
$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());
} else {
$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)
{
return api_failure::set_failure('not_aicc_content');

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

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

@ -1016,7 +1016,7 @@ class learnpathItem {
$res = Database::query($sql);
if (Database::num_rows($res)==1) {
$row = Database::fetch_array($res);
if($update_local==true){
if ($update_local) {
$this->set_status($row['status']);
}
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;
foreach($list as $condition){
$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);}
break;
}
@ -1621,7 +1621,7 @@ class learnpathItem {
foreach($list as $condition){
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);
if($orstatus == true){
if ($orstatus) {
//shortcircuit OR
if(self::debug>1){error_log('New LP - One condition in OR was true, short-circuit',0);}
break;
@ -1711,7 +1711,7 @@ class learnpathItem {
}else{
if(self::debug>1){error_log('New LP - In learnpathItem::save() - SCORM save request received',0);}
//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);}
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
//now save into DB
$res = 0;
if( $inserted==false && Database::num_rows($check_res)<1){
if (!$inserted && Database::num_rows($check_res) < 1) {
/*$my_status = '';
if ($this->type!=TOOL_QUIZ) {
$my_status = $this->get_status(false);

@ -50,7 +50,7 @@ function FCKeditor_OnComplete( editorInstance ) {
}
function check_for_title() {
if (temp==true) {
if (temp) {
// 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.

@ -71,7 +71,7 @@ if($debug>0) error_log('New LP - Included aiccItem',0);
require_once('back_compat.inc.php');
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);
}
@ -117,7 +117,7 @@ if(isset($_SESSION['lpobject']))
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);
//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)){

@ -23,7 +23,7 @@ $path_name = $_SESSION['oLP']->get_name();
$path_id = $_SESSION['oLP']->get_id();
// 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
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);
}

@ -55,7 +55,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST'
require_once('scorm.class.php');
$oScorm = new scorm();
$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());
}
if(!empty($manifest)){

@ -35,7 +35,7 @@ require_once 'learnpath.class.php';
require_once 'learnpathItem.class.php';
//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
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
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 = '';

@ -854,12 +854,11 @@ function LMSFinish(val) {
olms.G_LastErrorMessage = 'No error';
// if olms.commit == false, then the SCORM didn't ask for a commit, so we
// should at least report that
if (( olms.commit == false )) {
if ( !olms.commit ) {
logit_scorm('LMSFinish() (no LMSCommit())',1);
}
//if ( olms.commit == true ) {
//if ( olms.commit ) {
logit_scorm('LMSFinish() called',1);
savedata('finish');
olms.commit = false;
@ -1017,7 +1016,7 @@ function addListeners(){
*/
function lms_save_asset(){
// only for dokeos lps
if (olms.execute_stats==true) {
if (olms.execute_stats) {
olms.execute_stats=false;
} else {
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
*/
function update_stats() {
if (olms.execute_stats==true) {
if (olms.execute_stats) {
try {
cont_f = document.getElementById('content_id');
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++) {
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]);
}
}
@ -1269,7 +1268,7 @@ function reinit_updatable_vars_list () {
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;
}
}

@ -92,7 +92,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
if ($check) {
$values = $form->exportValues();
$res = NotebookManager::save_note($values);
if ($res == true){
if ($res) {
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%">
<tr>
<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>
</tr>
</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)
{
if($course_admin==true)
if ($course_admin)
{
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)
{
if($course_admin==true)
if ($course_admin)
{
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) {
foreach ($ids as $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;
}
ob_start();

@ -79,7 +79,7 @@ if (isset ($_POST['action'])) {
if (count($ids) > 0) {
foreach ($ids as $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;
}
ob_start();

@ -27,7 +27,7 @@ if (isset($_GET['u'])) {
if (api_get_user_id() != $user_id) {
$user_info = UserManager::get_user_info_by_id($user_id);
$show_full_profile = false;
if ($user_info==false) {
if (!$user_info) {
// user does no exist !!
api_not_allowed();
} 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 ($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) {
$form -> addElement('html', '<div id="options_field" style="display:block">');

@ -33,7 +33,7 @@ $htmlHeadXtra[] =
"<script type=\"text/javascript\">
<!-- //
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[1].checked=true;
document.upload.if_exists[2].disabled=true;

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

@ -3491,7 +3491,7 @@ function WSSubscribeUsersToCourse($params) {
$result['result'] = 0;
} else {
$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;
}
}

@ -110,7 +110,7 @@ class WSCourse extends WS {
$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);
if($result == false) {
if (!$result) {
return new WSError(202, 'There was an error creating the course');
} else {
// Update extra fields
@ -478,7 +478,7 @@ class WSCourse extends WS {
$exists = true;
}
}
if($exists == false) {
if (!$exists) {
$cd->set_progress(0);
$cd->insert($course_info['db_name']);
} else {

@ -241,7 +241,7 @@ class WSSession extends WS {
SessionManager::suscribe_users_to_session($session_id, array($user_id));
} else {
$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');
}
}
@ -317,7 +317,7 @@ class WSSession extends WS {
return true;
} else {
$result = SessionManager::unsubscribe_course_from_session($session_id, $course_id);
if($result == true) {
if ($result) {
return true;
} else {
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'];
}
$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];
if($failure == 'login-pass already taken') {
return new WSError(102, 'This username is already taken');
@ -341,7 +341,7 @@ class WSUser extends WS {
$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);
if($result == false) {
if (!$result) {
$failure = $api_failureList[0];
if($failure == 'encrypt_method invalid') {
return new WSError(103, 'The encryption of the password is invalid');

@ -95,7 +95,7 @@
}
// line unchanged
elseif ( $show_equals == true )
elseif ( $show_equals )
{
$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;" >';
//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 '<div id="option4" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
@ -1472,7 +1472,7 @@ if ($_GET['action']=='edit')
echo '</div>';
//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 '<div id="option2" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
@ -1535,7 +1535,7 @@ if ($_GET['action']=='edit')
echo '</div>';
//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 '<div id="option1" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
echo '<table width="100%" border="0" style="font-weight:normal">';
@ -1578,7 +1578,7 @@ if ($_GET['action']=='edit')
echo '</div>';
//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 '<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>';

@ -577,7 +577,7 @@ return true;
echo '<div id="options" style="display:none; margin: 20px;" >';
//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 '<div id="option4" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
@ -593,7 +593,7 @@ return true;
echo '</div>';
//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 '<div id="option2" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
@ -656,7 +656,7 @@ return true;
echo '</div>';
//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 '<div id="option1" style="padding:4px; margin:5px; border:1px dotted; display:none;">';
echo '<table width="100%" border="0" style="font-weight:normal">';
@ -680,7 +680,7 @@ return true;
echo '</div>';
//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 '<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>';

@ -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_hour, $d_minute) = split(':', $parts[1]);
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">');
$weight_input2[] = FormValidator :: createElement('text', 'weight');
$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') {
$homework['expires_on'] = date('Y-m-d H:i:s');
$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 -> addGroup(create_group_date_select(), 'expires', get_lang('ExpiresAt'));
$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') {
$homework['ends_on'] = date('Y-m-d H:i:s');
$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 -> addGroup(create_group_date_select(), 'ends', get_lang('EndsAt'));
$form_folder -> addElement('html', '</div>');
@ -562,7 +562,7 @@ function display_student_publications_list($work_dir, $sub_course_dir, $currentC
$values = $values['my_group'];
$dir_name = replace_dangerous_char($values['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);
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_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.innerHTML="'.get_lang('EndDateCannotBeBeforeTheExpireDate', '').'";
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.innerHTML="'.get_lang('InvalidDate', '').'";
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";
@ -1393,7 +1393,7 @@ function to_javascript_work() {
else
{
if (document.form1.make_calification.checked == true)
if (document.form1.make_calification.checked)
{
var weight = document.form1.weight.value;
if(weight==""){

@ -1331,7 +1331,7 @@ if ($is_course_member) {
$addtext .= '<table cellspacing="0" cellpading="0" border="0"><tr>';
$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="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 .= '<div id="msg_error_weight" style="display:none;color:red"></div>';
$addtext .= '&nbsp;&nbsp;'.get_lang('WeightInTheGradebook').'&nbsp;';
@ -1339,12 +1339,12 @@ if ($is_course_member) {
$addtext .= '</tr></table>';
$addtext .= '<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_error3" style="display:none;color:red"></span>';
$addtext .= '<div id="option2" style="padding:4px;display:none">&nbsp;&nbsp;';
$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 .= '&nbsp;&nbsp;&nbsp;<div id="msg_error4" style="display:none;color:red"></div>';
$addtext .= draw_date_picker('ends').'<br />';

@ -400,7 +400,7 @@ class UnitTestCase extends SimpleTestCase {
* @access private
*/
function _coerceExpectation($expected) {
if ($expected == false) {
if (!$expected) {
return new TrueExpectation();
}
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
$friend_id = UserManager::get_user_id_from_username($username);
if ($friend_id != false) {
if ($friend_id) {
SocialManager::display_individual_user($friend_id);
/*
if (api_get_setting('allow_social_tool') =='true') {

@ -1643,7 +1643,7 @@ echo '<div id="social_widget">';
echo ' <div id="social_widget_image">';
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>';
} 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>';

Loading…
Cancel
Save