--- rat/lonratedt.pm 2002/05/13 19:23:52 1.13 +++ rat/lonratedt.pm 2002/05/13 21:26:05 1.15 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Edit Handler for RAT Maps # -# $Id: lonratedt.pm,v 1.13 2002/05/13 19:23:52 www Exp $ +# $Id: lonratedt.pm,v 1.15 2002/05/13 21:26:05 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -189,12 +189,13 @@ sub smpedt { } # ============================================================ Process commands - my $targetdetail=''; - my $importdetail=''; + my $targetdetail=$ENV{'form.targetdetail'}; + my $importdetail=$ENV{'form.curimpdetail'}; # ---------------------------------------------------- Importing from groupsort if ($ENV{'form.importdetail'}) { + $importdetail=''; my @curimport=split(/\&/,$ENV{'form.curimpdetail'}); my $lastsel; @@ -225,7 +226,24 @@ sub smpedt { $importdetail=~s/\&+/\&/g; $importdetail=~s/^\&//; -# -------------------------------------------------------- +# ------------------------------------------------------------------- Clear all + } elsif ($ENV{'form.clear'}) { + $importdetail=''; +# ------------------------------------------------------------ Discard selected + } elsif ($ENV{'form.discard'}) { + $importdetail=''; + my @curimport=split(/\&/,$ENV{'form.curimpdetail'}); + foreach (@importselect) { + $curimport[$_]=''; + } + for (my $i=0;$i<=$#curimport;$i++) { + my ($name,$url)=split(/\=/,$curimport[$i]); + if ($url) { + $importdetail.='&'.&Apache::lonnet::escape($name).'='. + &Apache::lonnet::escape($url); + } + } +# --------------------------- } # ------------------------------------------------------------ Assemble windows @@ -234,8 +252,9 @@ sub smpedt { my $importwindow=join("\n",map { $idx++; if ($_) { - my ($name)=split(/\=/,$_); - unless ($name) { $name='UNKNOWN'; } + my ($name,$url)=split(/\=/,$_); + unless ($name) { $name=(split(/\//,$url))[-1]; } + unless ($name) { $name='EMPTY'; } ''; } @@ -244,7 +263,8 @@ sub smpedt { $idx=0; my $targetwindow=join("\n",map { my ($name,$url)=split(/\:/,$resources[$_]); - unless ($name) { $name='UNKNOWN'; } + unless ($name) { $name=(split(/\//,$url))[-1]; } + unless ($name) { $name='EMPTY'; } $targetdetail.='&'.&Apache::lonnet::escape($name).'='. &Apache::lonnet::escape($url); $idx++; @@ -334,6 +354,30 @@ function idxcheck(mode) { } idx.focus(); } + + + var editbrowser; + function openbrowser(formname,elementname,only,omit) { + var url = '/res/?'; + if (editbrowser == null) { + url += 'launch=1&'; + } + url += 'catalogmode=interactive&'; + url += 'mode=edit&'; + url += 'form=' + formname + '&'; + if (only != null) { + url += 'only=' + only + '&'; + } + if (omit != null) { + url += 'omit=' + omit + '&'; + } + url += 'element=' + elementname + ''; + var title = 'Browser'; + var options = 'scrollbars=1,resizable=1,menubar=0'; + options += ',width=700,height=600'; + editbrowser = open(url,title,options,'1'); + editbrowser.focus(); + } @@ -348,6 +392,14 @@ $buttons +after selected +
+ +
+ +   @@ -401,7 +453,8 @@ sub viewmap { my ($title,$url)=split(/\:/,$_); $title=~s/\&colon\;/\:/g; $url=~s/\&colon\;/\:/g; - unless ($title) { $title='Unknown'; } + unless ($title) { $title=(split(/\//,$url))[-1] }; + unless ($title) { $title='Empty'; } if ($url) { $r->print(''); }