Index: trunk/kernel/include/image.php =================================================================== diff -u -r1067 -r1098 --- trunk/kernel/include/image.php (.../image.php) (revision 1067) +++ trunk/kernel/include/image.php (.../image.php) (revision 1098) @@ -976,13 +976,18 @@ return FALSE; } - function &GetImageByName($ResourceId,$name) + function &GetImageByName($ResourceId, $name, $enabled=0) { $found = FALSE; foreach($this->Items as $img) { - if($img->Get("ResourceId")==$ResourceId && $img->Get("Name")==$name) + $search_condition = ($img->Get("ResourceId")==$ResourceId && $img->Get("Name")==$name); + if ($enabled) { + $search_condition = $search_condition && $img->Get("Enabled"); + } + if($search_condition) + { $found=TRUE; break; } @@ -994,6 +999,10 @@ else { $sql = "SELECT * FROM ".$this->SourceTable." WHERE ResourceId=$ResourceId AND Name LIKE '$name'"; + if ($enabled) + { + $sql = $sql.' AND Enabled=1'; + } //echo $sql; $rs = $this->adodbConnection->Execute($sql); if($rs && !$rs->EOF)