Feature #1744 - Cleaning logical conditions (3).

skala
Ivan Tcholakov 16 years ago
parent 7515a2354b
commit c7b44cc1e9
  1. 2
      main/inc/course_document.inc.php
  2. 4
      main/inc/lib/attendance.lib.php
  3. 6
      main/inc/lib/course.lib.php
  4. 11
      main/inc/lib/fckeditor/editor/dialog/fck_scayt.html
  5. 4
      main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js
  6. 6
      main/inc/lib/fckeditor/editor/dialog/fck_template.html
  7. 2
      main/inc/lib/fckeditor/editor/filemanager/browser/default/browser.html
  8. 2
      main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/ImageEditor.php
  9. 34
      main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/ImageManager.php
  10. 4
      main/inc/lib/fckeditor/editor/plugins/ImageManager/assets/editor.js
  11. 14
      main/inc/lib/fckeditor/editor/plugins/ImageManager/editor.php
  12. 6
      main/inc/lib/fckeditor/editor/plugins/ImageManager/editorFrame.php
  13. 6
      main/inc/lib/fckeditor/editor/plugins/ImageManager/images.php
  14. 4
      main/inc/lib/fckeditor/editor/plugins/ImageManager/manager.php
  15. 2
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/_ajax_get_details_listing.php
  16. 2
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/_ajax_get_thumbnail_listing.php
  17. 2
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajax_get_file_listing.php
  18. 4
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.file.php
  19. 2
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.image.php
  20. 2
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.manager.php
  21. 4
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/function.base.php
  22. 6
      main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.js
  23. 28
      main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/imgmap.js
  24. 2
      main/inc/lib/fckeditor/editor/plugins/youtube/youtube.js
  25. 2
      main/inc/lib/fckeditor/fckeditor.php
  26. 2
      main/inc/lib/fileUpload.lib.php
  27. 2
      main/inc/lib/glossary.lib.php
  28. 10
      main/inc/lib/group_portal_manager.lib.php
  29. 2
      main/inc/lib/groupmanager.lib.php
  30. 10
      main/inc/lib/main_api.lib.php
  31. 6
      main/inc/lib/sessionmanager.lib.php
  32. 12
      main/inc/lib/social.lib.php
  33. 2
      main/inc/lib/tablesort.lib.php
  34. 2
      main/inc/lib/thematic.lib.php
  35. 10
      main/inc/lib/tracking.lib.php
  36. 16
      main/inc/lib/usermanager.lib.php
  37. 4
      main/inc/local.inc.php

@ -270,7 +270,7 @@ function OpenFile( fileUrl, type )
if (type=="audio")
{
ret = confirm('<?php echo api_utf8_encode(get_lang('AutostartMp3')); ?>');
if (ret==true)
if (ret)
{
GetE('autostart').checked = true;
}

@ -178,7 +178,7 @@ class Attendance
if ($link_to_gradebook) {
$description = '';
$link_id=is_resource_in_course_gradebook($course_code,7,$last_id,$session_id);
if ($link_id==false) {
if (!$link_id) {
add_resource_to_course_gradebook($course_code, 7, $last_id, $title_gradebook,$weight_calification,$value_calification,$description,time(),1,$session_id);
} else {
Database::query('UPDATE '.$table_link.' SET weight='.$weight_calification.' WHERE id='.$link_id.'');
@ -223,7 +223,7 @@ class Attendance
if ($link_to_gradebook) {
$description = '';
$link_id=is_resource_in_course_gradebook($course_code,7,$attendance_id,$session_id);
if ($link_id==false) {
if (!$link_id) {
add_resource_to_course_gradebook($course_code, 7, $attendance_id, $title_gradebook,$weight_calification,$value_calification,$description,time(),1,$session_id);
} else {
Database::query('UPDATE '.$table_link.' SET weight='.$weight_calification.' WHERE id='.$link_id.'');

@ -440,7 +440,7 @@ class CourseManager {
$sql_course = "SELECT course_code FROM $table_field cf INNER JOIN $t_cfv cfv ON cfv.field_id=cf.id WHERE field_variable='$original_course_id_name' AND field_value='$original_course_id_value'";
$res = Database::query($sql_course);
$row = Database::fetch_object($res_course);
if($row != false) {
if ($row) {
return $row->course_code;
} else {
return 0;
@ -458,7 +458,7 @@ class CourseManager {
$sql = "SELECT code FROM course WHERE id = '$id';";
$res = Database::query($sql);
$row = Database::fetch_object($res);
if($row != false) {
if ($row) {
return $row->code;
} else {
return null;
@ -2199,7 +2199,7 @@ class CourseManager {
$data = '';
foreach ($descriptions as $id => $description) {
$data .= '<div class="sectiontitle">';
if (api_is_allowed_to_edit() && $action_show == true) {
if (api_is_allowed_to_edit() && $action_show) {
//delete
$data .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;action=delete&amp;description_id='.$description->id.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;">';
$data .= Display::return_icon('delete.gif', get_lang('Delete'), array('style' => 'vertical-align:middle;float:right;'));

@ -325,13 +325,12 @@
var that = get.wrap(this);
var isCheck = that.getAttr("checked");
//console.info(isCheck)
if ( isCheck == false ) {
//that.setAttr("checked",false);
options[ this.name ] = 0;
}else{
//that.setAttr("checked",true);
if ( isCheck ) {
//that.setAttr("checked", true);
options[ this.name ] = 1;
} else {
//that.setAttr("checked", false);
options[ this.name ] = 0;
}
//console.info(options)
});

@ -72,7 +72,7 @@ function clearSuggestions() {
function enableUndo() {
if( this.undoButton ) {
if( this.undoButton.disabled == true ) {
if( this.undoButton.disabled ) {
this.undoButton.disabled = false;
}
}
@ -80,7 +80,7 @@ function enableUndo() {
function disableUndo() {
if( this.undoButton ) {
if( this.undoButton.disabled == false ) {
if( !this.undoButton.disabled ) {
this.undoButton.disabled = true;
}
}

@ -86,9 +86,9 @@ window.onload = function()
//window.parent.SetAutoSize( true ) ;
LoadTemplatesXml() ;
// select first by default (Chamilo customization)
if(window.top.load_default_template==true)
SelectTemplate(0);
// Select first by default (Chamilo customization)
if ( window.top.load_default_template )
SelectTemplate( 0 ) ;
}
function LoadTemplatesXml()

@ -226,7 +226,7 @@ oIcons.GetIcon = function( fileName )
break ;
}
if ( this.AvailableIcons[ sExtension ] == true )
if ( this.AvailableIcons[ sExtension ] )
return sExtension ;
else
return 'default.icon' ;

@ -237,7 +237,7 @@ class ImageEditor
$newSaveFile = $this->makeRelative($relative, $saveFile);
$oldSaveFile = $newSaveFile;
if ($this->manager->config['allow_newFileName'] && $this->manager->config['allow_overwrite'] == false)
if ($this->manager->config['allow_newFileName'] && !$this->manager->config['allow_overwrite'])
{
// check whether a file already exist and if there is, create a variant of the filename
$newName = $this->getUniqueFilename($newSaveFile);

@ -103,7 +103,7 @@ class ImageManager
$base = Files::fixPath($base);
$dirs = array();
if($this->isValidBase() == false)
if (!$this->isValidBase())
return $dirs;
$d = @dir($base);
@ -128,7 +128,7 @@ class ImageManager
&& strpos($entry, 'css') === false
&& strpos($entry, 'HotPotatoes_files') === false
&& ($in_group || (!$in_group && strpos($entry, '_groupdocs') === false))
&& $this->isThumbDir($entry) == false)
&& !$this->isThumbDir($entry))
{
$relative = Files::fixPath($path.$entry);
$fullpath = Files::fixPath($base.$entry);
@ -186,7 +186,7 @@ class ImageManager
$files = array();
$dirs = array();
if($this->isValidBase() == false)
if (!$this->isValidBase())
return array($files,$dirs);
$path = Files::fixPath($path);
@ -249,7 +249,7 @@ class ImageManager
*/
}
if($is_dir && $this->isThumbDir($entry) == false) {
if ($is_dir && !$this->isThumbDir($entry)) {
global $_course;
if (isset($_course['dbName']) && $_course<>'-1') {
//checking visibility
@ -270,7 +270,7 @@ class ImageManager
$count = $this->countFiles($full);
$dirs[$relative] = array('fullpath'=>$full,'entry'=>$entry,'count'=>$count);
}
else if(is_file($fullpath.$entry) && $this->isThumb($entry)==false && $this->isTmpFile($entry) == false)
else if(is_file($fullpath.$entry) && !$this->isThumb($entry) && !$this->isTmpFile($entry))
{
$img = $this->getImageInfo($fullpath.$entry);
@ -323,11 +323,11 @@ class ImageManager
while (false !== ($entry = $d->read()))
{
//echo $entry."<br>";
if(substr($entry,0,1) != '.'
&& $this->isThumbDir($entry) == false
&& $this->isTmpFile($entry) == false
&& $this->isThumb($entry) == false)
//echo $entry."<br />";
if (substr($entry, 0, 1) != '.'
&& !$this->isThumbDir($entry)
&& !$this->isTmpFile($entry)
&& !$this->isThumb($entry))
{
$total++;
}
@ -369,7 +369,7 @@ class ImageManager
*/
function isThumbDir($entry)
{
if($this->config['thumbnail_dir'] == false
if (!$this->config['thumbnail_dir']
|| strlen(trim($this->config['thumbnail_dir'])) == 0)
Return false;
else
@ -402,7 +402,7 @@ class ImageManager
$thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename'];
if($this->config['safe_mode'] == true
if ($this->config['safe_mode']
|| strlen(trim($this->config['thumbnail_dir'])) == 0)
{
Return Files::makeFile($path_parts['dirname'],$thumbnail);
@ -436,7 +436,7 @@ class ImageManager
$thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename'];
if($path_parts['dirname']=='\\') $path_parts['dirname']='/';
if($this->config['safe_mode'] == true
if ($this->config['safe_mode']
|| strlen(trim($this->config['thumbnail_dir'])) == 0)
{
$path = Files::fixPath($path_parts['dirname']);
@ -494,7 +494,7 @@ class ImageManager
*/
function processUploads()
{
if($this->isValidBase() == false)
if (!$this->isValidBase())
return;
$relative = null;
@ -571,7 +571,7 @@ class ImageManager
}
// Checking for a valid image by reading binary file (partially in most cases).
if($this->config['validate_images'] == true)
if ($this->config['validate_images'])
{
$imgInfo = @getImageSize($file['tmp_name']);
if(!is_array($imgInfo))
@ -756,7 +756,7 @@ class ImageManager
{
$fullpath = Files::makeFile($this->getBaseDir(),$relative);
//check that the file is an image
if($this->config['validate_images'] == true)
if ($this->config['validate_images'])
{
if(!is_array($this->getImageInfo($fullpath)))
return false; //hmmm not an Image!!???
@ -821,7 +821,7 @@ class ImageManager
*/
function processNewDir()
{
if($this->config['safe_mode'] == true)
if ($this->config['safe_mode'])
Return false;
if(isset($_GET['newDir']) && isset($_GET['dir']))

@ -19,7 +19,7 @@
{
editor.window.document.getElementById("imgCanvas").style.display = "block";
editor.window.document.getElementById("background").style.display = "none";
if (editor.window.watermarkingEnabled == true)
if (editor.window.watermarkingEnabled)
{
editor.window.dd.elements.floater.hide();
}
@ -55,7 +55,7 @@
{
editor.window.document.getElementById("imgCanvas").style.display = "none";
editor.window.document.getElementById("background").style.display = "block";
if (editor.window.watermarkingEnabled == true)
if (editor.window.watermarkingEnabled)
{
editor.window.dd.elements.floater.show();
editor.window.dd.elements.floater.moveTo(0, 0);

@ -287,12 +287,12 @@ body {
</div>
<div id="tools_save" style="display:none;">
<?php if($IMConfig['demo'] != true) { ?>
<?php if (!$IMConfig['demo']) { ?>
<div id="tool_inputs">
<?php if($IMConfig['allow_newFileName'] == true) { ?>
<label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<?php if($IMConfig['allow_overwrite'] == false){ echo $editor->getDefaultSaveFile(); }else{ echo basename($clean_img); } ?>" />
<?php if ($IMConfig['allow_newFileName']) { ?>
<label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<?php if (!$IMConfig['allow_overwrite']) { echo $editor->getDefaultSaveFile(); }else{ echo basename($clean_img); } ?>" />
<?php }else{ ?>
<input type="hidden" id="save_filename" value="<?php echo basename($clean_img); ?>" />
<?php } ?>
@ -301,13 +301,13 @@ body {
$pos = strrpos($clean_img, ".");
$ext = substr($clean_img, $pos + 1);
?>
<select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle; <?php if($IMConfig['allow_newFileName'] != true && $ext != "jpg" && $ext != "jpeg") {echo "display: none;";} ?>" onchange="updateFormat(this)">
<select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle; <?php if (!$IMConfig['allow_newFileName'] && $ext != "jpg" && $ext != "jpeg") {echo "display: none;";} ?>" onchange="updateFormat(this)">
<option value="" selected>Image Format</option>
<option value="">---------------------</option>
<option value="jpeg,85">JPEG High</option>
<option value="jpeg,60">JPEG Medium</option>
<option value="jpeg,35">JPEG Low</option>
<?php if($IMConfig['allow_newFileName'] == true){ ?>
<?php if ($IMConfig['allow_newFileName']) { ?>
<option value="png">PNG</option>
<?php if($editor->isGDGIFAble() != -1) { ?>
<option value="gif">GIF</option>
@ -344,8 +344,8 @@ body {
<div id="toolbar">
<div id="buttons">
<a href="javascript:toggle('replace')" id="icon_replace" title="Replace" <?php if($IMConfig['allow_replace'] == false) { echo "style=\"display: none;\""; } ?> ><img src="img/replace.gif" height="20" width="20" alt="Replace" /><span>Replace</span></a>
<a href="javascript:toggle('watermark')" id="icon_watermark" title="Watermark" <?php if(empty($IMConfig['watermarks'])) { echo "style=\"display: none;\""; } ?> ><img src="img/watermark.gif" height="20" width="20" alt="Watermark" /><span>Watermark</span></a>
<a href="javascript:toggle('replace')" id="icon_replace" title="Replace" <?php if (!$IMConfig['allow_replace']) { echo "style=\"display: none;\""; } ?> ><img src="img/replace.gif" height="20" width="20" alt="Replace" /><span>Replace</span></a>
<a href="javascript:toggle('watermark')" id="icon_watermark" title="Watermark" <?php if (empty($IMConfig['watermarks'])) { echo "style=\"display: none;\""; } ?> ><img src="img/watermark.gif" height="20" width="20" alt="Watermark" /><span>Watermark</span></a>
<a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a>
<a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a>
<a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a>

@ -160,7 +160,7 @@
// save message
var message = i18n('File saved.');
<?php
if ($editor->forcedNewName != false)
if ($editor->forcedNewName)
{
?>
message += '\n' + i18n('File name was changed into ') + '<?php echo $editor->forcedNewName; ?>';
@ -273,10 +273,10 @@
<script type="text/javascript">
// <![CDATA[
if (watermarkingEnabled == true)
if (watermarkingEnabled)
{
SET_DHTML("background"+NO_DRAG, "floater"+CURSOR_MOVE);
if (window.firstWatermarkItemUnavailable == true)
if (window.firstWatermarkItemUnavailable)
{
dd.elements.floater.swapImage(eval("window." + watermarkBox.options[0].value + "Preload.src"));
}

@ -56,10 +56,10 @@ function drawFiles($list, &$manager)
<td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">
<a href="javascript: void(0);" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo $entry; ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);"title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"><img src="<?php echo $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"/></a>
</td></tr><tr><td class="edit" style="padding-top: 5px;">
<?php if($IMConfig['allow_delete'] == true) { ?>
<?php if ($IMConfig['allow_delete']) { ?>
<a href="images.php?dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<?php echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
<?php } ?>
<?php if($IMConfig['allow_edit'] == true) { ?>
<?php if ($IMConfig['allow_edit']) { ?>
<a href="javascript: void(0);" title="Edit" onclick="editImage('<?php echo rawurlencode($file['relative']);?>');"><img src="img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a>
<?php } ?>
<?php if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?>
@ -209,7 +209,7 @@ function drawErrorBase(&$manager)
</head>
<body dir="<?php echo $IMConfig['text_direction']; ?>">
<?php if ($manager->isValidBase() == false) { drawErrorBase($manager); }
<?php if (!$manager->isValidBase()) { drawErrorBase($manager); }
elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?>
<table>
<tr>

@ -153,7 +153,7 @@ body {
<?php } ?>
</select>
<a href="javascript: void(0);" onclick="javascript: goUpDir();" title="Directory Up"><img src="img/btnFolderUp.gif" height="15" width="15" alt="Directory Up" />&nbsp;<span>Directory Up</span></a>
<?php if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?>
<?php if (!$IMConfig['safe_mode'] && $IMConfig['allow_new_dir']) { ?>
<a href="javascript: void(0);" onclick="newFolder();" title="New Folder"><img src="img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a>
<?php } ?>
<div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div>
@ -182,7 +182,7 @@ body {
<td><input type="text" id="f_horiz" class="smallWidth" value="" /></td>
</tr>
<tr>
<?php if($IMConfig['allow_upload'] == true) { ?>
<?php if ($IMConfig['allow_upload']) { ?>
<td align="right"><label for="upload">Upload</label></td>
<td>
<table cellpadding="0" cellspacing="0" border="0">

@ -54,7 +54,7 @@
///Second step: hiding as the case
//Juan Carlos Raña
if((!ereg($deleted_by_dokeos_file, $file['name']) || !ereg($deleted_by_dokeos_folder, $file['path'])) && !ereg($css_folder_dokeos, $file['path']) && !ereg($hotpotatoes_folder_dokeos, $file['path']) && !ereg($chat_files_dokeos, $file['path']) && $show_doc_group==true && $file['name'][0]!='.')
if((!ereg($deleted_by_dokeos_file, $file['name']) || !ereg($deleted_by_dokeos_folder, $file['path'])) && !ereg($css_folder_dokeos, $file['path']) && !ereg($hotpotatoes_folder_dokeos, $file['path']) && !ereg($chat_files_dokeos, $file['path']) && $show_doc_group && $file['name'][0]!='.')
{
if($file['type'] == 'file')
{

@ -37,7 +37,7 @@
///Second step: hiding as the case
//Juan Carlos Ra<EFBFBD>a
if((!ereg($deleted_by_dokeos_file, $file['name']) || !ereg($deleted_by_dokeos_folder, $file['path'])) && !ereg($css_folder_dokeos, $file['path']) && !ereg($hotpotatoes_folder_dokeos, $file['path']) && !ereg($chat_files_dokeos, $file['path']) && $show_doc_group==true && $file['name'][0]!='.')
if((!ereg($deleted_by_dokeos_file, $file['name']) || !ereg($deleted_by_dokeos_folder, $file['path'])) && !ereg($css_folder_dokeos, $file['path']) && !ereg($hotpotatoes_folder_dokeos, $file['path']) && !ereg($chat_files_dokeos, $file['path']) && $show_doc_group && $file['name'][0]!='.')
{
?>

@ -115,7 +115,7 @@
}
if((!ereg($deleted_by_dokeos_file, $file['name']) || !ereg($deleted_by_dokeos_folder, $file['path'])) || ereg($css_folder_dokeos, $file['path']) || ereg($hotpotatoes_folder_dokeos, $file['path']) || ereg($chat_files_dokeos, $file['path']) || $hide_doc_group==true || $file['name'][0]=='.')//Dokeos fix for hidden items.
if((!ereg($deleted_by_dokeos_file, $file['name']) || !ereg($deleted_by_dokeos_folder, $file['path'])) || ereg($css_folder_dokeos, $file['path']) || ereg($hotpotatoes_folder_dokeos, $file['path']) || ereg($chat_files_dokeos, $file['path']) || $hide_doc_group || $file['name'][0]=='.')//Dokeos fix for hidden items.
{
$count_hideItem=$count_hideItem+1;

@ -366,7 +366,7 @@
* @param boolean $empty
* @return boolean
*/
function __recursive_remove_directory($directory, $empty=FALSE)
function __recursive_remove_directory($directory, $empty = FALSE)
{
// if the path has a slash at the end we remove it here
if(substr($directory,-1) == '/')
@ -418,7 +418,7 @@
@closedir($handle);
// if the option to empty is not set to true
if($empty == FALSE)
if (!$empty)
{
// try to delete the now empty directory
if(!@rmdir($directory))

@ -488,7 +488,7 @@
$giftype = ($write) ? ' Create Support' : ' Read Support';
$support = strtoupper($extension) . ($extension == 'gif' ? $giftype : ' Support');
if (!isset($this->gdInfo[$support]) || $this->gdInfo[$support] == false) {
if (!isset($this->gdInfo[$support]) || !$this->gdInfo[$support]) {
$request = ($write) ? 'saving' : 'reading';
$this->_debug("Support for $request the file type '$extension' cannot be found.");
return false;

@ -203,7 +203,7 @@ class manager
}
if(ereg($deleted_by_dokeos_folder, $path)|| ereg($css_folder_dokeos, $path) || ereg($hotpotatoes_folder_dokeos, $path) || ereg($chat_files_dokeos, $path) || $hide_doc_group==true || $file[0]=='.')
if(ereg($deleted_by_dokeos_folder, $path)|| ereg($css_folder_dokeos, $path) || ereg($hotpotatoes_folder_dokeos, $path) || ereg($chat_files_dokeos, $path) || $hide_doc_group || $file[0]=='.')
{
$this->currentFolderInfo['subdir']=$this->currentFolderInfo['subdir']-1;
}

@ -864,7 +864,7 @@ function getRootPath() {
}
}
if(!ereg($deleted_by_dokeos, $folderName) && !ereg($css_folder_dokeos, $folderName) && !ereg($hotpotatoes_folder_dokeos, $folderName) && !ereg($chat_files_dokeos, $folderName) && !ereg($thumbs_folder, $folderName) && $show_doc_group==true)
if(!ereg($deleted_by_dokeos, $folderName) && !ereg($css_folder_dokeos, $folderName) && !ereg($hotpotatoes_folder_dokeos, $folderName) && !ereg($chat_files_dokeos, $folderName) && !ereg($thumbs_folder, $folderName) && $show_doc_group)
{
return substr($folderName,strpos($folderName, '-'),strlen($folderName)); //hide the firsts numbers
}
@ -1169,7 +1169,7 @@ function getRootPath() {
if ( $old_x >= 0 && $old_x < $src_x
&& $old_y >= 0 && $old_y < $src_y ) {
if ($bicubic == true) {
if ($bicubic) {
$sY = $old_y + 1;
$siY = $old_y;
$siY2 = $old_y - 1;

@ -220,7 +220,7 @@ function LoadSelection()
function Ok()
{
var rbFileTypeVal = "single" ;
if ( GetE( 'rbFileType' ).checked == false )
if ( !GetE( 'rbFileType' ).checked )
{
rbFileTypeVal = "list" ;
}
@ -449,7 +449,7 @@ Media.prototype.getInnerHTML = function ( objectId )
var thisHeight = this.height ;
var thisMediaType = "single" ;
if ( GetE( 'rbFileType' ).checked == false )
if ( !GetE( 'rbFileType' ).checked )
{
thisMediaType = "mpl" ;
}
@ -617,7 +617,7 @@ Media.prototype.getInnerHTML = function ( objectId )
}
s += ' s1.addVariable("shuffle","false");\n' ;
if (this.loop == true)
if (this.loop)
{
s += ' s1.addVariable("repeat","list");\n' ;
}

@ -772,7 +772,7 @@ this.areas[id].style.borderStyle="solid";
this.areas[id].style.borderColor=this.config.CL_NORM_SHAPE;
}else{
if(this.areas[id].shape=="circle"||this.areas[id].shape=="polygon"){
if(this.config.bounding_box==true){
if(this.config.bounding_box){
this.areas[id].style.borderWidth="1px";
this.areas[id].style.borderStyle="solid";
this.areas[id].style.borderColor=this.config.CL_NORM_BOX;
@ -852,7 +852,7 @@ if(!this.areas[id].label){
return;
}
try{
if(this.config.label==""||this.config.label==false){
if(this.config.label=="" || !this.config.label){
this.areas[id].label.innerHTML="";
this.areas[id].label.style.display="none";
}else{
@ -874,7 +874,7 @@ this.log("Error putting label",1);
};
imgmap.prototype._puthint=function(id){
try{
if(this.config.hint==""||this.config.hint==false){
if(this.config.hint=="" || !this.config.hint){
this.areas[id].title="";
this.areas[id].alt="";
}else{
@ -1411,7 +1411,7 @@ this.is_drawing=this.DM_POLYGON_DRAW;
this.statusMessage(this.strings["POLYGON_DRAW"]);
this.areas[this.currentid].style.left=x+"px";
this.areas[this.currentid].style.top=y+"px";
if(this.config.bounding_box==true){
if(this.config.bounding_box){
this.areas[this.currentid].style.borderWidth="1px";
this.areas[this.currentid].style.borderStyle="dotted";
this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
@ -1439,7 +1439,7 @@ this.is_drawing=this.DM_SQUARE_DRAW;
this.statusMessage(this.strings["SQUARE_DRAW"]);
this.areas[this.currentid].style.left=x+"px";
this.areas[this.currentid].style.top=y+"px";
if(this.config.bounding_box==true){
if(this.config.bounding_box){
this.areas[this.currentid].style.borderWidth="1px";
this.areas[this.currentid].style.borderStyle="dotted";
this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
@ -1472,7 +1472,7 @@ this.areas[id].style.borderStyle="solid";
this.areas[id].style.borderColor=this.config.CL_HIGHLIGHT_SHAPE;
}else{
if(this.areas[id].shape=="circle"||this.areas[id].shape=="polygon"){
if(this.config.bounding_box==true){
if(this.config.bounding_box){
this.areas[id].style.borderWidth="1px";
this.areas[id].style.borderStyle="solid";
this.areas[id].style.borderColor=this.config.CL_HIGHLIGHT_BOX;
@ -1503,7 +1503,7 @@ this.areas[id].style.borderStyle="solid";
this.areas[id].style.borderColor=this.config.CL_NORM_SHAPE;
}else{
if(this.areas[id].shape=="circle"||this.areas[id].shape=="polygon"){
if(this.config.bounding_box==true){
if(this.config.bounding_box){
this.areas[id].style.borderWidth="1px";
this.areas[id].style.borderStyle="solid";
this.areas[id].style.borderColor=this.config.CL_NORM_BOX;
@ -1652,7 +1652,7 @@ if(_9e<6&&_9f>6){
if(this.areas[this.currentid].shape=="circle"){
this.is_drawing=this.DM_SQUARE_RESIZE_LEFT;
this.statusMessage(this.strings["SQUARE_RESIZE_LEFT"]);
if(this.config.bounding_box==true){
if(this.config.bounding_box){
this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
}
}else{
@ -1667,7 +1667,7 @@ if(_9e>parseInt(this.areas[this.currentid].style.width)-6&&_9f>6){
if(this.areas[this.currentid].shape=="circle"){
this.is_drawing=this.DM_SQUARE_RESIZE_RIGHT;
this.statusMessage(this.strings["SQUARE_RESIZE_RIGHT"]);
if(this.config.bounding_box==true){
if(this.config.bounding_box){
this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
}
}else{
@ -1682,7 +1682,7 @@ if(_9e>6&&_9f<6){
if(this.areas[this.currentid].shape=="circle"){
this.is_drawing=this.DM_SQUARE_RESIZE_TOP;
this.statusMessage(this.strings["SQUARE_RESIZE_TOP"]);
if(this.config.bounding_box==true){
if(this.config.bounding_box){
this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
}
}else{
@ -1697,7 +1697,7 @@ if(_9f>parseInt(this.areas[this.currentid].style.height)-6&&_9e>6){
if(this.areas[this.currentid].shape=="circle"){
this.is_drawing=this.DM_SQUARE_RESIZE_BOTTOM;
this.statusMessage(this.strings["SQUARE_RESIZE_BOTTOM"]);
if(this.config.bounding_box==true){
if(this.config.bounding_box){
this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
}
}else{
@ -1711,7 +1711,7 @@ this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_SHAPE;
if(this.areas[this.currentid].shape=="circle"){
this.is_drawing=this.DM_SQUARE_MOVE;
this.statusMessage(this.strings["SQUARE_MOVE"]);
if(this.config.bounding_box==true){
if(this.config.bounding_box){
this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
}
this.memory[this.currentid].rdownx=_9e;
@ -1731,7 +1731,7 @@ this.memory[this.currentid].ypoints[i]=this.areas[this.currentid].ypoints[i];
}
this.is_drawing=this.DM_POLYGON_MOVE;
this.statusMessage(this.strings["POLYGON_MOVE"]);
if(this.config.bounding_box==true){
if(this.config.bounding_box){
this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
}
this.memory[this.currentid].rdownx=_9e;
@ -1752,7 +1752,7 @@ this.areas[this.currentid].style.borderWidth="1px";
this.areas[this.currentid].style.borderStyle="dotted";
}else{
if(this.areas[this.currentid].shape=="circle"||this.areas[this.currentid].shape=="polygon"){
if(this.config.bounding_box==true){
if(this.config.bounding_box){
this.areas[this.currentid].style.borderWidth="1px";
this.areas[this.currentid].style.borderStyle="dotted";
}

@ -118,7 +118,7 @@ function Ok()
}
// Check security
if ( checkCode( GetE( 'txtUrl' ).value ) == false )
if ( !checkCode( GetE( 'txtUrl' ).value ) )
{
alert( oEditor.FCKLang.DlgYouTubeSecurity ) ;
return false ;

@ -241,7 +241,7 @@ class FCKeditor
foreach ( $this->Config as $sKey => $sValue )
{
if ( $bFirst == false ) {
if ( !$bFirst ) {
$sParams .= '&amp;' ;
} else {
$bFirst = false ;

@ -1342,7 +1342,7 @@ function api_replace_parameter($upload_path, $buffer, $param_name = 'src') {
//$message .= "In tag $count, <b>" . htmlentities($tag_list[$count])
// . "</b>, parameter <b>" . $replace_what[$count] . "</b> replaced by <b>" . $replace_by[$count] . "</b><br>"; //debug
}
//if (isset($message) && $message == true) api_display_debug_info($message); //debug
//if ($message) api_display_debug_info($message); //debug
$buffer = str_replace($replace_what, $replace_by, $buffer);
return $buffer;
}

@ -521,7 +521,7 @@ class GlossaryManager {
$res = Database::query($sql);
$found = false;
while ($row = Database::fetch_array($res)) {
if ($found == true and empty($next_id)) {
if ($found && empty($next_id)) {
$next_id = $row['glossary_id'];
$next_display_order = $row['display_order'];
}

@ -165,7 +165,7 @@ class GroupPortalManager
}
}
if ($show_tag_links == true) {
if ($show_tag_links) {
if (is_array($tags) && count($tags)>0) {
foreach ($tags as $tag) {
$tag_tmp[] = '<a href="'.api_get_path(WEB_PATH).'main/social/search.php?q='.$tag['tag'].'">'.$tag['tag'].'</a>';
@ -208,7 +208,7 @@ class GroupPortalManager
$array = array();
if (Database::num_rows($result) > 0) {
while ($row = Database::fetch_array($result, 'ASSOC')) {
if ($with_image == true) {
if ($with_image) {
$picture = self::get_picture_group($row['id'], $row['picture_uri'],80);
$img = '<img src="'.$picture['file'].'" />';
$row['picture_uri'] = $img;
@ -245,7 +245,7 @@ class GroupPortalManager
$result=Database::query($sql);
$array = array();
while ($row = Database::fetch_array($result, 'ASSOC')) {
if ($with_image == true) {
if ($with_image) {
$picture = self::get_picture_group($row['id'], $row['picture_uri'],80);
$img = '<img src="'.$picture['file'].'" />';
$row['picture_uri'] = $img;
@ -279,7 +279,7 @@ class GroupPortalManager
$result=Database::query($sql);
$array = array();
while ($row = Database::fetch_array($result, 'ASSOC')) {
if ($with_image == true) {
if ($with_image) {
$picture = self::get_picture_group($row['id'], $row['picture_uri'],80);
$img = '<img src="'.$picture['file'].'" />';
$row['picture_uri'] = $img;
@ -339,7 +339,7 @@ class GroupPortalManager
$result=Database::query($sql);
$array = array();
while ($row = Database::fetch_array($result, 'ASSOC')) {
if ($with_image == true) {
if ($with_image) {
$image_path = UserManager::get_user_picture_path_by_id($row['user_id'], 'web', false, true);
$picture = UserManager::get_picture_user($row['user_id'], $image_path['file'],$image_conf['height'],$image_conf['size']);
$row['image'] = '<img src="'.$picture['file'].'" '.$picture['style'].' />';

@ -1082,7 +1082,7 @@ class GroupManager {
$users = array ();
while ($user = Database::fetch_object($db_result))
{
if ($id_only==false)
if (!$id_only)
{
$member['user_id'] = $user->user_id;
$member['firstname'] = $user->firstname;

@ -1590,7 +1590,7 @@ function api_get_session_condition($session_id, $and = true, $with_base_content
$session_id = intval($session_id);
//condition to show resources by session
$condition_session = '';
$condition_add = $and == false ? " WHERE " : " AND ";
$condition_add = $and ? " AND " : " WHERE ";
if ($with_base_content) {
$condition_session = $condition_add." (session_id = $session_id OR session_id = 0) ";
@ -1979,12 +1979,12 @@ function api_is_allowed_to_edit($tutor = false, $coach = false, $session_coach =
$is_allowed_coach_to_edit = api_is_coach();
$session_visibility = api_get_session_visibility($my_session_id);
$is_courseAdmin = api_is_course_admin() || api_is_platform_admin();
if (!$is_courseAdmin && $tutor == true) { // If we also want to check if the user is a tutor...
if (!$is_courseAdmin && $tutor) { // If we also want to check if the user is a tutor...
$is_courseAdmin = $is_courseAdmin || api_is_course_tutor();
}
if (!$is_courseAdmin && $coach == true) { // If we also want to check if the user is a coach...';
if (!$is_courseAdmin && $coach) { // If we also want to check if the user is a coach...';
// Check if session visibility is read only for coachs
if ($session_visibility==SESSION_VISIBLE_READ_ONLY) {
if ($session_visibility == SESSION_VISIBLE_READ_ONLY) {
$is_allowed_coach_to_edit = false;
}
@ -1995,7 +1995,7 @@ function api_is_allowed_to_edit($tutor = false, $coach = false, $session_coach =
}
}
if (!$is_courseAdmin && $session_coach == true) {
if (!$is_courseAdmin && $session_coach) {
$is_courseAdmin = $is_courseAdmin || api_is_coach();
}

@ -360,7 +360,7 @@ class SessionManager {
}
if ($send_email == true) {
if ($send_email) {
global $_configuration;
//sending emails only
if(is_array($user_list) && count($user_list)>0) {
@ -890,7 +890,7 @@ class SessionManager {
$result = @Database::query($sql);
while ($rows = Database::fetch_array($result)) {
$session_id = $rows['id'];
if ($delete_session == true){
if ($delete_session) {
if ($from_ws) {
SessionManager::delete_session($session_id,true);
} else {
@ -1179,7 +1179,7 @@ class SessionManager {
$sql_session = "SELECT session_id FROM $table_field sf INNER JOIN $t_sfv sfv ON sfv.field_id=sf.id WHERE field_variable='$original_session_id_name' AND field_value='$original_session_id_value'";
$res_session = Database::query($sql_session);
$row = Database::fetch_object($res_session);
if ($row != false) {
if ($row) {
return $row->session_id;
} else {
return 0;

@ -104,14 +104,14 @@ class SocialManager extends UserManager {
$sql.=' AND friend_user_id IN (SELECT user_id FROM '.$tbl_my_user.' WHERE firstName LIKE "%'.Database::escape_string($search_name).'%" OR lastName LIKE "%'.Database::escape_string($search_name).'%" OR '.(api_is_western_name_order() ? 'concat(firstName, lastName)' : 'concat(lastName, firstName)').' like concat("%","'.Database::escape_string($search_name).'","%") ) ';
}
$res=Database::query($sql);
while ($row=Database::fetch_array($res,'ASSOC')) {
if ($load_extra_info == true) {
$res = Database::query($sql);
while ($row = Database::fetch_array($res, 'ASSOC')) {
if ($load_extra_info) {
$path = UserManager::get_user_picture_path_by_id($row['friend_user_id'],'web',false,true);
$my_user_info=api_get_user_info($row['friend_user_id']);
$list_ids_friends[]=array('friend_user_id'=>$row['friend_user_id'],'firstName'=>$my_user_info['firstName'] , 'lastName'=>$my_user_info['lastName'], 'username'=>$my_user_info['username'], 'image'=>$path['file']);
$my_user_info = api_get_user_info($row['friend_user_id']);
$list_ids_friends[] = array('friend_user_id'=>$row['friend_user_id'],'firstName'=>$my_user_info['firstName'] , 'lastName'=>$my_user_info['lastName'], 'username'=>$my_user_info['username'], 'image'=>$path['file']);
} else {
$list_ids_friends[]=$row;
$list_ids_friends[] = $row;
}
}
return $list_ids_friends;

@ -187,7 +187,7 @@ class TableSort {
$check_date = strtotime(strip_tags($row[$column]));
// strtotime Returns a timestamp on success, FALSE otherwise.
// Previous to PHP 5.1.0, this function would return -1 on failure.
$is_date &= ($check_date != -1 && $check_date != false);
$is_date &= ($check_date != -1 && $check_date);
} else {
$is_date &= false;
}

@ -153,7 +153,7 @@ class Thematic
$next_id = 0;
while ($row = Database::fetch_array($res)) {
if ($found == true && empty($next_id)) {
if ($found && empty($next_id)) {
$next_id = intval($row['id']);
$next_display_order = intval($row['display_order']);
}

@ -197,7 +197,7 @@ class Tracking {
$rs = Database::query($sql);
if (Database::num_rows($rs)>0) {
if ($first_login_date = Database::result($rs, 0, 0)) {
if ($convert_date == true) {
if ($convert_date) {
return api_convert_and_format_date($first_login_date, DATE_FORMAT_SHORT, date_default_timezone_get());
} else {
return $first_login_date;
@ -237,13 +237,13 @@ class Tracking {
//If the last connection is > than 7 days, the text is red
//345600 = 7 days in seconds
if ($currentTimestamp - $timestamp > 604800) {
if ($convert_date == true) {
if ($convert_date) {
return '<span style="color: #F00;">' . api_format_date($last_login_date, DATE_FORMAT_SHORT) . (api_is_allowed_to_edit()?' <a href="'.api_get_path(REL_CODE_PATH).'announcements/announcements.php?action=add&remind_inactive='.$student_id.'" title="'.get_lang('RemindInactiveUser').'"><img align="middle" src="'.api_get_path(WEB_IMG_PATH).'messagebox_warning.gif" /></a>':'').'</span>';
} else {
return $last_login_date;
}
} else {
if ($convert_date == true) {
if ($convert_date) {
return api_format_date($last_login_date, DATE_FORMAT_SHORT);
} else {
return $last_login_date;
@ -493,7 +493,7 @@ class Tracking {
}
// average progress = total sum divided by the number of views
// summed up.
if ($return_array == false) {
if (!$return_array) {
$avg_progress = round($sum / $number_items, 1);
return $avg_progress;
} else {
@ -733,7 +733,7 @@ class Tracking {
//var_dump($lp_with_quiz);
if ($lp_with_quiz != 0 ) {
if ($return_array == false) {
if (!$return_array) {
$score_of_scorm_calculate = round(($global_result/$lp_with_quiz),2);
return $score_of_scorm_calculate;
} else {

@ -428,7 +428,7 @@ class UserManager
$sql = "SELECT user_id FROM $t_uf uf INNER JOIN $t_ufv ufv ON ufv.field_id=uf.id WHERE field_variable='$original_user_id_name' AND field_value='$original_user_id_value';";
$res = Database::query($sql);
$row = Database::fetch_object($res);
if ($row != false) {
if ($row) {
return $row->user_id;
} else {
return 0;
@ -1052,7 +1052,7 @@ class UserManager
break;
}
}
if ($check == false) {
if (!$check) {
return false; //option value not found
}
} else {
@ -1133,7 +1133,7 @@ class UserManager
$sort_direction = strtoupper($direction);
}
$sqlf = "SELECT * FROM $t_uf ";
if ($all_visibility == false) {
if (!$all_visibility) {
$sqlf .= " WHERE field_visible = 1 ";
}
$sqlf .= " ORDER BY ".$columns[$column]." $sort_direction " ;
@ -1205,7 +1205,7 @@ class UserManager
public static function get_number_of_extra_fields($all_visibility = true) {
$t_uf = Database :: get_main_table(TABLE_MAIN_USER_FIELD);
$sqlf = "SELECT * FROM $t_uf ";
if ($all_visibility == false) {
if (!$all_visibility) {
$sqlf .= " WHERE field_visible = 1 ";
}
$sqlf .= " ORDER BY field_order";
@ -1444,7 +1444,7 @@ class UserManager
$sql = "SELECT f.id as id, f.field_variable as fvar, f.field_type as type FROM $t_uf f ";
$filter_cond = '';
if ($all_visibility == false) {
if (!$all_visibility) {
if (isset($field_filter)) {
$field_filter = intval($field_filter);
$filter_cond .= " AND field_filter = $field_filter ";
@ -1528,7 +1528,7 @@ class UserManager
$sql .= " WHERE f.field_variable = '$field_variable' ";
if ($all_visibility == false) {
if (!$all_visibility) {
$sql .= " AND f.field_visible = 1 ";
}
@ -1658,7 +1658,7 @@ class UserManager
ON (user_field.id = user_field_values.field_id)
WHERE $where";
if ($all_visibility == true) {
if ($all_visibility) {
$sql .= " AND user_field.field_visible = 1 ";
} else {
$sql .= " AND user_field.field_visible = 0 ";
@ -2991,7 +2991,7 @@ class UserManager
$tbl_my_message = Database :: get_main_table(TABLE_MAIN_MESSAGE);
$friend_id = intval($friend_id);
if ($real_removed == true) {
if ($real_removed) {
//Delete user friend
/*
$sql_delete_relationship1 = 'UPDATE ' . $tbl_my_friend .' SET relation_type='.USER_RELATION_TYPE_DELETED.' WHERE friend_user_id='.$friend_id;

@ -677,7 +677,7 @@ if (!empty($_SESSION['_user']['user_id']) && ! ($login || $logout)) {
} // end else
//Now check for anonymous user mode
if (isset($use_anonymous) && $use_anonymous == true) {
if ($use_anonymous) {
//if anonymous mode is set, then try to set the current user as anonymous
//if he doesn't have a login yet
api_set_anonymous();
@ -691,7 +691,7 @@ if (isset($use_anonymous) && $use_anonymous == true) {
if (!empty($cDir)) {
require_once api_get_path(LIBRARY_PATH).'course.lib.php';
$c = CourseManager::get_course_id_from_path($cDir);
if ($c != false) { $cidReq = $c; }
if ($c) { $cidReq = $c; }
}
// if the requested course is different from the course in session

Loading…
Cancel
Save