From: <tr...@us...> - 2003-02-03 08:51:18
|
Update of /cvsroot/basedb/basedb/include/web In directory sc8-pr-cvs1:/tmp/cvs-serv31445/include/web Modified Files: hyb_common.inc.php Log Message: reworked image channel stuff Index: hyb_common.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/include/web/hyb_common.inc.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** hyb_common.inc.php 22 Jan 2003 08:01:36 -0000 1.9 --- hyb_common.inc.php 3 Feb 2003 08:51:13 -0000 1.10 *************** *** 23,26 **** --- 23,27 ---- require_once("protocol.inc.php"); require_once("labeled.inc.php"); + require_once("label.inc.php"); require_once("array.inc.php"); require_once("item_common.inc.php"); *************** *** 134,138 **** if(!$img->readShared($i_imgjpeg, $user)) return "Unable to use image for JPEG: image not found"; ! else if($img->getChannels() < 1 || $img->getChannels() > 3) return "Unable to use image for JPEG: can't handle its channel(s)"; else if(!$img->takeOverUseForJpeg()) --- 135,140 ---- if(!$img->readShared($i_imgjpeg, $user)) return "Unable to use image for JPEG: image not found"; ! $ch = $img->getChannels(); ! if($ch != -1 && $ch != 1 && $ch != 2) return "Unable to use image for JPEG: can't handle its channel(s)"; else if(!$img->takeOverUseForJpeg()) *************** *** 142,145 **** --- 144,162 ---- } + function imageChannelName($ch, $acqid, &$user) + { + static $chnames = false, $lab = array(); + if(!$chnames) + $chnames = Image::getChannelNames(); + if(!isset($lab[$acqid])) + $lab[$acqid] = ImageAcquisition::getChannelLabelsForId($acqid); + $l =& $lab[$acqid]; + + $clink = isset($chnames[$ch]) ? html($chnames[$ch]) : "unknown"; + if(isset($l[$ch])) + $clink .= " (label ".labelIdLink($l[$ch], $user).")"; + return $clink; + } + // Image list for an imageacquisition. Makes its own table, wants to be // in a form called ff. *************** *** 204,208 **** "<td><a ".href("image_edit.phtml?i_img=$a[id]", 2).">". html($a["name"])."</a>".remMark($a["removed"])."</td>". ! "<td>".html($acq->getChannelsTitle($ch))."</td>". "<td>".html($a["userName"])."</td>". "<td>".htmldate($a["addedDate"])."</td>". --- 221,225 ---- "<td><a ".href("image_edit.phtml?i_img=$a[id]", 2).">". html($a["name"])."</a>".remMark($a["removed"])."</td>". ! "<td>".imageChannelName($ch, $acqid, $user)."</td>". "<td>".html($a["userName"])."</td>". "<td>".htmldate($a["addedDate"])."</td>". |