'.
+ $r->print(''.
&mt('[quant,_1,error]',$errorcount).' ');
}
if ($warningcount) {
@@ -2118,7 +2215,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').' ');
@@ -2140,7 +2237,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();
@@ -2149,7 +2246,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()) {
@@ -2163,11 +2260,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=();
@@ -2176,7 +2273,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. '));
}
@@ -2199,9 +2296,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='';
@@ -2252,7 +2349,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').' ');
@@ -2262,7 +2359,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\/.+)$/) {
@@ -2307,7 +2404,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',
@@ -2316,9 +2413,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');
@@ -2365,7 +2462,7 @@ ENDHEADERS
'Most Recent: '.
''.$currentversion.' '.
' '.
- 'In '.$type.': '.
+ ' In '.$crstype.': '.
'');
# Used in course
my $usedversion=$hash{'version_'.$linkurl};
@@ -2382,7 +2479,7 @@ ENDHEADERS
('select_form_order' =>
['',1..$currentversion,'mostrecent'],
'' => '',
- 'mostrecent' => 'most recent',
+ 'mostrecent' => &mt('most recent'),
map {$_,$_} (1..$currentversion))));
$r->print(' ');
my $lastold=1;
@@ -2393,7 +2490,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 +2501,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 +2580,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");
}
@@ -2498,7 +2599,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'});
@@ -2516,8 +2617,16 @@ 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();
+ my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'};
+ if ($coursedom eq 'gcitest') {
+ my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
+ if ($allowed) {
+ &concept_test_builder($r);
+ return OK;
+ }
+ }
# --------------------------------------------- Initialize help topics for this
foreach my $topic ('Adding_Course_Doc','Main_Course_Documents',
@@ -2537,9 +2646,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 +2669,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?
@@ -2582,7 +2691,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'});
}
@@ -2591,7 +2705,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',
@@ -2614,26 +2728,46 @@ sub handler {
if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) {
$showdoc='/'.$1;
}
- unless ($showdoc) { # got called from remote
- if (($env{'form.folder'}=~/^(?:group|default)_/) ||
+ 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;
- }
+ }
$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 +2780,46 @@ sub handler {
$script .= &editing_js($udom,$uname);
}
# -------------------------------------------------------------------- Body tag
- $script = '';
- 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'));
-
+ $script = ''."\n";
+
+ # 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 = ();
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 +2844,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 +2881,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 +2894,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);
}
}
}
@@ -2743,10 +2903,9 @@ 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',
- 'pubd' => 'Published Documents',
'copm' => 'All documents out of a published map into this folder',
'upld' => 'Upload Document',
'srch' => 'Search',
@@ -2760,25 +2919,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',
+ 'parse' => 'Upload embedded images/multimedia files if HTML file',
+ '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 +2968,31 @@ 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=(<
- $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 +3003,7 @@ SEDFFORM
ERFORM
@@ -2865,43 +3021,90 @@ 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'}) {
$containertag = ' ';
$uploadtag = ' ';
}
-
- $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
}
+# --------------------------------------------------------- Main tab structure
+
+ my $activeClass = 1;
+ my $active = '';
+ 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
- if (($standard) && ($allowed) && (!$forcesupplement)) {
+ my $savefolderpath;
+ $active = 'style="display: none;"';
+ if($activeClass == 0){
+ $active = 'style="display: block;"';
+ }
+ if ($allowed) {
+ $r->print('
');
my $folder=$env{'form.folder'};
- if ($folder eq '' || $folder eq 'supplemental') {
+ if ($folder eq '' || $folder=~/^supplemental/) {
$folder='default';
- $env{'form.folderpath'}='default&'.&escape(&mt('Main '.$type.' Documents'));
+ $savefolderpath = $env{'form.folderpath'};
+ $env{'form.folderpath'}='default&'.&escape($tabtitles{'main'}{$crstype});
$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.
@@ -2916,215 +3119,223 @@ 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
+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
- my $newfolderform=(<
-
- $help{'Adding_Folders'}
-
+
+ $lt{'newf'} $help{'Adding_Folders'}
NFFORM
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
-SPDOFORM
+if($env{'form.pagepath'}) {
+
+ @specialdocumentsforma=(
+ {' '=>$newsmpproblemform},
+ {' '=>$newexuploadform}
+ );
+ $specialdocumentsform= create_form_ul(create_list_elements(@specialdocumentsforma));
+}
+my @tools = (
+ {' '=>$extresourcesform},
+ {' '=>$imspform},
+ {' '=>$recoverform},
+ );
my %orderhash = (
- 'aa' => 'New Document',
- 'bb' => 'Published Documents',
- 'cc' => 'Special Documents',
- 'dd' => 'More Options',
- 'zz' => 'Hide all Options',
- );
-my %namehash = (
- 'New Document' => $fileuploadform,
- 'Published Documents' => $simpleeditdefaultform,
- 'Special Documents' => $specialdocumentsform,
- 'More Options' => $extresourcesform.' '.$imspform.' '.$recoverform,
+ '00' => ['Newfolder',$newfolderform],
+ 'aa' => ['Upload Document',$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)],
);
my $tid='1';
-my $content='content';
-my $navigation='navigation';
-my $varcd = 'Main Course Documents';
-$r->print(&generate_edit_table($tid,$content,$navigation,$varcd,\%namehash,\%orderhash));
- }
+ $hadchanges=0;
+ my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype);
+ if ($error) {
+ $r->print(''.$error.'
');
+ }
+ if ($hadchanges) {
+ &mark_hash_old();
+ }
+
+ &changewarning($r,'');
+$r->print(&generate_edit_table($tid,\%orderhash));
+
+$r->print(' ');
+ }
if ($env{'form.pagepath'}) {
}
- }
# ----------------------------------------------------- Supplemental documents
- if (!$forcestandard) {
+ $active = 'style="display: none;"';
+ if($activeClass == 1){
+ $active = 'style="display: block;"';
+ }
+ $r->print('
');
my $folder=$env{'form.folder'};
unless ($folder=~/^supplemental/) {
$folder='supplemental';
@@ -3132,12 +3343,11 @@ $r->print(&generate_edit_table($tid,$con
if ($folder =~ /^supplemental$/ &&
(($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) {
$env{'form.folderpath'} = 'supplemental&'.
- &escape(&mt('Supplemental '.$type.' Documents'));
- }
- my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
- if ($error) {
- $r->print('
'.$error.'
');
+ &escape(&mt('Supplemental '.$crstype.' Documents'));
+ } elsif ($allowed) {
+ $env{'form.folderpath'} = $savefolderpath;
}
+ $env{'form.pagepath'} = '';
if ($allowed) {
my $folderseq=
'/uploaded/'.$coursedom.'/'.$coursenum.'/supplemental_'.time.
@@ -3145,8 +3355,10 @@ $r->print(&generate_edit_table($tid,$con
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
+ my $supupdocformbtn = "
$help{'Uploading_From_Harddrive'}";
my $supupdocform=(<
+
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
my $supnewsylform=(<
+
-
-
+ $lt{'syll'}
$help{'Syllabus'}
-
SNSFORM
my $supnewaboutmeform=(<
+
+
-
-
- $help{'My Personal Info'}
-
+ $lt{'mypi'}
+ $help{'My Personal Information Page'}
SNAMFORM
-
+my @specialdocs = (
+ {' '=>$supnewextform},
+ {' '=>$supnewsylform},
+ {' '=>$supnewaboutmeform},
+ );
my %suporderhash = (
- 'ee' => 'New Document',
- 'ff' => 'Special Documents',
- 'zz' => 'Hide all Options',
+ '00' => ['Supnewfolder', $supnewfolderform],
+ 'ee' => ['Upload Document',$supupdocform],
+ 'ff' => ['Special Documents',create_form_ul(create_list_elements(@specialdocs))]
);
-my %supnamehash = (
- 'New Document' => $supupdocform,
- 'Special Documents' => $supnewfolderform.' '.$supnewextform.' '.$supnewsylform.' '.$supnewaboutmeform,
- );
+ 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.'
');
+ }
+ }
-my $tid='2';
-my $content='content';
-my $navigation='navigation';
-my $varscd = 'Supplemental Course Documents';
-$r->print(&generate_edit_table($tid,$content,$navigation,$varscd,\%supnamehash,\%suporderhash));
+$r->print(' ');
+$r->print('
');
+
- }
- }
if ($allowed) {
$r->print('
@@ -3259,82 +3467,94 @@ $r->print(&generate_edit_table($tid,$con
}
$r->print(&Apache::loncommon::end_page());
return OK;
-}
+}
sub generate_admin_options {
- my ($containertag,$uploadtag,$lt_ref,$help_ref,$env_ref) = @_;
- my %lt = %{$lt_ref};
+ my ($containertag,$uploadtag,$help_ref,$env_ref) = @_;
+ my %lt=&Apache::lonlocal::texthash(
+ 'vc' => 'Verify Content',
+ 'cv' => 'Check/Set Resource Versions',
+ 'ls' => 'List Symbs',
+ 'sl' => 'Show Log'
+ );
my %help = %{$help_ref};
my %env = %{$env_ref};
my $dumpbut=&dumpbutton();
my $exportbut=&exportbutton();
- return (<
-
-
-
-
- $containertag
-
-
-
- $uploadtag
-
-
-
-
-
-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 ' '.create_form_ul(create_list_elements(@list)).' ';
}
sub generate_edit_table {
- my ($tid,$content,$navigation,$varcd,$namehash_ref,$orderhash_ref) = @_;
- my %namehash = %{$namehash_ref}; #name verlinkt mit id
- my %orderhash = %{$orderhash_ref}; #name mit kürzel verlinkt mit name
+ my ($tid,$orderhash_ref) = @_;
+ return unless(ref($orderhash_ref) eq 'HASH');
+ my %orderhash = %{$orderhash_ref};
my $form;
-
-
-
- $form = ''.&mt($varcd).' ';
- $form .= '
';
+ my $activetab;
+ my $active;
+ if($env{'form.active'} ne ''){
+ $activetab = $env{'form.active'};
+ }
+ $form = '';
+ $form .= '
';
foreach my $name (sort(keys(%orderhash))){
- if($name eq 'zz'){
- $form .= ''.&mt($orderhash{$name}).' ';
- }else{
- $form .= ''.&mt($orderhash{$name}).' ';
+ 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 .= '
';
+ foreach my $field (keys(%orderhash)){
+ if($field ne '00'){
+ if($activetab eq '' || $activetab ne $field){
+ $active = 'style="display: none;"';
+ }elsif($activetab eq $field){
+ $active = 'style="display:block;"';
+ }
+ $form .= '
'.${$orderhash{$field}}[1]
+ .'
';
}
}
- $form .= '
';
- foreach my $field (keys(%namehash)){
- $form .= '
'.$namehash{$field}.'
';
- }
$form .= '
';
-
+
return $form;
}
+sub concept_test_builder {
+ my ($r) = @_;
+ $r->print(&Apache::loncommon::start_page('Assemble Test'));
+ &Apache::londocsgci::setdefaults();
+ if ($env{'form.phase'} eq 'storemap') {
+ &Apache::londocsgci::evaluate();
+ &Apache::londocsgci::store($r);
+ }
+ &Apache::londocsgci::load();
+ &Apache::londocsgci::listresources($r);
+ $r->print(&Apache::loncommon::end_page());
+ return;
+}
+
sub editing_js {
my ($udom,$uname) = @_;
my $now = time();
@@ -3344,12 +3564,12 @@ sub editing_js {
p_mnp => 'Name of New Page',
t_mnp => 'New Page',
p_mxu => 'Title for the Uploaded Score',
- p_msp => 'Title for the Page',
+ p_msp => 'Name of Simple Course Page',
p_msb => 'Title for the Problem',
p_mdb => 'Title for the Drop Box',
- p_mbb => 'Title for the Bulletin Board',
- p_mab => "Enter user:domain for User's 'About Me' Page",
- p_mab2 => "About [_99]",
+ p_mbb => 'Title for the Discussion Board',
+ p_mab => "Enter user:domain for User's Personal Information Page",
+ p_mab2 => 'Personal Information Page of ',
p_mab_alrt1 => 'Not a valid user:domain',
p_mab_alrt2 => 'Please enter both user and domain in the format user:domain',
p_chn => 'New Title',
@@ -3397,7 +3617,7 @@ function edittext(targetname,residx,titl
function makeexamupload() {
var title=prompt('$lt{"p_mxu"}');
- if (title) {
+ if (title) {
this.document.forms.newexamupload.importdetail.value=
escape(title)+'=/res/lib/templates/examupload.problem';
this.document.forms.newexamupload.submit();
@@ -3406,7 +3626,7 @@ function makeexamupload() {
function makesmppage() {
var title=prompt('$lt{"p_msp"}');
- if (title) {
+ if (title) {
this.document.forms.newsmppg.importdetail.value=
escape(title)+'=/adm/$udom/$uname/$now/smppg';
this.document.forms.newsmppg.submit();
@@ -3415,7 +3635,7 @@ function makesmppage() {
function makesmpproblem() {
var title=prompt('$lt{"p_msb"}');
- if (title) {
+ if (title) {
this.document.forms.newsmpproblem.importdetail.value=
escape(title)+'=/res/lib/templates/simpleproblem.problem';
this.document.forms.newsmpproblem.submit();
@@ -3424,7 +3644,7 @@ function makesmpproblem() {
function makedropbox() {
var title=prompt('$lt{"p_mdb"}');
- if (title) {
+ if (title) {
this.document.forms.newdropbox.importdetail.value=
escape(title)+'=/res/lib/templates/DropBox.problem';
this.document.forms.newdropbox.submit();
@@ -3449,113 +3669,140 @@ function makeabout() {
if ((comp[0]) && (comp[1])) {
this.document.forms.newaboutsomeone.importdetail.value=
'$lt{"p_mab2"}'+escape(user)+'=/adm/'+comp[1]+'/'+comp[0]+'/aboutme';
- this.document.forms.newaboutsomeone.submit();
- } else {
- alert("$lt{'p_mab_alrt1'}");
- }
- } else {
- alert("$lt{'p_mab_alrt2'}");
- }
+ this.document.forms.newaboutsomeone.submit();
+ } else {
+ alert("$lt{'p_mab_alrt1'}");
}
+} else {
+ alert("$lt{'p_mab_alrt2'}");
+}
+}
}
function makeims() {
- var caller = document.forms.ims.folder.value;
- var newlocation = "/adm/imsimportdocs?folder="+caller+"&phase=one";
- newWindow = window.open("","IMSimport","HEIGHT=700,WIDTH=750,scrollbars=yes");
- newWindow.location.href = newlocation;
+var caller = document.forms.ims.folder.value;
+var newlocation = "/adm/imsimportdocs?folder="+caller+"&phase=one";
+newWindow = window.open("","IMSimport","HEIGHT=700,WIDTH=750,scrollbars=yes");
+newWindow.location.href = newlocation;
}
function finishpick() {
- var title=this.document.forms.extimport.title.value;
- var url=this.document.forms.extimport.url.value;
- var form=this.document.forms.extimport.useform.value;
- var residx=this.document.forms.extimport.residx.value;
- eval('this.document.forms.'+form+'.importdetail.value="'+title+'='+url+'='+residx+'";this.document.forms.'+form+'.submit();');
+var title=this.document.forms.extimport.title.value;
+var url=this.document.forms.extimport.url.value;
+var form=this.document.forms.extimport.useform.value;
+var residx=this.document.forms.extimport.residx.value;
+eval('this.document.forms.'+form+'.importdetail.value="'+title+'='+url+'='+residx+'";this.document.forms.'+form+'.submit();');
}
function changename(folderpath,index,oldtitle,container,pagesymb) {
- var title=prompt('$lt{"p_chn"}',oldtitle);
- if (title) {
- this.document.forms.renameform.markcopy.value=-1;
- this.document.forms.renameform.title.value=title;
- this.document.forms.renameform.cmd.value='rename_'+index;
- if (container == 'sequence') {
- this.document.forms.renameform.folderpath.value=folderpath;
- }
- if (container == 'page') {
- this.document.forms.renameform.pagepath.value=folderpath;
- this.document.forms.renameform.pagesymb.value=pagesymb;
- }
- this.document.forms.renameform.submit();
- }
+var title=prompt('$lt{"p_chn"}',oldtitle);
+if (title) {
+this.document.forms.renameform.markcopy.value=-1;
+this.document.forms.renameform.title.value=title;
+this.document.forms.renameform.cmd.value='rename_'+index;
+if (container == 'sequence') {
+ this.document.forms.renameform.folderpath.value=folderpath;
+}
+if (container == 'page') {
+ this.document.forms.renameform.pagepath.value=folderpath;
+ this.document.forms.renameform.pagesymb.value=pagesymb;
+}
+this.document.forms.renameform.submit();
+}
}
function removeres(folderpath,index,oldtitle,container,pagesymb,skip_confirm) {
- if (skip_confirm || confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr2a"} "'+oldtitle+'" $lt{"p_rmr2b"}')) {
- this.document.forms.renameform.markcopy.value=-1;
- this.document.forms.renameform.cmd.value='del_'+index;
- if (container == 'sequence') {
- this.document.forms.renameform.folderpath.value=folderpath;
- }
- if (container == 'page') {
- this.document.forms.renameform.pagepath.value=folderpath;
- this.document.forms.renameform.pagesymb.value=pagesymb;
- }
- this.document.forms.renameform.submit();
- }
+if (skip_confirm || confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr2a"} "'+oldtitle+'" $lt{"p_rmr2b"}')) {
+this.document.forms.renameform.markcopy.value=-1;
+this.document.forms.renameform.cmd.value='del_'+index;
+if (container == 'sequence') {
+ this.document.forms.renameform.folderpath.value=folderpath;
+}
+if (container == 'page') {
+ this.document.forms.renameform.pagepath.value=folderpath;
+ this.document.forms.renameform.pagesymb.value=pagesymb;
+}
+this.document.forms.renameform.submit();
+}
}
function cutres(folderpath,index,oldtitle,container,pagesymb,folder,skip_confirm) {
- if (skip_confirm || confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr2a"} "'+oldtitle+'" $lt{"p_ctr2b"}')) {
- this.document.forms.renameform.cmd.value='cut_'+index;
- this.document.forms.renameform.markcopy.value=index;
- this.document.forms.renameform.copyfolder.value=folder+'.'+container;
- if (container == 'sequence') {
- this.document.forms.renameform.folderpath.value=folderpath;
- }
- if (container == 'page') {
- this.document.forms.renameform.pagepath.value=folderpath;
- this.document.forms.renameform.pagesymb.value=pagesymb;
- }
- this.document.forms.renameform.submit();
- }
+if (skip_confirm || confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr2a"} "'+oldtitle+'" $lt{"p_ctr2b"}')) {
+this.document.forms.renameform.cmd.value='cut_'+index;
+this.document.forms.renameform.markcopy.value=index;
+this.document.forms.renameform.copyfolder.value=folder+'.'+container;
+if (container == 'sequence') {
+ this.document.forms.renameform.folderpath.value=folderpath;
+}
+if (container == 'page') {
+ this.document.forms.renameform.pagepath.value=folderpath;
+ this.document.forms.renameform.pagesymb.value=pagesymb;
+}
+this.document.forms.renameform.submit();
+}
}
function markcopy(folderpath,index,oldtitle,container,pagesymb,folder) {
- this.document.forms.renameform.markcopy.value=index;
- this.document.forms.renameform.copyfolder.value=folder+'.'+container;
- if (container == 'sequence') {
- this.document.forms.renameform.folderpath.value=folderpath;
- }
- if (container == 'page') {
- this.document.forms.renameform.pagepath.value=folderpath;
- this.document.forms.renameform.pagesymb.value=pagesymb;
- }
- this.document.forms.renameform.submit();
+this.document.forms.renameform.markcopy.value=index;
+this.document.forms.renameform.copyfolder.value=folder+'.'+container;
+if (container == 'sequence') {
+this.document.forms.renameform.folderpath.value=folderpath;
+}
+if (container == 'page') {
+this.document.forms.renameform.pagepath.value=folderpath;
+this.document.forms.renameform.pagesymb.value=pagesymb;
+}
+this.document.forms.renameform.submit();
}
function unselectInactive(nav) {
- currentNav = document.getElementById(nav);
- currentLis = currentNav.getElementsByTagName('LI');
- for (i = 0; i < currentLis.length; i++) {
+currentNav = document.getElementById(nav);
+currentLis = currentNav.getElementsByTagName('LI');
+for (i = 0; i < currentLis.length; i++) {
+ if(currentLis[i].className == 'right active' || currentLis[i].className == 'right'){
+ currentLis[i].className = 'right';
+ }else{
currentLis[i].className = 'i';
}
}
+}
function hideAll(current, nav, data) {
- unselectInactive(nav);
+unselectInactive(nav);
+if(current.className == 'right'){
+ current.className = 'right active'
+ }else{
current.className = 'active';
- currentData = document.getElementById(data);
- currentDivs = currentData.getElementsByTagName('DIV');
- for (i = 0; i < currentDivs.length; i++) {
+}
+currentData = document.getElementById(data);
+currentDivs = currentData.getElementsByTagName('DIV');
+for (i = 0; i < currentDivs.length; i++) {
+ if(currentDivs[i].className == 'LC_ContentBox'){
currentDivs[i].style.display = 'none';
}
}
+}
+
+function openTabs(pageId) {
+ tabnav = document.getElementById(pageId).getElementsByTagName('UL');
+ 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') {
+ funcString = currentLis[i].onclick.toString();
+ tab = funcString.split('"');
+ currentData = document.getElementById(tab[1]);
+ currentData.style.display = 'block';
+ }
+ }
+ }
+}
function showPage(current, pageId, nav, data) {
hideAll(current, nav, data);
+ openTabs(pageId);
unselectInactive(nav);
current.className = 'active';
currentData = document.getElementById(pageId);
@@ -3563,6 +3810,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;
@@ -3588,7 +3842,7 @@ Available help topics
=item mapread()
-Mapread read maps into LONCAPA::map:: global arrays
+Mapread read maps into LONCAPA::map:: global arrays
@order and @resources, determines status
sets @order - pointer to resources in right order
sets @resources - array with the resources with correct idx