--- rat/lonratedt.pm 2005/06/08 15:44:51 1.67
+++ rat/lonratedt.pm 2005/06/08 16:10:01 1.68
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Edit Handler for RAT Maps
#
-# $Id: lonratedt.pm,v 1.67 2005/06/08 15:44:51 www Exp $
+# $Id: lonratedt.pm,v 1.68 2005/06/08 16:10:01 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -448,6 +448,12 @@ sub buttons {
return $output.'
';
}
+# ----------------------------------------------------- Get an unused res index
+
+sub unusedindex {
+ return 1+($#resources>$#zombies?$#resources:$#zombies);
+}
+
# ----------------------------------------------------------- Paste into target
# modifies @order, @resources
@@ -460,7 +466,7 @@ sub pastetarget {
$name=&Apache::lonnet::unescape($name);
$url=&Apache::lonnet::unescape($url);
if ($url) {
- my $idx=$#resources+1;
+ my $idx=&unusedindex();
$insertorder[$#insertorder+1]=$idx;
my $ext='false';
if ($url=~/^http\:\/\//) { $ext='true'; }
@@ -506,7 +512,7 @@ sub startfinish {
$resources[$order[0]]=$name.':'.$url.':'.$ext.':start:res';
# Make sure this has at least start and finish
if ($#order==0) {
- $resources[$#resources+1]='::false';
+ $resources[&unusedindex()]='::false';
$order[1]=$#resources;
}
# Make the last one a finish resource
@@ -1178,11 +1184,7 @@ sub viewmap {
'" />'.&Apache::lonratsrv::qtescape($title).
' | '.$filename.' | ');
if ($url) {
- if (-e $resfilepath) {
- $r->print(''.&mt('Resource space').'');
- } else {
- $r->print(&mt('unpublished'));
- }
+ $r->print(''.&mt('Resource space').'');
}
$r->print(' | ');
if ($url) {
|