--- loncom/interface/londocs.pm 2012/05/06 22:09:14 1.483 +++ loncom/interface/londocs.pm 2012/05/07 02:12:47 1.484 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.483 2012/05/06 22:09:14 raeburn Exp $ +# $Id: londocs.pm,v 1.484 2012/05/07 02:12:47 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -100,12 +100,17 @@ sub authorhosts { my $allowed=0; my $myhome=&Apache::lonnet::homeserver($ca,$cd); my @ids=&Apache::lonnet::current_machine_ids(); - foreach my $id (@ids) { if ($id eq $myhome) { $allowed=1; } } + foreach my $id (@ids) { + if ($id eq $myhome) { + $allowed=1; + last; + } + } if ($allowed) { $home++; - $outhash{'home_'.$ca.'@'.$cd}=1; + $outhash{'home_'.$ca.':'.$cd}=1; } else { - $outhash{'otherhome_'.$ca.'@'.$cd}=$myhome; + $outhash{'otherhome_'.$ca.':'.$cd}=$myhome; $other++; } } @@ -114,27 +119,6 @@ sub authorhosts { } -sub dumpbutton { - my ($home,$other,%outhash)=&authorhosts(); - my $crstype = &Apache::loncommon::course_type(); - if ($home+$other==0) { return ''; } - if ($home) { - my $link = - "" - .&mt('Dump '.$crstype.' Documents to Construction Space') - .''; - return - $link.' ' - .&Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs') - .'
'; - } else { - return - &mt('Dump '.$crstype.' Documents to Construction Space: available on other servers'); - } -} - sub clean { my ($title)=@_; $title=~s/[^\w\/\!\$\%\^\*\-\_\=\+\;\:\,\\\|\`\~]+/\_/gs; @@ -146,16 +130,22 @@ sub clean { sub dumpcourse { my ($r) = @_; my $crstype = &Apache::loncommon::course_type(); - $r->print(&Apache::loncommon::start_page('Dump '.$crstype.' Documents to Construction Space'). - '
'); - $r->print(&Apache::lonhtmlcommon::breadcrumbs('Dump '.$crstype.' Documents to Construction Space')); + $r->print(&Apache::loncommon::start_page('Dump '.$crstype.' Content to Authoring Space')."\n". + &Apache::lonhtmlcommon::breadcrumbs('Dump '.$crstype.' Content to Authoring Space')."\n"); + $r->print(&startContentScreen('tools')); my ($home,$other,%outhash)=&authorhosts(); - unless ($home) { return ''; } + unless ($home) { + $r->print(&endContentScreen()); + return ''; + } my $origcrsid=$env{'request.course.id'}; my %origcrsdata=&Apache::lonnet::coursedescription($origcrsid); if (($env{'form.authorspace'}) && ($env{'form.authorfolder'}=~/\w/)) { # Do the dumping - unless ($outhash{'home_'.$env{'form.authorspace'}}) { return ''; } + unless ($outhash{'home_'.$env{'form.authorspace'}}) { + $r->print(&endContentScreen()); + return ''; + } my ($ca,$cd)=split(/\@/,$env{'form.authorspace'}); $r->print('

'.&mt('Copying Files').'

'); my $title=$env{'form.authorfolder'}; @@ -206,10 +196,15 @@ sub dumpcourse { } } } else { + $r->print(&mt('Searching ...').'
'); + $r->rflush(); # Input form + $r->print(''."\n"); unless ($home==1) { - $r->print( - '

'.&mt('Select the Construction Space').'

'); } foreach my $key (sort(keys(%outhash))) { if ($key=~/^home_(.+)$/) { @@ -218,20 +213,23 @@ sub dumpcourse { ''); } else { $r->print(''); + &Apache::loncommon::plainname(split(/\:/,$1)).''); } } } unless ($home==1) { - $r->print(''); + $r->print(''."\n"); } my $title=$origcrsdata{'description'}; $title=~s/[\/\s]+/\_/gs; $title=&clean($title); - $r->print('

'.&mt('Folder in Construction Space').'

' - .'
'); + $r->print('
'. + '
'.&mt('Folder in Authoring Space').''. + ''. + '

'."\n"); &tiehash(); - $r->print('

'.&mt('Filenames in Construction Space').'

' + $r->print('

'.&mt('Filenames in Authoring Space').'

' .&Apache::loncommon::start_data_table() .&Apache::loncommon::start_data_table_header_row() .''.&mt('Internal Filename').'' @@ -259,14 +257,9 @@ sub dumpcourse { $r->print(&Apache::loncommon::end_data_table()); &untiehash(); $r->print( - '

'); + '

'); } -} - -sub exportbutton { - my $crstype = &Apache::loncommon::course_type(); - return "".&mt('IMS Export')."". - &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'
'; + $r->print(&endContentScreen()); } sub group_import { @@ -430,30 +423,46 @@ sub log_docs { } } - - - - sub docs_change_log { - my ($r)=@_; - my $folder=$env{'form.folder'}; + my ($r,$coursenum,$coursedom,$folder,$allowed,$crstype,$iconpath)=@_; my $js = ''."\n"; - $r->print(&Apache::loncommon::start_page('Course Document Change Log',$js)); - $r->print(&Apache::lonhtmlcommon::breadcrumbs('Course Document Change Log')); + $r->print(&Apache::loncommon::start_page('Content Change Log',$js)); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Content Change Log')); + $r->print(&startContentScreen('docs')); + my %orderhash; + my $container='sequence'; + my $pathitem; + if ($env{'form.pagepath'}) { + $container='page'; + $pathitem = ''; + } else { + my $folderpath=$env{'form.folderpath'}; + if ($folderpath eq '') { + $folderpath = 'default&'.&escape(&mt('Main '.$crstype.' Documents')); + } + $pathitem = ''; + } + my $readfile="/uploaded/$coursedom/$coursenum/$folder.$container"; + my $jumpto = $readfile; + $jumpto =~ s{^/}{}; + my $tid = 1; + my ($breadcrumbtrail) = &breadcrumbs($allowed,$crstype); + $r->print($breadcrumbtrail. + &generate_edit_table($tid,\%orderhash,undef,$iconpath,$jumpto, + $readfile)); my %docslog=&Apache::lonnet::dump('nohist_docslog', $env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'}); if ((keys(%docslog))[0]=~/^error\:/) { undef(%docslog); } - $r->print('
'. - ''); - my %saveable_parameters = ('show' => 'scalar',); &Apache::loncommon::store_course_settings('docs_log', \%saveable_parameters); @@ -467,9 +476,14 @@ sub docs_change_log { 'randomorder' => 'Randomly ordered', 'set' => 'set to', 'del' => 'deleted'); - $r->print(&Apache::loncommon::display_filter('docslog'). - ''. - '
'); + my $filter = &Apache::loncommon::display_filter('docslog')."\n". + $pathitem."\n". + ''. + (' 'x2).''; + $r->print('
'. + '
'.&mt('Display of Content Changes').''."\n". + &makedocslogform($filter,1). + '

'); $r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row(). ''.&mt('Time').''.&mt('User').''.&mt('Folder').''.&mt('Before').''. &mt('After').''. @@ -564,7 +578,10 @@ sub docs_change_log { if (!($env{'form.show'} eq &mt('all') || $shown<=$env{'form.show'})) { last; } } - $r->print(&Apache::loncommon::end_data_table()); + $r->print(&Apache::loncommon::end_data_table()."\n". + &makesimpleeditform($pathitem)."\n". + ''); + $r->print(&endContentScreen()); } sub update_paste_buffer { @@ -822,6 +839,16 @@ sub editor { my $container= ($env{'form.pagepath'}) ? 'page' : 'sequence'; + my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order) = + &breadcrumbs($allowed,$crstype); + $r->print($breadcrumbtrail); + + my $jumpto = "uploaded/$coursedom/$coursenum/$folder.$container"; + + unless ($allowed) { + $randompick = -1; + } + my ($errtext,$fatal) = &mapread($coursenum,$coursedom, $folder.'.'.$container); return $errtext if ($fatal); @@ -833,16 +860,6 @@ sub editor { $LONCAPA::map::resources[$idx]=''; } - my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order) = - &breadcrumbs($allowed,$crstype); - $r->print($breadcrumbtrail); - - my $jumpto = "uploaded/$coursedom/$coursenum/$folder.$container"; - - unless ($allowed) { - $randompick = -1; - } - # ------------------------------------------------------------ Process commands # ---------------- if they are for this folder and user allowed to make changes @@ -994,7 +1011,9 @@ sub editor { $tid = 2; } if ($allowed) { - $r->print(&generate_edit_table($tid,$orderhash,$to_show,$iconpath,$jumpto)); + my $readfile="/uploaded/$coursedom/$coursenum/$folder.$container"; + $r->print(&generate_edit_table($tid,$orderhash,$to_show,$iconpath,$jumpto, + $readfile)); &print_paste_buffer($r,$container); } else { if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) { @@ -1299,12 +1318,12 @@ sub entryline { if (!$nocopy) { $copylink=(<$lt{'cp'} +$lt{'cp'} ENDCOPY } if (!$nocut) { $cutlink=(<$lt{'ct'} +$lt{'ct'} ENDCUT } $form_start = ' @@ -1488,7 +1507,7 @@ $form_common.' if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { $line.=''; } elsif ($url) { - $line.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes', + $line.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes', '',600,500); } else { $line.=''; @@ -1497,7 +1516,7 @@ $form_common.' if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { $line.=''.$title.''; } elsif ($url) { - $line.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes', + $line.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes', $title,600,500); } else { $line.=$title.' '.$reinit.''; @@ -1645,7 +1664,7 @@ sub checkonthis { =item list_symbs() -List Symbs +List Content Idenifiers =cut @@ -1653,9 +1672,9 @@ sub list_symbs { my ($r) = @_; my $crstype = &Apache::loncommon::course_type(); - $r->print(&Apache::loncommon::start_page('Symb List')); - $r->print(&Apache::lonhtmlcommon::breadcrumbs('Symb List')); - &startContentScreen($r,'tools'); + $r->print(&Apache::loncommon::start_page('List of Content Identifiers')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Content Identifiers')); + $r->print(&startContentScreen('tools')); my $navmap = Apache::lonnavmaps::navmap->new(); if (!defined($navmap)) { $r->print('

'.&mt('Retrieval of List Failed').'

'. @@ -1664,11 +1683,25 @@ sub list_symbs { ''); &Apache::lonnet::logthis('Symb list failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'}); } else { - $r->print("
\n");
+        $r->print('

'.&mt("$crstype Content Identifiers").'

'. + &Apache::loncommon::start_data_table(). + &Apache::loncommon::start_data_table_header_row(). + ''.&mt('Title').''.&mt('Identifier').''. + &Apache::loncommon::end_data_table_header_row()."\n"); + my $count; foreach my $res ($navmap->retrieveResources()) { - $r->print($res->compTitle()."\t".$res->symb()."\n"); + $r->print(&Apache::loncommon::start_data_table_row(). + ''.$res->compTitle().''. + ''.$res->symb().''. + &Apache::loncommon::start_data_table_row()); + $count ++; + } + if (!$count) { + $r->print(&Apache::loncommon::start_data_table_row(). + ''.&mt("$crstype is empty").''. + &Apache::loncommon::end_data_table_row()); } - $r->print("\n
\n"); + $r->print(&Apache::loncommon::end_data_table()); } } @@ -1676,13 +1709,15 @@ sub list_symbs { sub verifycontent { my ($r) = @_; my $crstype = &Apache::loncommon::course_type(); - $r->print(&Apache::loncommon::start_page('Verify '.$crstype.' Documents')); - $r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$crstype.' Documents')); - &startContentScreen($r,'tools'); + $r->print(&Apache::loncommon::start_page('Verify '.$crstype.' Documents')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$crstype.' Documents')); + $r->print(&startContentScreen('tools')); + $r->print('

'.&mt($crstype.' content verification').'

'); $hashtied=0; undef %alreadyseen; %alreadyseen=(); &tiehash(); + foreach my $key (keys(%hash)) { if ($hash{$key}=~/\.(page|sequence)$/) { if (($key=~/^src_/) && ($alreadyseen{&unescape($hash{$key})})) { @@ -1712,7 +1747,7 @@ sub checkversions { my $crstype = &Apache::loncommon::course_type(); $r->print(&Apache::loncommon::start_page("Check $crstype Document Versions")); $r->print(&Apache::lonhtmlcommon::breadcrumbs("Check $crstype Document Versions")); - &startContentScreen($r,'tools'); + $r->print(&startContentScreen('tools')); my $header=''; my $startsel=''; @@ -1826,6 +1861,7 @@ sub checkversions { 'lw' => 'Version changes since last Week', 'sy' => 'Version changes since Yesterday', 'al' => 'All Resources (possibly large output)', + 'cd' => 'Change display', 'sd' => 'Display', 'fi' => 'File', 'md' => 'Modification Date', @@ -1836,18 +1872,16 @@ sub checkversions { 'sm' => 'Keep all Resources up-to-date with most recent Versions (default)', 'sc' => 'Set all Resource Versions to current Version (Fix Versions)', 'di' => 'Differences', - 'save' => 'Save', + 'save' => 'Save changes', + 'vers' => 'Version choice(s) for specific resources', 'act' => 'Actions'); $r->print(<$header
-
+
-$lt{'act'} -$lt{'sm'}:
-$lt{'sc'}: -
-
+$lt{'cd'} $lt{'sy'} -

$header

+ +
+
+
+$lt{'act'} +$lt{'sm'}:
+$lt{'sc'}: +
+
+
+
+

$lt{'vers'}

ENDHEADERS @@ -2023,7 +2068,7 @@ $help{'Caching'}.'

'."\n\n"); sub init_breadcrumbs { my ($form,$text)=@_; &Apache::lonhtmlcommon::clear_breadcrumbs(); - &Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs", + &Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs?tools=1", text=>&Apache::loncommon::course_type().' Editor', faq=>273, bug=>'Instructor Interface', @@ -2058,23 +2103,24 @@ sub create_form_ul { # sub startContentScreen { - my ($r,$mode)=@_; - $r->print(''."\n"; + $output .= '
'. + '
'. + '
'; + return $output; } # @@ -2082,8 +2128,7 @@ sub startContentScreen { # sub endContentScreen { - my ($r)=@_; - $r->print('
'); + return ''; } sub supplemental_base { @@ -2095,7 +2140,14 @@ sub handler { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; return OK if $r->header_only; + +# get course data my $crstype = &Apache::loncommon::course_type(); + my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'}; + my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'}; + +# graphics settings + $iconpath = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL').'/'); # # --------------------------------------------- Initialize help topics for this @@ -2129,20 +2181,29 @@ sub handler { $allowed = &Apache::lonnet::allowed('mdc',$env{'request.course.id'}); } - if ($allowed && $env{'form.verify'}) { + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['chooseserver', + 'inhibitmenu']); + if ($allowed && $env{'form.chooseserver'}) { + &choose_dump_server($r); + return OK; + } elsif ($allowed && $env{'form.verify'}) { &init_breadcrumbs('verify','Verify Content'); &verifycontent($r); } elsif ($allowed && $env{'form.listsymbs'}) { - &init_breadcrumbs('listsymbs','List Symbs'); + &init_breadcrumbs('listsymbs','List Content IDs'); &list_symbs($r); } elsif ($allowed && $env{'form.docslog'}) { &init_breadcrumbs('docslog','Show Log'); - &docs_change_log($r); + my $folder = $env{'form.folder'}; + if ($folder eq '') { + $folder='default'; + } + &docs_change_log($r,$coursenum,$coursedom,$folder,$allowed,$crstype,$iconpath); } elsif ($allowed && $env{'form.versions'}) { &init_breadcrumbs('versions','Check/Set Resource Versions'); &checkversions($r); } elsif ($allowed && $env{'form.dumpcourse'}) { - &init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' Documents to Construction Space'); + &init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' Content to Authoring Space'); &dumpcourse($r); } elsif ($allowed && $env{'form.exportcourse'}) { &init_breadcrumbs('exportcourse','IMS Export'); @@ -2150,22 +2211,23 @@ sub handler { } else { # # Done catching special calls -# The whole rest is for course and supplemental documents +# The whole rest is for course and supplemental documents and utilities menu # Get the parameters that may be needed # &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['folderpath','pagepath', 'pagesymb','forcesupplement','forcestandard', - 'symb','command']); + 'tools','symb','command']); # standard=1: this is a "new-style" course with an uploaded map as top level # standard=2: this is a "old-style" course, and there is nothing we can do my $standard=($env{'request.course.uri'}=~/^\/uploaded\//); -# Decide whether this should display supplemental or main content +# Decide whether this should display supplemental or main content or utilities # supplementalflag=1: show supplemental documents # supplementalflag=0: show standard documents +# toolsflag=1: show utilities my $supplementalflag=($env{'form.folderpath'}=~/^supplemental/); @@ -2176,6 +2238,8 @@ sub handler { if ($env{'form.forcestandard'}) { $supplementalflag=0; } unless ($allowed) { $supplementalflag=1; } unless ($standard) { $supplementalflag=1; } + my $toolsflag=0; + if ($env{'form.tools'}) { $toolsflag=1; } my $script=''; my $showdoc=0; @@ -2298,81 +2362,90 @@ sub handler { } # Store this - &Apache::loncommon::store_course_settings($stored_folderpath, - {'pagepath' => 'scalar', - 'folderpath' => 'scalar'}); - - if ($env{'form.folderpath'}) { - my (@folderpath)=split('&',$env{'form.folderpath'}); - $env{'form.foldername'}=&unescape(pop(@folderpath)); - $env{'form.folder'}=pop(@folderpath); - $container='sequence'; - } - if ($env{'form.pagepath'}) { - my (@pagepath)=split('&',$env{'form.pagepath'}); - $env{'form.pagename'}=&unescape(pop(@pagepath)); - $env{'form.folder'}=pop(@pagepath); - $container='page'; - $containertag = ''. - ''; - $uploadtag = - ''. - ''. - ''; - } else { - my $folderpath=$env{'form.folderpath'}; - if (!$folderpath) { - if ($env{'form.folder'} eq '' || - $env{'form.folder'} eq 'supplemental') { - $folderpath='default&'. - &escape(&mt('Main '.$crstype.' Documents')); + unless ($toolsflag) { + &Apache::loncommon::store_course_settings($stored_folderpath, + {'pagepath' => 'scalar', + 'folderpath' => 'scalar'}); + if ($env{'form.folderpath'}) { + my (@folderpath)=split('&',$env{'form.folderpath'}); + $env{'form.foldername'}=&unescape(pop(@folderpath)); + $env{'form.folder'}=pop(@folderpath); + $container='sequence'; + } + if ($env{'form.pagepath'}) { + my (@pagepath)=split('&',$env{'form.pagepath'}); + $env{'form.pagename'}=&unescape(pop(@pagepath)); + $env{'form.folder'}=pop(@pagepath); + $container='page'; + $containertag = ''. + ''; + $uploadtag = + ''. + ''. + ''; + } else { + my $folderpath=$env{'form.folderpath'}; + if (!$folderpath) { + if ($env{'form.folder'} eq '' || + $env{'form.folder'} eq 'supplemental') { + $folderpath='default&'. + &escape(&mt('Main '.$crstype.' Documents')); + } + } + $containertag = ''; + $uploadtag = ''; + } + if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) { + $showdoc='/'.$1; + } + if ($showdoc) { # got called in sequence from course + $allowed=0; + } else { + if ($allowed) { + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']); + $script=&Apache::lonratedt::editscript('simple'); } } - $containertag = ''; - $uploadtag = ''; - } - if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) { - $showdoc='/'.$1; - } - if ($showdoc) { # got called in sequence from course - $allowed=0; - } else { - if ($allowed) { - &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']); - $script=&Apache::lonratedt::editscript('simple'); - } } -# get course data - my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'}; - my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'}; - # get personal data my $uname=$env{'user.name'}; my $udom=$env{'user.domain'}; my $plainname=&escape(&Apache::loncommon::plainname($uname,$udom)); -# graphics settings - - $iconpath = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL') . "/"); - if ($allowed) { - my @tabids; - if ($supplementalflag) { - @tabids = ('002','ee2','ff2'); + if ($toolsflag) { + $script .= &inject_data_js(); + my ($home,$other,%outhash)=&authorhosts(); + if (!$home && $other) { + my @hosts; + foreach my $aurole (keys(%outhash)) { + unless(grep(/^\Q$outhash{$aurole}\E/,@hosts)) { + push(@hosts,$outhash{$aurole}); + } + } + $script .= &dump_switchserver_js(@hosts); + } } else { - @tabids = ('aa1','bb1','cc1','ff1'); - unless ($env{'form.pagepath'}) { - unshift(@tabids,'001'); - push(@tabids,('dd1','ee1')); + my @tabids; + if ($supplementalflag) { + @tabids = ('002','ee2','ff2'); + } else { + @tabids = ('aa1','bb1','cc1','ff1'); + unless ($env{'form.pagepath'}) { + unshift(@tabids,'001'); + push(@tabids,('dd1','ee1')); + } } + my $tabidstr = join("','",@tabids); + $script .= &editing_js($udom,$uname,$supplementalflag). + &history_tab_js(). + &inject_data_js(). + &resize_contentdiv_js($tabidstr); + $addentries = { + onload => "javascript:resize_contentdiv('contentscroll','1','1');", + }; } - my $tabidstr = join("','",@tabids); - $script .= &editing_js($udom,$uname,$supplementalflag). - &resize_contentdiv_js($tabidstr); - $addentries = { - onload => "javascript:resize_contentdiv('contentscroll','1','1');", - }; } # -------------------------------------------------------------------- Body tag $script = ' + +ENDSWJS + + my $startpage = &Apache::loncommon::start_page('Choose server',$js, + {'only_body' => 1, + 'js_ready' => 1,}); + my $endpage = &Apache::loncommon::end_page({'js_ready' => 1}); + + my $hostpicker; + my $count = 0; + foreach my $host (sort(@hosts)) { + my $checked; + if ($count == 0) { + $checked = ' checked="checked"'; + } + $hostpicker .= '  '; + $count++; + } + + return <<"ENDSWITCHJS"; + +function dump_needs_switchserver(url) { + if (url!='' && url!= null) { + if (confirm("$lt{'dump'}\\n$lt{'swit'}")) { + go(url); + } + } + return; +} + +function choose_switchserver_window() { + newWindow = window.open('','ChooseServer','height=400,width=500,scrollbars=yes') + newWindow.document.open(); + newWindow.document.writeln('$startpage'); + newWindow.document.write('

$lt{'duco'}<\\/h3>\\n'+ + '

$lt{'yone'}<\\/p>\\n'+ + '

$lt{'chos'}<\\/legend>\\n'+ + '
\\n'+ + '$hostpicker\\n'+ + '

\\n'+ + '\\n'+ + '<\\/form><\\/fieldset><\\/div>
\\n'); + newWindow.document.writeln('$endpage'); + newWindow.document.close(); + newWindow.focus(); +} + +ENDSWITCHJS +} + sub resize_contentdiv_js { my ($tabidstr) = @_; my $viewport_js = &Apache::loncommon::viewport_geometry_js(); @@ -3789,6 +3990,26 @@ ENDRESIZESCRIPT return; } +sub makedocslogform { + my ($formelems,$docslog) = @_; + return <<"LOGSFORM"; + + + $formelems + +LOGSFORM +} + +sub makesimpleeditform { + my ($formelems) = @_; + return <<"SIMPFORM"; +
+ + $formelems + +SIMPFORM +} + 1; __END__ @@ -3821,21 +4042,12 @@ sets @resources - array with the resourc Return hash with valid author names -=item dumpbutton() - -Generate "dump" button - =item clean() =item dumpcourse() Actually dump course - -=item exportbutton() - - Generate "export" button - =item group_import() Imports the given (name, url) resources into the course @@ -3895,6 +4107,46 @@ Check Versions Breadcrumbs for special functions +=item create_list_elements() + +=item create_form_ul() + +=item startContentScreen() + +=item endContentScreen() + +=item supplemental_base() + +=item embedded_form_elems() + +=item embedded_destination() + +=item return_to_editor() + +=item decompression_info() + +=item decompression_phase_one() + +=item decompression_phase_two() + +=item remove_archive() + +=item generate_admin_menu() + +=item generate_edit_table() + +=item editing_js() + +=item history_tab_js() + +=item inject_data_js() + +=item dump_switchserver_js() + +=item resize_contentdiv_js() + +=item makedocslogform() + =back =cut