-ENDPASTE
- $r->print(' ');
+ $r->print('
'
+ .''.&mt('Clipboard').' '
+ .'');
+ $r->print(' ');
}
sub do_paste_from_buffer {
@@ -1492,8 +1507,7 @@ sub handle_edit_cmd {
}
sub editor {
- my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$type)=@_;
-
+ my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$crstype)=@_;
my $container= ($env{'form.pagepath'}) ? 'page'
: 'sequence';
@@ -1508,9 +1522,14 @@ sub editor {
$LONCAPA::map::resources[$idx]='';
}
- my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order)=
- &breadcrumbs($folder,$allowed,$type);
- $r->print($breadcrumbtrail);
+ my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order);
+ if ($allowed) {
+ ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order) =
+ &breadcrumbs($allowed,$crstype);
+ $r->print($breadcrumbtrail);
+ } else {
+ $randompick = -1;
+ }
# ------------------------------------------------------------ Process commands
@@ -1588,34 +1607,70 @@ sub editor {
my $idx=0;
my $shown=0;
if (($ishidden) || ($isencrypted) || ($randompick>=0) || ($is_random_order)) {
- $r->print(''.&mt('Parameters').':
'.
- ($randompick>=0?''.&mt('randomly pick [_1] resources',$randompick).' ':'').
+ $r->print(''.
+ '
'.&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'
+ .' of resources. Adding or removing resources from this'
+ .' folder will change the set of resources that the'
+ .' students see, resulting in spurious or missing credit'
+ .' for completed problems, not limited to ones you'
+ .' modify. Do not modify the contents of this folder if'
+ .' it is in active student use.')
+ .'
'
+ );
+ }
+ if ($is_random_order) {
+ $r->print('
'
+ .&mt('Caution: this folder is set to randomly order its'
+ .' contents. Adding or removing resources from this folder'
+ .' will change the order of resources shown.')
+ .'
'
+ );
+ }
+ $r->print('
');
}
- if ($randompick>=0) {
- $r->print(''.&mt('Caution: this folder is set to randomly pick a subset of resources. Adding or removing resources from this folder will change the set of resources that the students see, resulting in spurious or missing credit for completed problems, not limited to ones you modify. Do not modify the contents of this folder if it is in active student use.').'
');
- }
- if ($is_random_order) {
- $r->print(''.&mt('Caution: this folder is set to randomly order its contents. Adding or removing resources from this folder will change the order of resources shown.').'
');
- }
- $r->print('');
+
+ my $output;
foreach my $res (@LONCAPA::map::order) {
- my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]);
- $name=&LONCAPA::map::qtescape($name);
- $url=&LONCAPA::map::qtescape($url);
- unless ($name) { $name=(split(/\//,$url))[-1]; }
- unless ($name) { $idx++; next; }
- $r->print(&entryline($idx,$name,$url,$folder,$allowed,$res,
- $coursenum));
- $idx++;
- $shown++;
+ my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]);
+ $name=&LONCAPA::map::qtescape($name);
+ $url=&LONCAPA::map::qtescape($url);
+ unless ($name) { $name=(split(/\//,$url))[-1]; }
+ unless ($name) { $idx++; next; }
+ $output .= &entryline($idx,$name,$url,$folder,$allowed,$res,
+ $coursenum,$crstype);
+ $idx++;
+ $shown++;
}
- unless ($shown) {
- $r->print(''.&mt('Currently no documents.').' ');
+ if ($shown) {
+ $r->print(&Apache::loncommon::start_data_table());
+ if ($allowed) {
+ $r->print(&Apache::loncommon::start_data_table_header_row()
+ .''.&mt('Move').' '
+ .''.&mt('Actions').' '
+ .''.&mt('Document').' ');
+ if ($folder !~ /^supplemental/) {
+ $->print(''.&mt('Settings').' ');
+ }
+ $r->print(&Apache::loncommon::end_data_table_header_row());
+ }
+ $r->print($output
+ .&Apache::loncommon::end_data_table()
+ );
+ } else {
+ $r->print(''
+ .&mt('Currently no documents.')
+ .'
'
+ );
}
- $r->print("\n
\n");
if ($allowed) {
&print_paste_buffer($r,$container);
}
@@ -1686,7 +1741,7 @@ sub process_file_upload {
return 'failed';
} else {
if ($parseaction eq 'parse') {
- my $total_embedded = keys(%{$allfiles});
+ my $total_embedded = scalar(keys(%{$allfiles}));
if ($total_embedded > 0) {
my $num = 0;
my $state = '
@@ -1759,8 +1814,7 @@ sub parse_supplemental_title {
# --------------------------------------------------------------- An entry line
sub entryline {
- my ($index,$title,$url,$folder,$allowed,$residx,$coursenum)=@_;
-
+ my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$crstype)=@_;
my ($foldertitle,$pagetitle,$renametitle);
if (&is_supplemental_title($title)) {
($title,$foldertitle,$renametitle) = &parse_supplemental_title($title);
@@ -1778,7 +1832,7 @@ sub entryline {
$renametitle=~s/\\/\\\\/g;
$renametitle=~s/\"\;/\\\"/g;
$renametitle=~s/ /%20/g;
- my $line='';
+ my $line=&Apache::loncommon::start_data_table_row();
my ($form_start,$form_end);
# Edit commands
my ($container, $type, $esc_path, $path, $symb);
@@ -1881,18 +1935,16 @@ END
$form_end = '';
$line.=(<
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
$form_start
@@ -1919,7 +1971,7 @@ END
my $pagefile;
if ($uploaded) {
if ($extension eq 'sequence') {
- $icon=$iconpath.'/folder_closed.gif';
+ $icon=$iconpath.'/navmap.folder.closed.gif';
$url=~/\Q$coursenum\E\/([\/\w]+)\.sequence$/;
$url='/adm/coursedocs?';
$folderarg=$1;
@@ -2019,18 +2071,24 @@ END
$url.='pagepath='.&escape($pagepath).
'&pagesymb='.&escape($symb).$cpinfo;
}
- if ($external) {
+ if (($external) && ($allowed)) {
my $form = ($folder =~ /^default/)? 'newext' : 'supnewext';
$external = ' '.&mt('Edit').' ';
} else {
undef($external);
}
+ my $reinit;
+ if ($crstype eq 'Community') {
+ $reinit = &mt('(re-initialize community to access)');
+ } else {
+ $reinit = &mt('(re-initialize course to access)');
+ }
$line.='
-
+
'.($url?'':'').' '.($url?' ':'').'
-
- '.($url?"":'').$title.($url?' ':' '.&mt('(re-initialize course to access)').' ').$external."
+
+ '.($url?"":'').$title.($url?' ':' '.$reinit.' ').$external."
";
if (($allowed) && ($folder!~/^supplemental/)) {
my %lt=&Apache::lonlocal::texthash(
@@ -2055,7 +2113,7 @@ END
$form_start $parameterset $form_end
ENDPARMS
}
- $line.=" ";
+ $line.=&Apache::loncommon::end_data_table_row();
return $line;
}
@@ -2178,7 +2236,7 @@ List Symbs
sub list_symbs {
my ($r) = @_;
- my $type = &Apache::loncommon::course_type();
+ my $crstype = &Apache::loncommon::course_type();
$r->print(&Apache::loncommon::start_page('Symb List'));
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Symb List'));
my $navmap = Apache::lonnavmaps::navmap->new();
@@ -2187,7 +2245,7 @@ sub list_symbs {
''.
&mt('Unable to retrieve information about course contents').
'
');
- &Apache::lonnet::logthis('Symb list failed - could not create navmap object in '.lc($type).':'.$env{'request.course.id'});
+ &Apache::lonnet::logthis('Symb list failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'});
} else {
$r->print(" \n");
foreach my $res ($navmap->retrieveResources()) {
@@ -2201,11 +2259,11 @@ sub list_symbs {
sub verifycontent {
my ($r) = @_;
- my $type = &Apache::loncommon::course_type();
+ my $crstype = &Apache::loncommon::course_type();
my $loaderror=&Apache::lonnet::overloaderror($r);
if ($loaderror) { return $loaderror; }
- $r->print(&Apache::loncommon::start_page('Verify '.$type.' Documents'));
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$type.' Documents'));
+ $r->print(&Apache::loncommon::start_page('Verify '.$crstype.' Documents'));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$crstype.' Documents'));
$hashtied=0;
undef %alreadyseen;
%alreadyseen=();
@@ -2214,7 +2272,7 @@ sub verifycontent {
if ($hash{$key}=~/\.(page|sequence)$/) {
if (($key=~/^src_/) && ($alreadyseen{&unescape($hash{$key})})) {
$r->print(''.
- &mt('The following sequence or page is included more than once in your '.$type.': ').
+ &mt('The following sequence or page is included more than once in your '.$crstype.': ').
&unescape($hash{$key}).' '.
&mt('Note that grading records for problems included in this sequence or folder will overlap. '));
}
@@ -2237,9 +2295,9 @@ sub devalidateversioncache {
sub checkversions {
my ($r) = @_;
- my $type = &Apache::loncommon::course_type();
- $r->print(&Apache::loncommon::start_page("Check $type Document Versions"));
- $r->print(&Apache::lonhtmlcommon::breadcrumbs("Check $type Document Versions"));
+ 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"));
my $header='';
my $startsel='';
my $monthsel='';
@@ -2300,7 +2358,7 @@ sub checkversions {
&changewarning($r,'');
if ($env{'form.timerange'} eq 'all') {
# show all documents
- $header=&mt('All Documents in '.$type);
+ $header=&mt('All Documents in '.$crstype);
$allsel=1;
foreach my $key (keys(%hash)) {
if ($key=~/^ids\_(\/res\/.+)$/) {
@@ -2345,7 +2403,7 @@ sub checkversions {
$env{'course.'.$env{'request.course.id'}.'.domain'},
$env{'course.'.$env{'request.course.id'}.'.num'});
my %lt=&Apache::lonlocal::texthash
- ('st' => 'Version changes since start of '.$type,
+ ('st' => 'Version changes since start of '.$crstype,
'lm' => 'Version changes since last Month',
'lw' => 'Version changes since last Week',
'sy' => 'Version changes since Yesterday',
@@ -2354,9 +2412,9 @@ sub checkversions {
'fi' => 'File',
'md' => 'Modification Date',
'mr' => 'Most recently published Version',
- 've' => 'Version used in '.$type,
- 'vu' => 'Set Version to be used in '.$type,
-'sv' => 'Set Versions to be used in '.$type.' according to Selections below',
+ 've' => 'Version used in '.$crstype,
+ 'vu' => 'Set Version to be used in '.$crstype,
+'sv' => 'Set Versions to be used in '.$crstype.' according to Selections below',
'sm' => 'Keep all Resources up-to-date with most recent Versions (default)',
'sc' => 'Set all Resource Versions to current Version (Fix Versions)',
'di' => 'Differences');
@@ -2403,7 +2461,7 @@ ENDHEADERS
'Most Recent: '.
''.$currentversion.' '.
' '.
- 'In '.$type.': '.
+ ' In '.$crstype.': '.
'');
# Used in course
my $usedversion=$hash{'version_'.$linkurl};
@@ -2540,7 +2598,7 @@ sub init_breadcrumbs {
my ($form,$text)=@_;
&Apache::lonhtmlcommon::clear_breadcrumbs();
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs",
- text=>"Edit ".&Apache::loncommon::course_type(),
+ text=>&Apache::loncommon::course_type().' Editor',
faq=>273,
bug=>'Instructor Interface',
help => 'Docs_Adding_Course_Doc'});
@@ -2558,7 +2616,7 @@ sub handler {
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
return OK if $r->header_only;
- my $type = &Apache::loncommon::course_type();
+ my $crstype = &Apache::loncommon::course_type();
# --------------------------------------------- Initialize help topics for this
@@ -2624,7 +2682,12 @@ sub handler {
&Apache::loncommon::restore_course_settings('docs_folderpath',
{'folderpath' => 'scalar'});
}
- if (!$env{'form.folderpath'}) {
+ if (!$allowed) {
+ unless($env{'form.folderpath'} =~ /^supplemental/) {
+ $env{'form.folderpath'} = '';
+ }
+ }
+ if (!$env{'form.folderpath'} && $allowed) {
&Apache::loncommon::restore_course_settings('docs_folderpath',
{'pagepath' => 'scalar'});
}
@@ -2633,7 +2696,7 @@ sub handler {
}
if ($env{'form.folderpath'} =~ /^supplemental_\d+/) {
$env{'form.folderpath'} = 'supplemental&'.
- &escape(&mt('Supplemental '.$type.' Documents')).'&'.
+ &escape(&mt('Supplemental '.$crstype.' Documents')).'&'.
$env{'form.folderpath'};
}
&Apache::loncommon::store_course_settings('docs_folderpath',
@@ -2656,7 +2719,9 @@ sub handler {
if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) {
$showdoc='/'.$1;
}
- unless ($showdoc) { # got called from remote
+ if ($showdoc) { # got called in sequence from course
+ $allowed=0;
+ } else {
if (($env{'form.folder'}=~/^(?:group|default)_/) ||
($env{'form.folder'} =~ m:^\d+/(pages|sequences)/:)) {
$forcestandard = 1;
@@ -2667,10 +2732,28 @@ sub handler {
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']);
$script=&Apache::lonratedt::editscript('simple');
}
- } else { # got called in sequence from course
- $allowed=0;
}
+# subroutine to list form elements
+sub create_list_elements {
+ my @formarr = @_;
+ my $list = '';
+ for my $button (@formarr){
+ for my $picture(keys %$button) {
+ #my $link = Apache::lonhtmlcommon::htmltag('a' ,$button->{$picture}, {href => "test"});
+ $list .= Apache::lonhtmlcommon::htmltag('li', $picture.' '.$button->{$picture}, {class => 'LC_menubuttons_inline_text'});
+ }
+ }
+ return $list;
+}
+
+# subroutine to create ul from list elements
+sub create_form_ul {
+ my $list = shift;
+ my $ul = Apache::lonhtmlcommon::htmltag('ul',$list, {class => 'LC_ListStyleNormal'});
+ return $ul;
+}
+
# get course data
my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'};
my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'};
@@ -2693,11 +2776,33 @@ sub handler {
.$script."\n"
.'// ]]>'."\n"
.''."\n";
- my $brcrum = [{href=>"/adm/createuser",text=>"$type Documents"}];
- $r->print(&Apache::loncommon::start_page("$type Documents", $script,
- {'force_register' => $showdoc,
- 'bread_crumbs' => $brcrum}).
- &Apache::loncommon::help_open_menu('','',273,'RAT'));
+
+ # Breadcrumbs
+ &Apache::lonhtmlcommon::clear_breadcrumbs();
+ if ($allowed) {
+ &Apache::lonhtmlcommon::add_breadcrumb({
+ href=>"/adm/coursedocs",text=>"$crstype Editor"});
+
+ $r->print(&Apache::loncommon::start_page("$crstype Editor", $script,
+ {'force_register' => $showdoc,})
+ .&Apache::loncommon::help_open_menu('','',273,'RAT')
+ .&Apache::lonhtmlcommon::breadcrumbs(
+ 'Editing the Table of Contents for your '.$crstype,
+ 'Docs_Adding_Course_Doc')
+ );
+ } elsif ($showdoc) {
+ $r->print(&Apache::loncommon::start_page("$crstype documents",undef,
+ {'force_register' => $showdoc,}));
+ } else {
+ my $folder=$env{'form.folder'};
+ if ($folder eq '' || $folder eq 'supplemental') {
+ $env{'form.folderpath'} = 'supplemental&'.
+ &escape(&mt('Supplemental '.$crstype.' Documents'));
+ }
+ my ($breadcrumbtrail) = &breadcrumbs($allowed,$crstype);
+ $r->print(&Apache::loncommon::start_page("Supplemental documents").
+ $breadcrumbtrail);
+ }
my %allfiles = ();
my %codebase = ();
@@ -2789,8 +2894,8 @@ sub handler {
unless ($showdoc || $upload_result eq 'phasetwo') {
# -----------------------------------------------------------------------------
my %lt=&Apache::lonlocal::texthash(
- 'uplm' => 'Upload a new main '.lc($type).' document',
- 'upls' => 'Upload a new supplemental '.lc($type).' document',
+ 'uplm' => 'Upload a new main '.lc($crstype).' document',
+ 'upls' => 'Upload a new supplemental '.lc($crstype).' document',
'impp' => 'Import a document',
'copm' => 'All documents out of a published map into this folder',
'upld' => 'Upload Document',
@@ -2819,7 +2924,7 @@ sub handler {
'file' => 'File',
'title' => 'Title',
'comment' => 'Comment',
- 'parse' => 'Upload embedded images/multimedia files if HTML file!',
+ 'parse' => 'Upload embedded images/multimedia files if HTML file',
'nd' => 'Upload Document',
'pm' => 'Published Map',
'sd' => 'Special Document',
@@ -2840,6 +2945,7 @@ FIUP
CHBO
+ my $fileuploada = " $help{'Uploading_From_Harddrive'}";
my $fileuploadform=(<
@@ -2853,27 +2959,25 @@ CHBO
$checkbox
-
-
-
-
- $help{'Uploading_From_Harddrive'}
-
+FUFORM
+ #$list .= Apache::lonhtmlcommon::htmltag('li', $picture.' '.$button->{$picture}, {class => 'LC_menubuttons_inline_text'});
+ #$fileuploadform .= create_form_ul(create_list_elements(@fileuploada));
+ $fileuploadform .= create_form_ul(Apache::lonhtmlcommon::htmltag('li',$fileuploada,{class => 'LC_menubuttons_inline_text'}));
+ $fileuploadform .= (<
FUFORM
my $simpleeditdefaultform=(<
- $uploadtag
-
-
-
-
- $help{'Importing_LON-CAPA_Resource'}
-
-
-
+SEDFFORM
+ my @simpleeditdefaultforma = (
+ { ' ' => "$uploadtag$lt{'srch'} " },
+ { ' ' => "$lt{'impo'} $help{'Importing_LON-CAPA_Resource'}" },
+ { ' ' => "$lt{'book'} " },
+ );
+ $simpleeditdefaultform .= create_form_ul(create_list_elements(@simpleeditdefaultforma));
+ $simpleeditdefaultform .=(<
$lt{'copm'}
@@ -2890,10 +2994,7 @@ SEDFFORM
ERFORM
@@ -2911,7 +3012,7 @@ ERFORM
if ($env{'form.folder'} eq '' ||
$env{'form.folder'} eq 'supplemental') {
$folderpath='default&'.
- &escape(&mt('Main '.$type.' Documents'));
+ &escape(&mt('Main '.$crstype.' Documents'));
}
}
unless ($env{'form.pagepath'}) {
@@ -2933,38 +3034,54 @@ ERFORM
HIDDENFORM
}
# --------------------------------------------------------- Main tab structure
+
my $activeClass = 1;
my $active = '';
- $r->print('');
- if (($standard) && ($allowed) && (!$forcesupplement) && (($env{'form.folderpath'}=~/^default/) || $env{'form.folderpath'}eq"" || ($env{'form.pagepath'}))) {
- if($activeClass == 1){
- $active = 'class="active"';
- $activeClass = 0;
- }
- }
- $r->print(''.&mt('Main Course Documents').' ');
- $active = '';
- if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) {
- if($activeClass == 1){
- $active = 'class="active"';
- }
- }
- $r->print(''.&mt('Supplemental Course Documents').' ');
- $r->print(' '
- .''
+ my %tabtitles = (
+ main => {
+ Course => &mt('Main Course Documents'),
+ Community => &mt('Main Community Documents'),
+ },
+ supplemental => {
+ Course => &mt('Supplemental Course Documents'),
+ Community => &mt('Supplemental Community Documents'),
+ },
+ );
+ if ($allowed) {
+ $r->print('
');
+ if (($standard) && ($allowed) && (!$forcesupplement) && (($env{'form.folderpath'}=~/^default/) || $env{'form.folderpath'}eq"" || ($env{'form.pagepath'}))) {
+ if($activeClass == 1){
+ $active = 'class="active"';
+ $activeClass = 0;
+ }
+ }
+ $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(' ');
+ } else {
+ $r->print('
');
+ }
+ $r->print('
'
.'
');
# --------------------------------------------------------- Standard documents
my $savefolderpath;
- my $active = 'style="display: none;"';
+ $active = 'style="display: none;"';
if($activeClass == 0){
$active = 'style="display: block;"';
}
+ if ($allowed) {
$r->print('
');
my $folder=$env{'form.folder'};
if ($folder eq '' || $folder=~/^supplemental/) {
$folder='default';
$savefolderpath = $env{'form.folderpath'};
- $env{'form.folderpath'}='default&'.&escape(&mt('Main '.$type.' Documents'));
+ $env{'form.folderpath'}='default&'.&escape($tabtitles{'main'}{$crstype});
$uploadtag = '
';
}
@@ -2993,14 +3110,14 @@ HIDDENFORM
my $recoverform=(<
-
+ $lt{'reco'}
RFORM
my $imspform=(<
-
+ $lt{'imsf'}
IMSPFORM
@@ -3010,10 +3127,8 @@ IMSPFORM
$uploadtag
-
-
+ $lt{'navc'}
$help{'Navigate_Content'}
-
NNFORM
my $newsmppageform=(<
$uploadtag
-
- $help{'Simple Page'}
-
+ $lt{'sipa'}
+ $help{'Simple Page'}
NSPFORM
@@ -3033,10 +3146,8 @@ NSPFORM
$uploadtag
-
- $help{'Simple Problem'}
-
+ $lt{'sipr'}
+ $help{'Simple Problem'}
NSPROBFORM
@@ -3046,10 +3157,7 @@ NSPROBFORM
$uploadtag
-
-
-
+ $lt{'drbx'}
NDBFORM
@@ -3058,11 +3166,8 @@ NDBFORM
$uploadtag
-
-
+ $lt{'scuf'}
$help{'Score_Upload_Form'}
-
NEXUFORM
@@ -3071,11 +3176,8 @@ NEXUFORM
$uploadtag
-
-
+ $lt{'bull'}
$help{'Bulletin Board'}
-
NBFORM
@@ -3085,10 +3187,8 @@ NBFORM
$uploadtag
-
-
+ $lt{'mypi'}
$help{'My Personal Information Page'}
-
NAMFORM
@@ -3097,10 +3197,7 @@ NAMFORM
$uploadtag
-
-
-
+ $lt{'abou'}
NASOFORM
@@ -3111,42 +3208,36 @@ NASOFORM
$uploadtag
-
-
+ $lt{'rost'}
$help{'Course Roster'}
-
NROSTFORM
my $specialdocumentsform;
+my @specialdocumentsforma;
my $newfolderform;
+my $newfolderb;
unless ($env{'form.pagepath'}) {
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
-
+
my $newpageform=(<
-
- $help{'Adding_Pages'}
-
+ $lt{'newp'}
+ $help{'Adding_Pages'}
NPFORM
+
$newfolderform=(<
-
- $help{'Adding_Folders'}
-
+ $lt{'newf'} $help{'Adding_Folders'}
NFFORM
@@ -3156,10 +3247,9 @@ NFFORM
$uploadtag
-
-
+ $lt{'syll'}
$help{'Syllabus'}
-
+
NSYLFORM
@@ -3169,36 +3259,54 @@ NSYLFORM
$uploadtag
-
-
+ $lt{'grpo'}
$help{'Group Portfolio'}
-
NGFFORM
-
- $specialdocumentsform=" $newpageform $newsylform $newgroupfileform";
+ @specialdocumentsforma=(
+ {' '=>$newpageform},
+ {' '=>$newsylform},
+ {' '=>$newgroupfileform},
+ );
+
}
- $specialdocumentsform.=" $newnavform $newsmppageform
- $newsmpproblemform $newdropboxform
- $newexuploadform $newbulform
- $newaboutmeform $newaboutsomeoneform
- $newrosterform";
+ push @specialdocumentsforma, ({' '=>$newnavform},
+ {' '=>$newsmppageform},
+ {' '=>$newsmpproblemform},
+ {' '=>$newdropboxform},
+ {' '=>$newexuploadform},
+ {' '=>$newbulform},
+ {' '=>$newaboutmeform},
+ {' '=>$newaboutsomeoneform},
+ {' '=>$newrosterform},);
+
+ $specialdocumentsform = create_form_ul(create_list_elements(@specialdocumentsforma));
+
if($env{'form.pagepath'}) {
- $specialdocumentsform=" $newsmpproblemform $newexuploadform";
+
+ @specialdocumentsforma=(
+ {' '=>$newsmpproblemform},
+ {' '=>$newexuploadform}
+ );
+ $specialdocumentsform= create_form_ul(create_list_elements(@specialdocumentsforma));
}
+my @tools = (
+ {' '=>$extresourcesform},
+ {' '=>$imspform},
+ {' '=>$recoverform},
+ );
+
my %orderhash = (
- 'aa' => ['Upload Document',$fileuploadform.' '.$newfolderform],
+ '00' => ['Newfolder',$newfolderform],
+ 'aa' => ['Upload Document',$fileuploadform],
'bb' => ['Published Resources',$simpleeditdefaultform],
'cc' => ['Special Documents',$specialdocumentsform],
- 'dd' => ['Tools',$extresourcesform.' '.$imspform.' '.$recoverform.' '.&generate_admin_options($containertag,$uploadtag,\%help,\%env)],
- 'zz' => ['Hide'],
+ 'dd' => ['Tools', create_form_ul(create_list_elements(@tools)).&generate_admin_options($containertag,$uploadtag,\%help,\%env)],
);
my $tid='1';
-my $varcd = 'Main Course Documents';
-$r->print(&generate_edit_table($tid,$varcd,\%orderhash));
$hadchanges=0;
- my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
+ my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype);
if ($error) {
$r->print(''.$error.'
');
}
@@ -3207,13 +3315,14 @@ $r->print(&generate_edit_table($tid,$var
}
&changewarning($r,'');
- $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
- &mt('Editing the Table of Contents for your '.$type)));
+$r->print(&generate_edit_table($tid,\%orderhash));
+
$r->print(' ');
+ }
if ($env{'form.pagepath'}) {
}
# ----------------------------------------------------- Supplemental documents
- my $active = 'style="display: none;"';
+ $active = 'style="display: none;"';
if($activeClass == 1){
$active = 'style="display: block;"';
}
@@ -3225,8 +3334,8 @@ $r->print('
');
if ($folder =~ /^supplemental$/ &&
(($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) {
$env{'form.folderpath'} = 'supplemental&'.
- &escape(&mt('Supplemental '.$type.' Documents'));
- }else{
+ &escape(&mt('Supplemental '.$crstype.' Documents'));
+ } elsif ($allowed) {
$env{'form.folderpath'} = $savefolderpath;
}
$env{'form.pagepath'} = '';
@@ -3237,8 +3346,9 @@ $r->print('
');
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
+ my $supupdocformbtn = "
$help{'Uploading_From_Harddrive'}";
my $supupdocform=(<
+ ');
$lt{'comment'}:
-
+
-
-
- $help{'Uploading_From_Harddrive'}
-
-
SUPDOCFORM
+ $supupdocform .= create_form_ul(Apache::lonhtmlcommon::htmltag('li',$supupdocformbtn,{class => 'LC_menubuttons_inline_text'}))."";
my $supnewfolderform=(<
-
- $help{'Adding_Folders'}
-
+ $lt{'newf'}
+ $help{'Adding_Folders'}
SNFFORM
-
+
my $supnewextform=(<
-
- $help{'Adding_External_Resource'}
-
+ $lt{'extr'} $help{'Adding_External_Resource'}
SNEFORM
@@ -3293,45 +3391,52 @@ SNEFORM
-
-
+ $lt{'syll'}
$help{'Syllabus'}
-
SNSFORM
my $supnewaboutmeform=(<
+
SNAMFORM
-
+my @specialdocs = (
+ {' '=>$supnewextform},
+ {' '=>$supnewsylform},
+ {' '=>$supnewaboutmeform},
+ );
my %suporderhash = (
- 'ee' => ['Upload Document',$supupdocform.' '.$supnewfolderform],
- 'ff' => ['Special Documents',$supnewextform.' '.$supnewsylform.' '.$supnewaboutmeform],
- 'zz' => ['Hide'],
+ '00' => ['Supnewfolder', $supnewfolderform],
+ 'ee' => ['Upload Document',$supupdocform],
+ 'ff' => ['Special Documents',create_form_ul(create_list_elements(@specialdocs))]
);
-my $tid='2';
-my $varscd = 'Supplemental Course Documents';
+ my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype);
+ if ($error) {
+ $r->print(''.$error.'
');
+ }
+ my $tid='2';
+ $r->print(&generate_edit_table($tid,\%suporderhash));
+ } else {
+ my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype);
+ if ($error) {
+ $r->print(''.$error.'
');
+ }
+ }
+
-$r->print(&generate_edit_table($tid,$varscd,\%suporderhash));
-my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
- if ($error) {
- $r->print(''.$error.'
');
- }
-$r->print('');
- }
$r->print('');
+$r->print('');
+
+
if ($allowed) {
$r->print('
-ENDOPTIONFORM
+ my @list = (
+ {' '=>"$lt{'vc'} $help{'Verify_Content'}"},
+ {' '=>"$lt{'cv'} $help{'Check_Resource_Versions'}"},
+ );
+ if($dumpbut ne ''){
+ push @list, {' '=>$dumpbut};
+ }
+ push @list, ({' '=>$exportbut},
+ {' '=>"$lt{'ls'} "},
+ {' '=>"$lt{'sl'} "},
+ );
+ return '';
}
sub generate_edit_table {
- my ($tid,$varcd,$orderhash_ref) = @_;
+ my ($tid,$orderhash_ref) = @_;
+ return unless(ref($orderhash_ref) eq 'HASH');
my %orderhash = %{$orderhash_ref};
my $form;
my $activetab;
@@ -3391,29 +3498,25 @@ sub generate_edit_table {
if($env{'form.active'} ne ''){
$activetab = $env{'form.active'};
}
- $form = ''.&mt($varcd).' ';
+ $form = '
';
$form .= '
';
foreach my $name (sort(keys(%orderhash))){
- if($name eq 'zz'){
- if($activetab ne ''){
- $active = 'class="right"';
- }else{
- $active = 'class="right active"';
- }
- $form .= ''.&mt(${$orderhash{$name}}[0]).' ';
- }else{
+ if($name ne '00'){
if($activetab eq '' || $activetab ne $name){
$active = '';
}elsif($activetab eq $name){
$active = 'class="active"';
}
$form .= ''.&mt(${$orderhash{$name}}[0]).' ';
- }
+ } else {
+ $form .= ''.${$orderhash{$name}}[1].' ';
+
+ }
}
$form .= ' ';
- $form .= '
';
+ $form .= '
';
foreach my $field (keys(%orderhash)){
- if($field ne 'zz'){
+ if($field ne '00'){
if($activetab eq '' || $activetab ne $field){
$active = 'style="display: none;"';
}elsif($activetab eq $field){
@@ -3660,8 +3763,8 @@ for (i = 0; i < currentDivs.length; i++)
function openTabs(pageId) {
tabnav = document.getElementById(pageId).getElementsByTagName('UL');
- if(tabnav.length > 0 ){
- currentNav = document.getElementById(tabnav[0].id);
+ if(tabnav.length > 2 ){
+ currentNav = document.getElementById(tabnav[1].id);
currentLis = currentNav.getElementsByTagName('LI');
for(i = 0; i< currentLis.length; i++){
if(currentLis[i].className == 'active') {
@@ -3684,6 +3787,13 @@ function showPage(current, pageId, nav,
return false;
}
+function injectData(current, hiddenField, name, value) {
+ currentElement = document.getElementById(hiddenField);
+ currentElement.name = name;
+ currentElement.value = value;
+ current.submit();
+}
+
ENDNEWSCRIPT
}
1;