fixed === comparison that is not compatible with latest adodb

This commit is contained in:
Petr Skoda 2006-11-21 19:26:36 +00:00
parent 0d717a5232
commit 2ced61ebda
4 changed files with 12 additions and 12 deletions

View File

@ -1,4 +1,4 @@
<?PHP // $Id: delete.php,v 1.1 2006/03/12 18:39:59 skodak Exp $
<?PHP // $Id: delete.php,v 1.2 2006/11/21 19:26:36 skodak Exp $
require('teacheraccess.php'); //page only for teachers
$confirm = optional_param('confirm', 0, PARAM_BOOL);
@ -30,7 +30,7 @@ if ($confirm) { // the operation was confirmed.
$chapters = get_records('book_chapters', 'bookid', $book->id, 'pagenum', 'id, subchapter');
$found = false;
foreach($chapters as $ch) {
if ($ch->id === $chapter->id) {
if ($ch->id == $chapter->id) {
$found = true;
} else if ($found and $ch->subchapter) {
if (!delete_records('book_chapters', 'id', $ch->id)) {

View File

@ -1,4 +1,4 @@
<?PHP // $Id: import.php,v 1.1 2006/03/12 18:39:59 skodak Exp $
<?PHP // $Id: import.php,v 1.2 2006/11/21 19:26:36 skodak Exp $
require_once('../../config.php');
require_once('lib.php');
@ -85,7 +85,7 @@ if (($form = data_submitted()) && (confirm_sesskey())) {
$basedir = opendir($base);
while ($file = readdir($basedir)) {
$path = $base.'/'.$file;
if (filetype($path) === 'file' and preg_match($htmlpat, $file)) {
if (filetype($path) == 'file' and preg_match($htmlpat, $file)) {
$refs[] = str_replace($coursebase, '', $path);
}
}

View File

@ -1,4 +1,4 @@
<?PHP // $Id: move.php,v 1.1 2006/03/12 18:39:59 skodak Exp $
<?PHP // $Id: move.php,v 1.2 2006/11/21 19:26:36 skodak Exp $
require('teacheraccess.php'); //page only for teachers
$up = optional_param('up', 0, PARAM_BOOL);
@ -18,7 +18,7 @@ $i = 1;
$found = 0;
foreach ($oldchapters as $ch) {
$chapters[$i] = $ch;
if ($chapter->id === $ch->id) {
if ($chapter->id == $ch->id) {
$chs = $i;
$che = $chs;
if ($ch->subchapter) {
@ -39,14 +39,14 @@ foreach ($oldchapters as $ch) {
// find target chapter(s)
if ($chapters[$chs]->subchapter) { //moving single subchapter up or down
if ($up) {
if ($chs === 1) {
if ($chs == 1) {
$nothing = 1; //already first
} else {
$ts = $chs - 1;
$te = $ts;
}
} else { //down
if ($che === count($chapters)) {
if ($che == count($chapters)) {
$nothing = 1; //already last
} else {
$ts = $che + 1;
@ -55,7 +55,7 @@ if ($chapters[$chs]->subchapter) { //moving single subchapter up or down
}
} else { // moving chapter and looking for next/previous chapter
if ($up) { //up
if ($chs === 1) {
if ($chs == 1) {
$nothing = 1; //already first
} else {
$te = $chs - 1;
@ -69,7 +69,7 @@ if ($chapters[$chs]->subchapter) { //moving single subchapter up or down
}
}
} else { //down
if ($che === count($chapters)) {
if ($che == count($chapters)) {
$nothing = 1; //already last
} else {
$ts = $che + 1;

View File

@ -1,4 +1,4 @@
<?PHP // $Id: show.php,v 1.1 2006/03/12 18:39:59 skodak Exp $
<?PHP // $Id: show.php,v 1.2 2006/11/21 19:26:36 skodak Exp $
require('teacheraccess.php'); //page only for teachers
@ -18,7 +18,7 @@ if (!$chapter->subchapter) {
$chapters = get_records('book_chapters', 'bookid', $book->id, 'pagenum', 'id, subchapter, hidden');
$found = 0;
foreach($chapters as $ch) {
if ($ch->id === $chapter->id) {
if ($ch->id == $chapter->id) {
$found = 1;
} else if ($found and $ch->subchapter) {
$ch->hidden = $chapter->hidden;