--- loncom/interface/londocs.pm 2010/03/18 13:48:45 1.422
+++ loncom/interface/londocs.pm 2010/08/25 00:12:38 1.437
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.422 2010/03/18 13:48:45 onken Exp $
+# $Id: londocs.pm,v 1.437 2010/08/25 00:12:38 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -121,7 +121,7 @@ sub dumpbutton {
if ($home+$other==0) { return ''; }
if ($home) {
my $link =
- ""
.&mt('Dump '.$crstype.' Documents to Construction Space')
@@ -268,7 +268,7 @@ sub dumpcourse {
sub exportbutton {
my $crstype = &Apache::loncommon::course_type();
- return "".&mt('IMS Export')."".
+ return "".
&Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'
';
}
@@ -1607,13 +1607,12 @@ sub editor {
my $shown=0;
if (($ishidden) || ($isencrypted) || ($randompick>=0) || ($is_random_order)) {
$r->print('
'.
- '
'.&mt('Parameters:').
- '
'.
+ '- '.&mt('Parameters:').'
'.
($randompick>=0?'- '.&mt('randomly pick [quant,_1,resource]',$randompick).'
':'').
($ishidden?'- '.&mt('contents hidden').'
':'').
($isencrypted?'- '.&mt('URLs hidden').'
':'').
($is_random_order?'- '.&mt('random order').'
':'').
- '
');
+ '');
if ($randompick>=0) {
$r->print('
'
.&mt('Caution: this folder is set to randomly pick a subset'
@@ -1637,7 +1636,9 @@ sub editor {
$r->print('
');
}
- my $output;
+ my $output;
+
+ &Apache::loncommon::start_data_table_count(); #setup a row counter
foreach my $res (@LONCAPA::map::order) {
my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]);
$name=&LONCAPA::map::qtescape($name);
@@ -1649,6 +1650,8 @@ sub editor {
$idx++;
$shown++;
}
+ &Apache::loncommon::end_data_table_count();
+
if ($shown) {
$r->print(&Apache::loncommon::start_data_table());
if ($allowed) {
@@ -2260,8 +2263,6 @@ sub list_symbs {
sub verifycontent {
my ($r) = @_;
my $crstype = &Apache::loncommon::course_type();
- my $loaderror=&Apache::lonnet::overloaderror($r);
- if ($loaderror) { return $loaderror; }
$r->print(&Apache::loncommon::start_page('Verify '.$crstype.' Documents'));
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$crstype.' Documents'));
$hashtied=0;
@@ -2480,11 +2481,11 @@ ENDHEADERS
# Set version
$r->print(&Apache::loncommon::select_form($setversions{$linkurl},
'set_version_'.$linkurl,
- ('select_form_order' =>
+ {'select_form_order' =>
['',1..$currentversion,'mostrecent'],
'' => '',
'mostrecent' => &mt('most recent'),
- map {$_,$_} (1..$currentversion))));
+ map {$_,$_} (1..$currentversion)}));
$r->print(' | ');
my $lastold=1;
for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) {
@@ -2717,9 +2718,22 @@ sub handler {
$env{'form.pagename'}=&unescape(pop(@pagepath));
$env{'form.folder'}=pop(@pagepath);
$containertag = ''.
- '';
- $uploadtag = ''.
- '';
+ '';
+ $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;
@@ -2906,7 +2920,7 @@ sub create_form_ul {
'upld' => 'Import Document',
'srch' => 'Search',
'impo' => 'Import',
- 'book' => 'Import Bookmarks',
+ 'wish' => 'Import from Wishlist',
'selm' => 'Select Map',
'load' => 'Load Map',
'reco' => 'Recover Deleted Documents',
@@ -2914,7 +2928,7 @@ sub create_form_ul {
'newp' => 'New Composite Page',
'extr' => 'External Resource',
'syll' => 'Syllabus',
- 'navc' => 'Navigate Contents',
+ 'navc' => 'Table of Contents',
'sipa' => 'Simple Course Page',
'sipr' => 'Simple Problem',
'drbx' => 'Drop Box',
@@ -2977,9 +2991,9 @@ FUFORM
SEDFFORM
my @simpleeditdefaultforma = (
- { '' => "$uploadtag$lt{'srch'}" },
- { '' => "$lt{'impo'}$help{'Importing_LON-CAPA_Resource'}" },
- { '' => "$lt{'book'}" },
+ { '' => "$uploadtag" },
+ { '' => "$help{'Importing_LON-CAPA_Resource'}" },
+ { '' => "" },
);
$simpleeditdefaultform .= create_form_ul(create_list_elements(@simpleeditdefaultforma));
$simpleeditdefaultform .=(<
$uploadtag
- $lt{'extr'}$help{'Adding_External_Resource'}
+ $help{'Adding_External_Resource'}
ERFORM
@@ -3012,18 +3026,6 @@ ERFORM
'sl' => 'Show Log'
);
- 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 ($env{'form.pagepath'}) {
- $containertag = '';
- $uploadtag = '';
- }
$r->print(<
@@ -3060,14 +3062,16 @@ HIDDENFORM
$activeClass = 0;
}
}
- $r->print(''.$tabtitles{'main'}{$crstype}.'');
+ $r->print(''.$tabtitles{'main'}{$crstype}.'');
$active = '';
if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) {
if($activeClass == 1){
$active = 'class="active"';
}
}
- $r->print(''.$tabtitles{'supplemental'}{$crstype}.'');
+ $r->print(''.$tabtitles{'supplemental'}{$crstype}.'');
$r->print('');
} else {
$r->print('
');
@@ -3115,14 +3119,14 @@ HIDDENFORM
my $recoverform=(<
- $lt{'reco'}
+
RFORM
my $imspform=(<
- $lt{'imsf'}
+
IMSPFORM
@@ -3132,7 +3136,7 @@ IMSPFORM
$uploadtag
- $lt{'navc'}
+
$help{'Navigate_Content'}
NNFORM
@@ -3141,7 +3145,7 @@ NNFORM
$uploadtag
- $lt{'sipa'}
+
$help{'Simple Page'}
NSPFORM
@@ -3151,7 +3155,7 @@ NSPFORM
$uploadtag
- $lt{'sipr'}
+
$help{'Simple Problem'}
@@ -3162,7 +3166,7 @@ NSPROBFORM
$uploadtag
- $lt{'drbx'}
+
NDBFORM
@@ -3171,7 +3175,7 @@ NDBFORM
$uploadtag
- $lt{'scuf'}
+
$help{'Score_Upload_Form'}
NEXUFORM
@@ -3181,7 +3185,7 @@ NEXUFORM
$uploadtag
- $lt{'bull'}
+
$help{'Bulletin Board'}
NBFORM
@@ -3192,7 +3196,7 @@ NBFORM
$uploadtag
- $lt{'mypi'}
+
$help{'My Personal Information Page'}
NAMFORM
@@ -3202,7 +3206,7 @@ NAMFORM
$uploadtag
- $lt{'abou'}
+
NASOFORM
@@ -3213,7 +3217,7 @@ NASOFORM
$uploadtag
- $lt{'rost'}
+
$help{'Course Roster'}
NROSTFORM
@@ -3231,7 +3235,7 @@ my $newfolderb;
- $lt{'newp'}
+
$help{'Adding_Pages'}
NPFORM
@@ -3252,7 +3256,7 @@ NFFORM
$uploadtag
- $lt{'syll'}
+
$help{'Syllabus'}
@@ -3264,7 +3268,7 @@ NSYLFORM
$uploadtag
- $lt{'grpo'}
+
$help{'Group Portfolio'}
NGFFORM
@@ -3272,9 +3276,13 @@ NGFFORM
{''=>$newpageform},
{''=>$newsylform},
{''=>$newgroupfileform},
- );
-
- }
+ );
+
+ my @importdoc = (
+ {''=>$extresourcesform},
+ {''=>$imspform},);
+ $fileuploadform = create_form_ul(create_list_elements(@importdoc)) . '
' . $fileuploadform;
+
push @specialdocumentsforma, ({''=>$newnavform},
{''=>$newsmppageform},
{''=>$newsmpproblemform},
@@ -3283,9 +3291,10 @@ NGFFORM
{''=>$newbulform},
{''=>$newaboutmeform},
{''=>$newaboutsomeoneform},
- {''=>$newrosterform},);
+ {''=>$newrosterform},);
$specialdocumentsform = create_form_ul(create_list_elements(@specialdocumentsforma));
+ }
if($env{'form.pagepath'}) {
@@ -3299,21 +3308,19 @@ if($env{'form.pagepath'}) {
my @tools = (
# {''=>$extresourcesform},
# {''=>$imspform},
- {''=>$recoverform},
+ {''=>$recoverform},
);
-my @importdoc = (
- {''=>$extresourcesform},
- {''=>$imspform},
-);
-$fileuploadform = create_form_ul(create_list_elements(@importdoc)) . '
' . $fileuploadform;
my %orderhash = (
- '00' => ['Newfolder',$newfolderform],
'aa' => ['Import Documents',$fileuploadform],
'bb' => ['Published Resources',$simpleeditdefaultform],
'cc' => ['Special Documents',$specialdocumentsform],
- 'dd' => ['Tools', create_form_ul(create_list_elements(@tools)).&generate_admin_options($containertag,$uploadtag,\%help,\%env)],
+ 'dd' => ['Tools', create_form_ul(create_list_elements(@tools)).&generate_admin_options(\%help,\%env)],
);
+unless($env{'form.pagepath'}) {
+ $orderhash{'00'} = ['Newfolder',$newfolderform];
+}
+
my $tid='1';
$hadchanges=0;
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype);
@@ -3329,8 +3336,6 @@ $r->print(&generate_edit_table($tid,\%or
$r->print('');
}
- if ($env{'form.pagepath'}) {
- }
# ----------------------------------------------------- Supplemental documents
$active = 'style="display: none;"';
if($activeClass == 1){
@@ -3380,7 +3385,7 @@ SUPDOCFORM
- $lt{'newf'}
+
$help{'Adding_Folders'}
SNFFORM
@@ -3391,7 +3396,7 @@ SNFFORM
- $lt{'extr'} $help{'Adding_External_Resource'}
+ $help{'Adding_External_Resource'}
SNEFORM
@@ -3401,7 +3406,7 @@ SNEFORM
- $lt{'syll'}
+
$help{'Syllabus'}
SNSFORM
@@ -3412,7 +3417,7 @@ SNSFORM
- $lt{'mypi'}
+
$help{'My Personal Information Page'}
SNAMFORM
@@ -3477,8 +3482,8 @@ $r->print('');
}
sub generate_admin_options {
- my ($containertag,$uploadtag,$help_ref,$env_ref) = @_;
- my %lt=&Apache::lonlocal::texthash(
+ my ($help_ref,$env_ref) = @_;
+ my %lt=&Apache::lonlocal::texthash(
'vc' => 'Verify Content',
'cv' => 'Check/Set Resource Versions',
'ls' => 'List Symbs',
@@ -3492,19 +3497,19 @@ sub generate_admin_options {
my $exportbut=&exportbutton();
my @list = (
{''
- => "$lt{'vc'}$help{'Verify_Content'}"},
+ => "$help{'Verify_Content'}"},
{''
- =>"$lt{'cv'}$help{'Check_Resource_Versions'}"},
+ =>"$help{'Check_Resource_Versions'}"},
);
if($dumpbut ne ''){
push @list, {''=>$dumpbut};
}
- push @list, ({''
+ push @list, ({''
=>$exportbut},
{''
- =>"$lt{'ls'}"},
- {''
- =>"$lt{'sl'}"},
+ =>""},
+ {''
+ =>""},
);
return '';
@@ -3530,7 +3535,9 @@ sub generate_edit_table {
}elsif($activetab eq $name){
$active = 'class="active"';
}
- $form .= ''.&mt(${$orderhash{$name}}[0]).'';
+ $form .= ''.&mt(${$orderhash{$name}}[0]).'';
} else {
$form .= ''.${$orderhash{$name}}[1].'';
@@ -3582,6 +3589,18 @@ sub editing_js {
p_ctr2b => '?[_98]'
);
+ my $crstype = &Apache::loncommon::course_type();
+ my $docs_folderpath = &HTML::Entities::encode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.folderpath'},'<>&"');
+ my $docs_pagepath = &HTML::Entities::encode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.pagepath'},'<>&"');
+ my $main_container_page;
+ if ($docs_folderpath eq '') {
+ if ($docs_pagepath ne '') {
+ $main_container_page = 1;
+ }
+ }
+ my $toplevelmain = 'default&Main%20'.$crstype.'%20Documents';
+ my $toplevelsupp = 'supplemental&Supplemental%20'.$crstype.'%20Documents';
+
return <