--- rat/lonratedt.pm 2006/04/11 19:35:16 1.75
+++ rat/lonratedt.pm 2006/07/20 04:17:45 1.82
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Edit Handler for RAT Maps
#
-# $Id: lonratedt.pm,v 1.75 2006/04/11 19:35:16 albertel Exp $
+# $Id: lonratedt.pm,v 1.82 2006/07/20 04:17:45 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -172,6 +172,9 @@ use Apache::lonsequence;
use Apache::loncommon;
use Apache::lonlocal;
use File::Copy;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
+
use vars qw(@order @resources @resparms @zombies);
@@ -488,8 +491,8 @@ sub pastetarget {
foreach (@which) {
if (defined($_)) {
my ($name,$url)=split(/\=/,$_);
- $name=&Apache::lonnet::unescape($name);
- $url=&Apache::lonnet::unescape($url);
+ $name=&unescape($name);
+ $url=&unescape($url);
if ($url) {
my $idx=&getresidx($url);
$insertorder[$#insertorder+1]=$idx;
@@ -688,7 +691,7 @@ function srchclose() {
// -------------------------------------------------------- Open indexer window
function idxopen(mode) {
- var options="scrollbars=1,resizable=1,menubar=0";
+ var options="scrollbars=1,resizable=1,menubar=0,location=1,toolbar=1";
idxmode=mode;
idxflag=1;
idx=open("$resurl/?launch=1&mode=$mode&catalogmode="+mode,"idxout",options);
@@ -696,10 +699,10 @@ function idxopen(mode) {
}
// ------------------------------------------------------ Open groupsort window
-function groupopen(url,recover) {
+function groupopen(url,recover,bookmarks) {
var options="scrollbars=1,resizable=1,menubar=0";
idxflag=1;
- idx=open("/adm/groupsort?mode=$mode&recover="+recover+"&readfile="+url,"idxout",options);
+ idx=open("/adm/groupsort?mode=$mode&recover="+recover+"&readfile="+url+"&bookmarks="+bookmarks,"idxout",options);
idx.focus();
}
@@ -713,11 +716,11 @@ function srchopen(mode) {
}
// ----------------------------------------------------- launch indexer browser
function groupsearch() {
- srchcheck('groupsearch');
+ srchcheck('import');
}
function groupimport() {
- idxcheck('groupimport');
+ idxcheck('import');
}
// ------------------------------------------------------- Do srch status check
@@ -754,7 +757,7 @@ function idxcheck(mode) {
}
url += 'element=' + elementname + '';
var title = 'Browser';
- var options = 'scrollbars=1,resizable=1,menubar=0';
+ var options = 'scrollbars=1,resizable=1,menubar=0,toolbar=1,location=1';
options += ',width=700,height=600';
editbrowser = open(url,title,options,'1');
editbrowser.focus();
@@ -871,8 +874,8 @@ sub smpedt {
&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$env{'form.importmap'}))) {
my ($name,$url)=split(/\:/,$_);
if ($url) {
- $importdetail.='&'.&Apache::lonnet::escape($name).'='.
- &Apache::lonnet::escape($url);
+ $importdetail.='&'.&escape($name).'='.
+ &escape($url);
}
}
@@ -918,8 +921,8 @@ sub smpedt {
foreach (@targetselect) {
my ($name,$url)=split(/\:/,$resources[$order[$_-1]]);
if ($url) {
- $importdetail.='&'.&Apache::lonnet::escape($name).'='.
- &Apache::lonnet::escape($url);
+ $importdetail.='&'.&escape($name).'='.
+ &escape($url);
}
}
@@ -1006,7 +1009,7 @@ sub smpedt {
my ($name,$url)=split(/\=/,$_);
unless ($name) { $name=(split(/\//,$url))[-1]; }
unless ($name) { $name='EMPTY'; }
- '';
}
} split(/\&/,$importdetail));
@@ -1019,8 +1022,8 @@ sub smpedt {
my ($name,$url)=split(/\:/,$resources[$_]);
unless ($name) { $name=(split(/\//,$url))[-1]; }
unless ($name) { $name='EMPTY'; }
- $targetdetail.='&'.&Apache::lonnet::escape($name).'='.
- &Apache::lonnet::escape($url);
+ $targetdetail.='&'.&escape($name).'='.
+ &escape($url);
$idx++;
$name=~s/\:/\:/g;
'';
@@ -1034,6 +1037,7 @@ sub smpedt {
'nt' => 'New Title',
'se' => 'Search',
'im' => 'Import',
+ 'bk' => 'Import Bookmarks',
'vi' => 'View',
'lm' => 'Load Map',
'ds' => 'Discard Selected',
@@ -1051,7 +1055,7 @@ sub smpedt {
'reco' => 'Recover Deleted'
);
my $js=<
$editscript
@@ -1096,11 +1100,10 @@ sub smpedt {
ENDJS
- my $start_page =
- &Apache::loncommon::start_page(undef,$js,
- {'only_body' =>
- ($env{'environment.remote'} ne 'off')}).
- &Apache::loncommon::help_open_menu('','Sequence_Simple_Editor_Creation','Sequence_Simple_Editor_Creation','',6,'RAT');
+ my $start_page = &Apache::loncommon::start_page(undef,$js).
+ &Apache::loncommon::help_open_menu('Sequence_Simple_Editor_Creation',
+ 'Sequence_Simple_Editor_Creation',
+ 6,'RAT');
my $end_page = &Apache::loncommon::end_page();
$r->print(<
+"javascript:impfortarget.value=1;groupopen(0,1,1);" value="$lt{'bk'}">
+
$lt{'as'}
@@ -1192,7 +1197,7 @@ sub viewmap {
my ($r,$url,$adv,$errtext)=@_;
$r->print(
&Apache::loncommon::start_page('Edit Content of a Map').
- &Apache::loncommon::help_open_menu('','','','',6,'RAT').
+ &Apache::loncommon::help_open_menu('','',6,'RAT').
&buttons($adv));
if ($errtext) {
$r->print($errtext.'
');