'.
- ($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.').'
');
+ 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('
');
}
- $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);
+ $idx++;
+ $shown++;
}
- unless ($shown) {
- $r->print(''.&mt('Currently no documents.').' ');
+ if ($shown) {
+ $r->print(&Apache::loncommon::start_data_table()
+ .&Apache::loncommon::start_data_table_header_row()
+ .''.&mt('Move').' '
+ .''.&mt('Actions').' '
+ .''.&mt('Document').' '
+ .''.&mt('Settings').' '
+ .&Apache::loncommon::end_data_table_header_row()
+ .$output
+ .&Apache::loncommon::end_data_table()
+ )
+ }
+ unless($shown) {
+ $r->print(''
+ .&mt('Currently no documents.')
+ .'
'
+ );
}
- $r->print("\n
\n");
if ($allowed) {
&print_paste_buffer($r,$container);
}
@@ -1649,7 +1719,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 = '
@@ -1660,7 +1730,7 @@ sub process_file_upload {
';
$phase_status = 'phasetwo';
- $$upload_output .=
+ $$upload_output .=
'This file contains embedded multimedia objects, which need to be uploaded to LON-CAPA. '.
&Apache::loncommon::ask_for_embedded_content(
'/adm/coursedocs',$state,$allfiles,$codebase);
@@ -1715,7 +1785,7 @@ sub parse_supplemental_title {
}
if (wantarray) {
return ($title,$foldertitle,$renametitle);
- }
+ }
return $title;
}
@@ -1736,12 +1806,12 @@ sub entryline {
}
my $orderidx=$LONCAPA::map::order[$index];
-
+
$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);
@@ -1763,19 +1833,19 @@ sub entryline {
my $incindex=$index+1;
my $selectbox='';
if (($folder!~/^supplemental/) &&
- ($#LONCAPA::map::order>0) &&
+ ($#LONCAPA::map::order>0) &&
((split(/\:/,
- $LONCAPA::map::resources[$LONCAPA::map::order[0]]))[1]
- ne '') &&
+ $LONCAPA::map::resources[$LONCAPA::map::order[0]]))[1]
+ ne '') &&
((split(/\:/,
- $LONCAPA::map::resources[$LONCAPA::map::order[1]]))[1]
+ $LONCAPA::map::resources[$LONCAPA::map::order[1]]))[1]
ne '')) {
$selectbox=
' '.
- '';
+ '';
for (my $i=1;$i<=$#LONCAPA::map::order+1;$i++) {
if ($i==$incindex) {
- $selectbox.='('.$i.') ';
+ $selectbox.='('.$i.') ';
} else {
$selectbox.=''.$i.' ';
}
@@ -1805,13 +1875,13 @@ sub entryline {
}
}
}
- if ($url=~/^\/res\/lib\/templates\//) {
- $nocopy=1;
+ if ($url=~/^\/res\/lib\/templates\//) {
+ $nocopy=1;
$nocut=1;
}
my $copylink=' ';
my $cutlink=' ';
-
+
my $skip_confirm = 0;
if ( $folder =~ /^supplemental/
|| ($url =~ m{( /smppg$
@@ -1844,18 +1914,16 @@ END
$form_end = '';
$line.=(<
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
$form_start
@@ -1882,7 +1950,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;
@@ -1897,8 +1965,9 @@ END
&Apache::lonnet::allowuploaded('/adm/coursedoc',$url);
}
}
-
+
my $orig_url = $url;
+ $orig_url=~s{http(:|:)//https(:|:)//}{https$2//};
my $external = ($url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/});
if ((!$isfolder) && ($residx) && ($folder!~/supplemental/) && (!$ispage)) {
my $symb=&Apache::lonnet::symbclean(
@@ -1920,7 +1989,7 @@ END
} elsif ($url!~/\.(sequence|page)$/) {
$url='/adm/coursedocs/showdoc'.$url;
}
- } elsif ($url=~m|^/ext/|) {
+ } elsif ($url=~m|^/ext/|) {
$url='/adm/wrapper'.$url;
$external = 1;
}
@@ -1931,7 +2000,7 @@ END
}
if ($container eq 'page') {
my $symb=$env{'form.pagesymb'};
-
+
$url=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($symb))[2]);
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb);
}
@@ -1941,7 +2010,7 @@ END
my $foldername=&escape($foldertitle);
my $folderpath=$env{'form.folderpath'};
if ($folderpath) { $folderpath.='&' };
-# Append randompick number, hidden, and encrypted with ":" to foldername,
+# Append randompick number, hidden, and encrypted with ":" to foldername,
# so it gets transferred between levels
$folderpath.=$folderarg.'&'.$foldername.':'.(&LONCAPA::map::getparameter($orderidx,
'parameter_randompick'))[0]
@@ -1953,7 +2022,7 @@ END
'parameter_randomorder'))[0]=~/^yes$/i);
$url.='folderpath='.&escape($folderpath).$cpinfo;
$parameterset=''.&mt('Randomly Pick: ').
- ' '.
@@ -1961,7 +2030,7 @@ END
my $ro_set=
((&LONCAPA::map::getparameter($orderidx,'parameter_randomorder'))[0]=~/^yes$/i?' checked="checked"':'');
$rand_order_text ='
- '.&mt('Random Order').' ';
+ '.&mt('Random Order').' ';
}
if ($ispage) {
my $pagename=&escape($pagetitle);
@@ -1988,10 +2057,10 @@ END
undef($external);
}
$line.='
-
+
'.($url?'':'').' '.($url?' ':'').'
-
+
'.($url?"":'').$title.($url?' ':' '.&mt('(re-initialize course to access)').' ').$external."
";
if (($allowed) && ($folder!~/^supplemental/)) {
@@ -1999,25 +2068,25 @@ END
'hd' => 'Hidden',
'ec' => 'URL hidden');
my $enctext=
- ((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i?' checked="1"':'');
+ ((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i?' checked="checked"':'');
my $hidtext=
- ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i?' checked="1"':'');
+ ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i?' checked="checked"':'');
$line.=(<
$form_start
- $lt{'hd'}
+ $lt{'hd'}
$form_end
$form_start
- $lt{'ec'}
+ $lt{'ec'}
$form_end
$form_start $rand_order_text $form_end
$form_start $parameterset $form_end
ENDPARMS
}
- $line.=" ";
+ $line.=&Apache::loncommon::end_data_table_row();
return $line;
}
@@ -2044,7 +2113,7 @@ sub tiehash {
$hashtied=1;
}
}
- }
+ }
}
sub untiehash {
@@ -2093,7 +2162,7 @@ sub checkonthis {
if (($errorcount) ||
($warningcount)) {
if ($errorcount) {
- $r->print(''.
+ $r->print(''.
&mt('[quant,_1,error]',$errorcount).' ');
}
if ($warningcount) {
@@ -2118,7 +2187,7 @@ sub checkonthis {
unless ($url=~/\$/) {
$r->print(''.&mt('not found').' ');
} else {
- $r->print(''.&mt('unable to verify variable URL').' ');
+ $r->print(''.&mt('unable to verify variable URL').' ');
}
} else {
$r->print(''.&mt('access denied').' ');
@@ -2252,7 +2321,7 @@ sub checkversions {
if ($haschanged) {
if (&Apache::lonnet::put('resourceversions',\%newsetversions,
$env{'course.'.$env{'request.course.id'}.'.domain'},
- $env{'course.'.$env{'request.course.id'}.'.num'}) eq 'ok') {
+ $env{'course.'.$env{'request.course.id'}.'.num'}) eq 'ok') {
$r->print(''.&mt('Your Version Settings have been Saved').' ');
} else {
$r->print(''.&mt('An Error Occured while Attempting to Save your Version Settings').' ');
@@ -2393,7 +2462,7 @@ ENDHEADERS
$lastold=$prevvers;
}
}
- #
+ #
# Code to figure out how many version entries should go in
# each of the four columns
my $entries_per_col = 0;
@@ -2404,7 +2473,7 @@ ENDHEADERS
$entries_per_col = $num_entries/4 + 1;
}
my $entries_count = 0;
- $r->print(' ');
+ $r->print(' ');
my $cols_output = 1;
for (my $prevvers=$lastold;$prevvers<$currentversion;$prevvers++) {
my $url=$root.'.'.$prevvers.'.'.$extension;
@@ -2483,14 +2552,18 @@ sub changewarning {
$message='Changes will become active for your current session after [_1], or the next time you log in.';
}
$r->print("\n\n".
-''."\n".
+''."\n".
''."\n\n");
+ &mt('re-initializing '.$course_type).'" onclick="reinit(this.form)" />').
+$help{'Caching'}.''."\n\n");
}
@@ -2537,9 +2610,9 @@ sub handler {
'Option_Response_Simple');
$help{'Bulletin Board'} = &Apache::loncommon::help_open_topic(
'Docs_About_Bulletin_Board,Docs_Editing_Templated_Pages');
- $help{'My Personal Info'} = &Apache::loncommon::help_open_topic(
+ $help{'My Personal Information Page'} = &Apache::loncommon::help_open_topic(
'Docs_About_My_Personal_Info,Docs_Editing_Templated_Pages');
- $help{'Group Files'} = &Apache::loncommon::help_open_topic('Docs_About_Group_Files');
+ $help{'Group Portfolio'} = &Apache::loncommon::help_open_topic('Docs_About_Group_Files');
$help{'Caching'} = &Apache::loncommon::help_open_topic('Caching');
# does this user have privileges to modify docs
@@ -2560,7 +2633,7 @@ sub handler {
&init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' DOCS to Construction Space');
&dumpcourse($r);
} elsif ($allowed && $env{'form.exportcourse'}) {
- &init_breadcrumbs('exportcourse','Export '.&Apache::loncommon::course_type().' to IMS');
+ &init_breadcrumbs('exportcourse','IMS Export');
&exportcourse($r);
} else {
# is this a standard course?
@@ -2615,25 +2688,45 @@ sub handler {
$showdoc='/'.$1;
}
unless ($showdoc) { # got called from remote
- if (($env{'form.folder'}=~/^(?:group|default)_/) ||
+ if (($env{'form.folder'}=~/^(?:group|default)_/) ||
($env{'form.folder'} =~ m:^\d+/(pages|sequences)/:)) {
$forcestandard = 1;
- }
+ }
$forcesupplement=($env{'form.folder'}=~/^supplemental_/);
- if ($allowed) {
+ if ($allowed) {
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']);
- $script=&Apache::lonratedt::editscript('simple');
+ $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'};
-# get personal data
+# get personal data
my $uname=$env{'user.name'};
my $udom=$env{'user.domain'};
my $plainname=&escape(&Apache::loncommon::plainname($uname,$udom));
@@ -2646,20 +2739,32 @@ sub handler {
$script .= &editing_js($udom,$uname);
}
# -------------------------------------------------------------------- Body tag
- $script = '';
- my $brcrum = [{href=>"/adm/createuser",text=>"$type Documents"}];
+ $script = ''."\n";
+
+ # Breadcrumbs
+ &Apache::lonhtmlcommon::clear_breadcrumbs();
+ &Apache::lonhtmlcommon::add_breadcrumb({
+ 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'));
-
+ {'force_register' => $showdoc,})
+ .&Apache::loncommon::help_open_menu('','',273,'RAT')
+ .&Apache::lonhtmlcommon::breadcrumbs(
+ 'Editing the Table of Contents for your '.$type,
+ 'Docs_Adding_Course_Doc')
+ );
+
my %allfiles = ();
my %codebase = ();
my ($upload_result,$upload_output);
if ($allowed) {
if (($env{'form.uploaddoc.filename'}) &&
($env{'form.cmd'}=~/^upload_(\w+)/)) {
-# Process file upload - phase one - upload and parse primary file.
+# Process file upload - phase one - upload and parse primary file.
undef($hadchanges);
$upload_result = &process_file_upload(\$upload_output,$coursenum,
$coursedom,\%allfiles,
@@ -2684,8 +2789,8 @@ sub handler {
$newname{$i} = &process_secondary_uploads(\$upload_output,$coursedom,$coursenum,'embedded_item_',$i,$residx);
$origname{$i} = &unescape($env{'form.embedded_orig_'.$i});
if (exists($env{'form.embedded_codebase_'.$i})) {
- $javacodebase = &unescape($env{'form.embedded_codebase_'.$i});
- $origname{$i} =~ s#^\Q$javacodebase\E/##;
+ $javacodebase = &unescape($env{'form.embedded_codebase_'.$i});
+ $origname{$i} =~ s#^\Q$javacodebase\E/##;
}
my @attributes = ();
if ($env{'form.embedded_attrib_'.$i} =~ /:/) {
@@ -2721,8 +2826,8 @@ sub handler {
$attrib_regexp = $attribs{$item}[0];
}
if ($content =~ m#($attrib_regexp\s*=\s*['"]?)\Q$origname{$item}\E(['"]?)#) {
- }
- $content =~ s#($attrib_regexp\s*=\s*['"]?)\Q$origname{$item}\E(['"]?)#$1$newname{$item}$2#gi;
+ }
+ $content =~ s#($attrib_regexp\s*=\s*['"]?)\Q$origname{$item}\E(['"]?)#$1$newname{$item}$2#gi;
}
if (exists($codebase{$item})) {
$content =~ s/(codebase\s*=\s*["']?)\Q$codebase{$item}\E(["']?)/$1.$2/i; #' stupid emacs
@@ -2734,7 +2839,7 @@ sub handler {
my $docudom=$env{'course.'.$env{'request.course.id'}.'.domain'};
my $url = &Apache::lonnet::store_edited_file($primary_url,$content,$docudom,$docuname,\$saveresult);
} else {
- &Apache::lonnet::logthis('retrieval of uploaded file - '.$primary_url.' - for editing, failed: '.$getstatus);
+ &Apache::lonnet::logthis('retrieval of uploaded file - '.$primary_url.' - for editing, failed: '.$getstatus);
}
}
}
@@ -2746,7 +2851,6 @@ sub handler {
'uplm' => 'Upload a new main '.lc($type).' document',
'upls' => 'Upload a new supplemental '.lc($type).' document',
'impp' => 'Import a document',
- 'pubd' => 'Published Documents',
'copm' => 'All documents out of a published map into this folder',
'upld' => 'Upload Document',
'srch' => 'Search',
@@ -2760,25 +2864,25 @@ sub handler {
'extr' => 'External Resource',
'syll' => 'Syllabus',
'navc' => 'Navigate Contents',
- 'sipa' => 'Simple Page',
+ 'sipa' => 'Simple Course Page',
'sipr' => 'Simple Problem',
'drbx' => 'Drop Box',
'scuf' => 'Score Upload Form',
- 'bull' => 'Bulletin Board',
- 'mypi' => 'My Personal Info',
- 'grpo' => 'Group Files',
+ 'bull' => 'Discussion Board',
+ 'mypi' => 'My Personal Information Page',
+ 'grpo' => 'Group Portfolio',
'rost' => 'Course Roster',
- 'abou' => 'About User',
- 'imsf' => 'Import IMS package',
+ 'abou' => 'Personal Information Page for a User',
+ 'imsf' => 'IMS Import',
+ 'imsl' => 'Import IMS package',
'file' => 'File',
'title' => 'Title',
'comment' => 'Comment',
'parse' => 'Upload embedded images/multimedia files if HTML file!',
- 'nd' => 'New Document',
+ 'nd' => 'Upload Document',
'pm' => 'Published Map',
'sd' => 'Special Document',
'mo' => 'More Options',
- 'hao' => 'Hide all Options'
);
# -----------------------------------------------------------------------------
my $fileupload=(<
CHBO
+ my @fileuploada = (
+ { ' ' => " $help{'Uploading_From_Harddrive'}" },
+ );
my $fileuploadform=(<
+
$fileupload
$lt{'title'}:
@@ -2807,33 +2915,29 @@ CHBO
$checkbox
-
-
-
-
- $help{'Uploading_From_Harddrive'}
-
+FUFORM
+ $fileuploadform .= create_form_ul(create_list_elements(@fileuploada));
+ $fileuploadform .= (<
FUFORM
my $simpleeditdefaultform=(<
- $lt{'pubd'}
- $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'}
-
$help{'Load_Map'}
@@ -2844,10 +2948,7 @@ SEDFFORM
ERFORM
@@ -2872,41 +2973,72 @@ ERFORM
$containertag = ' ';
$uploadtag = ' ';
}
- ##############alter hashaufruf
- $r->print(&generate_admin_options($containertag,$uploadtag,\%lt,\%help,\%env));
- $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
- &mt('Editing the Table of Contents for your '.$type)));
+ $r->print(<
+
+
+
+
+ $containertag
+
+
+HIDDENFORM
}
-# --------------------------------------------------------- Standard documents
- $r->print('');
+# --------------------------------------------------------- Main tab structure
+
+ my $activeClass = 1;
+ my $active = '';
- if (($standard) && ($allowed) && (!$forcesupplement)) {
- $r->print('');
-# ''.&mt('Main Course Documents').
-# ($allowed?' '.$help{'Main_Course_Documents'}:'').' ');
+ $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;
+ }
+ }
+ if($env{'request.role'}=~/^cc/){
+ $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(' '
+ .''
+ .'
');
+# --------------------------------------------------------- Standard documents
+ my $savefolderpath;
+ my $active = 'style="display: none;"';
+ if($activeClass == 0){
+ $active = 'style="display: block;"';
+ }
+ if($env{'request.role'}=~/^cc/){
+ $r->print('
');
my $folder=$env{'form.folder'};
- if ($folder eq '' || $folder eq 'supplemental') {
+ if ($folder eq '' || $folder=~/^supplemental/) {
$folder='default';
+ $savefolderpath = $env{'form.folderpath'};
$env{'form.folderpath'}='default&'.&escape(&mt('Main '.$type.' Documents'));
$uploadtag = '
';
}
my $postexec='';
if ($folder eq 'default') {
- $r->print('');
+ $r->print(''."\n"
+ );
} else {
#$postexec='self.close();';
}
- $hadchanges=0;
- my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,
- $upload_output,$type);
- if ($error) {
- $r->print('
'.$error.'
');
- }
- if ($hadchanges) {
- &mark_hash_old();
- }
- &changewarning($r,$postexec);
my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.
'.sequence';
my $pageseq = '/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.
@@ -2921,266 +3053,228 @@ ERFORM
my $recoverform=(<
-
+ $lt{'reco'}
RFORM
my $imspform=(<
-
+ $lt{'imsf'}
IMSPFORM
my $newnavform=(<
+
$uploadtag
-
-
+ $lt{'navc'}
$help{'Navigate_Content'}
-
NNFORM
my $newsmppageform=(<
+
$uploadtag
-
- $help{'Simple Page'}
-
+ $lt{'sipa'}
+ $help{'Simple Page'}
NSPFORM
my $newsmpproblemform=(<
+
$uploadtag
-
- $help{'Simple Problem'}
-
+ $lt{'sipr'}
+ $help{'Simple Problem'}
NSPROBFORM
my $newdropboxform=(<
- $uploadtag
+
+ $uploadtag
-
-
-
-
+ $lt{'drbx'}
+
NDBFORM
my $newexuploadform=(<
+
$uploadtag
-
-
+ $lt{'scuf'}
$help{'Score_Upload_Form'}
-
NEXUFORM
my $newbulform=(<
+
$uploadtag
-
-
+ $lt{'bull'}
$help{'Bulletin Board'}
-
NBFORM
my $newaboutmeform=(<
+
$uploadtag
-
-
- $help{'My Personal Info'}
-
+ $lt{'mypi'}
+ $help{'My Personal Information Page'}
NAMFORM
my $newaboutsomeoneform=(<
+
$uploadtag
-
-
-
+ $lt{'abou'}
NASOFORM
my $newrosterform=(<
+
$uploadtag
-
-
+ $lt{'rost'}
$help{'Course Roster'}
-
NROSTFORM
- $r->print(<
-
-
-
-$fileuploadform
-
-
-$simpleeditdefaultform
-
-$recoverform
-ENDFORM
- unless ($env{'form.pagepath'}) {
- $r->print(<
-$extresourcesform
-
-$imspform
-ENDFORM
- }
- $r->print(' ');
unless ($env{'form.pagepath'}) {
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
-
-
-
+
my $newpageform=(<
-
- $help{'Adding_Pages'}
-
+
+ $lt{'newp'}
+ $help{'Adding_Pages'}
NPFORM
-
- my $newfolderform=(<
-
- $help{'Adding_Folders'}
-
+
+ $lt{'newf'} $help{'Adding_Folders'}
NFFORM
+ my @newfolderforma= (
+ { ' ' => "$newfolderform" }
+ );
+
+
+ $newfolderform = create_form_ul(create_list_elements(@newfolderforma));
my $newsylform=(<
+
$uploadtag
-
-
+ $lt{'syll'}
$help{'Syllabus'}
-
+
NSYLFORM
-
+
my $newgroupfileform=(<
+
$uploadtag
-
-
- $help{'Group Files'}
-
+ $lt{'grpo'}
+ $help{'Group Portfolio'}
NGFFORM
+ @specialdocumentsforma=(
+ {' '=>$newpageform},
+ {' '=>$newsylform},
+ {' '=>$newgroupfileform},
+ );
+
+ }
+ push @specialdocumentsforma, ({' '=>$newnavform},
+ {' '=>$newsmppageform},
+ {' '=>$newsmpproblemform},
+ {' '=>$newdropboxform},
+ {' '=>$newexuploadform},
+ {' '=>$newbulform},
+ {' '=>$newaboutmeform},
+ {' '=>$newaboutsomeoneform},
+ {' '=>$newrosterform},);
+ $specialdocumentsform = create_form_ul(create_list_elements(@specialdocumentsforma));
- my $specialdocumentsform=(<
-$newfolderform
-
-$newpageform
-
-$newsylform
-
-$newnavform
-
-$newsmppageform
-
-$newsmpproblemform
-
-$newdropboxform
-
-$newexuploadform
-
-$newbulform
-
-$newaboutmeform
-
-$newaboutsomeoneform
-
-$newgroupfileform
-
-$newrosterform
-ENDFORM
+if($env{'form.pagepath'}) {
+
+ @specialdocumentsforma=(
+ {' '=>$newsmpproblemform},
+ {' '=>$newexuploadform}
+ );
+ $specialdocumentsform= create_form_ul(create_list_elements(@specialdocumentsforma));
+}
+
+my @tools = (
+ {' '=>$extresourcesform},
+ {' '=>$imspform},
+ {' '=>$recoverform},
+ );
-$r->print($specialdocumentsform);
my %orderhash = (
- 'aa_eins' => 'New Document',
- 'bb_zwei' => 'Published Documents',
- 'cc_drei' => 'Special Documents',
- 'dd_vier' => 'More Options',
- 'zz_hide' => 'Hide all Option',
- );
-my %namehash = (
- 'New Document' => $fileuploadform,
- 'Published Documents' => $simpleeditdefaultform,
- 'Special Documents' => $specialdocumentsform,
- 'More Options' => $extresourcesform.' '.$imspform.' '.$recoverform,
- 'drei' => 'dr',
+ 'aa' => ['Upload Document',$fileuploadform.''.$newfolderform],
+ 'bb' => ['Published Resources',$simpleeditdefaultform],
+ 'cc' => ['Special Documents',$specialdocumentsform],
+ 'dd' => ['Tools', create_form_ul(create_list_elements(@tools)).&generate_admin_options($containertag,$uploadtag,\%help,\%env)],
+ 'zz' => ['Hide'],
);
-$r->print(&generate_edit_table(\%namehash,\%orderhash));
- }
+my $tid='1';
+my $varcd = 'Main Course Documents';
+ $hadchanges=0;
+ my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
+ if ($error) {
+ $r->print(''.$error.'
');
+ }
+ if ($hadchanges) {
+ &mark_hash_old();
+ }
+
+ &changewarning($r,'');
+$r->print(&generate_edit_table($tid,$varcd,\%orderhash));
+
+$r->print('');
+ }
if ($env{'form.pagepath'}) {
- $r->print(<
-$newexuploadform
-ENDBLOCK
}
- $r->print(' '."\n".
-'
');
-#$r->print(&generate_edit_table(\%namehash,\%orderhash));
- $r->print(' ');
- }
# ----------------------------------------------------- Supplemental documents
- if (!$forcestandard) {
- $r->print('');
-# ''.&mt('Supplemental Course Documents').
-# ($allowed?' '.$help{'Supplemental'}:'').' ');
+ my $active = 'style="display: none;"';
+ if($activeClass == 1){
+ $active = 'style="display: block;"';
+ }
+ $r->print('');
my $folder=$env{'form.folder'};
unless ($folder=~/^supplemental/) {
$folder='supplemental';
@@ -3189,11 +3283,10 @@ ENDBLOCK
(($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) {
$env{'form.folderpath'} = 'supplemental&'.
&escape(&mt('Supplemental '.$type.' Documents'));
+ }else{
+ $env{'form.folderpath'} = $savefolderpath;
}
- my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
- if ($error) {
- $r->print('
'.$error.'
');
- }
+ $env{'form.pagepath'} = '';
if ($allowed) {
my $folderseq=
'/uploaded/'.$coursedom.'/'.$coursenum.'/supplemental_'.time.
@@ -3201,8 +3294,12 @@ ENDBLOCK
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
+ my @supupdocform = (
+ {'
'=>"
$help{'Uploading_From_Harddrive'}"},
+ );
my $supupdocform=(<
+
SUPDOCFORM
+ $supupdocform .= create_form_ul(create_list_elements(@supupdocform))."";
my $supnewfolderform=(<
+
-
- $help{'Adding_Folders'}
-
+ $lt{'newf'}
+ $help{'Adding_Folders'}
SNFFORM
+
+ my @supnewfolderforma = ({' '=>$supnewfolderform});
+ $supnewfolderform = create_form_ul(create_list_elements(@supnewfolderforma));
my $supnewextform=(<
+
-
- $help{'Adding_External_Resource'}
-
+ $lt{'extr'} $help{'Adding_External_Resource'}
SNEFORM
my $supnewsylform=(<
+
-
-
+ $lt{'syll'}
$help{'Syllabus'}
-
SNSFORM
my $supnewaboutmeform=(<
+
+
-
-
- $help{'My Personal Info'}
-
+ $lt{'mypi'}
+ $help{'My Personal Information Page'}
SNAMFORM
- $r->print(<
-$lt{'nd'}
-$lt{'sd'}
-$lt{'hao'}
-
-
-
-$supupdocform
-
-
-$supnewfolderform
-
-$supnewextform
-
-$supnewsylform
-
-$supnewaboutmeform
-
-
-ENDSUPFORM
- }
- }
- $r->print('');
+
+my @specialdocs = (
+ {' '=>$supnewextform},
+ {' '=>$supnewsylform},
+ {' '=>$supnewaboutmeform},
+ );
+my %suporderhash = (
+ 'ee' => ['Upload Document',$supupdocform.' '.$supnewfolderform],
+ 'ff' => ['Special Documents',create_form_ul(create_list_elements(@specialdocs))],
+ 'zz' => ['Hide'],
+ );
+
+my $tid='2';
+my $varscd = 'Supplemental Course Documents';
+my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
+ if ($error) {
+ $r->print(''.$error.'
');
+ }
+$r->print(&generate_edit_table($tid,$varscd,\%suporderhash));
+}
+
+
+$r->print('');
+$r->print('');
+
+
if ($allowed) {
$r->print('