$form_start
@@ -2252,7 +2253,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').'
');
@@ -2404,7 +2405,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,7 +2484,7 @@ 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".
'
+
+HIDDENFORM
}
# --------------------------------------------------------- Main tab structure
my $activeClass = 1;
- $r->print('');
- if (($standard) && ($allowed) && (!$forcesupplement)) {
- my $active = '';
+ my $active = '';
+ $r->print('');
+ if (($standard) && ($allowed) && (!$forcesupplement) && (($env{'form.folderpath'}=~/^default/) || ($env{'form.pagepath'}))) {
if($activeClass == 1){
$active = 'class="active"';
$activeClass = 0;
}
- $r->print('- '.&mt('Main Course Documents').'
');
}
- if (!$forcestandard) {
- my $active = '';
+ $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(' ');
+ $r->print(' - '.&mt('Supplemental Course Documents').'
');
+ $r->print(' ');
# --------------------------------------------------------- Standard documents
- if (($standard) && ($allowed) && (!$forcesupplement)) {
+ my $savefolderpath;
my $active = 'style="display: none;"';
if($activeClass == 0){
$active = 'style="display: block;"';
}
- $r->print(' ');
+ $r->print(' ');
$r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
&mt('Editing the Table of Contents for your '.$type)));
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 = ' ';
@@ -2916,11 +2929,6 @@ ERFORM
} else {
#$postexec='self.close();';
}
- $hadchanges=0;
- if ($hadchanges) {
- &mark_hash_old();
- }
- &changewarning($r,$postexec);
my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.
'.sequence';
my $pageseq = '/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.
@@ -2982,13 +2990,13 @@ NSPROBFORM
my $newdropboxform=(<
- $uploadtag
+ $uploadtag
-
+
-
-
+
+
NDBFORM
my $newexuploadform=(<
- $help{'My Personal Info'}
+ $help{'My Personal Information Page'}
NAMFORM
@@ -3051,6 +3059,9 @@ NASOFORM
NROSTFORM
+my $specialdocumentsform;
+my $newfolderform;
+
unless ($env{'form.pagepath'}) {
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
@@ -3066,7 +3077,7 @@ NROSTFORM
NPFORM
- my $newfolderform=(<
@@ -3097,58 +3108,46 @@ NSYLFORM
value="$lt{'grpo'}=/adm/$coursedom/$coursenum/aboutme" />
- $help{'Group Files'}
+ $help{'Group Portfolio'}
NGFFORM
-
- my $specialdocumentsform=(<$newfolderform
- $newpageform
- $newsylform
- $newnavform
- $newsmppageform
- $newsmpproblemform
- $newdropboxform
- $newexuploadform
- $newbulform
- $newaboutmeform
- $newaboutsomeoneform
- $newgroupfileform
- $newrosterform
-SPDOFORM
-
+ $specialdocumentsform=" $newpageform $newsylform $newgroupfileform";
+ }
+ $specialdocumentsform.=" $newnavform $newsmppageform
+ $newsmpproblemform $newdropboxform
+ $newexuploadform $newbulform
+ $newaboutmeform $newaboutsomeoneform
+ $newrosterform";
+if($env{'form.pagepath'}) {
+ $specialdocumentsform=" $newsmpproblemform $newexuploadform";
+}
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,
+ 'aa' => ['New Document',$fileuploadform.' '.$newfolderform],
+ 'bb' => ['Published Documents',$simpleeditdefaultform],
+ 'cc' => ['Special Documents',$specialdocumentsform],
+ 'dd' => ['Tools',$extresourcesform.' '.$imspform.' '.$recoverform.' '.&generate_admin_options($containertag,$uploadtag,\%help,\%env)],
+ 'zz' => ['Hide all Options'],
);
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));
-my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
+$r->print(&generate_edit_table($tid,$varcd,\%orderhash));
+ $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('');
- }
if ($env{'form.pagepath'}) {
}
- }
# ----------------------------------------------------- Supplemental documents
- if (!$forcestandard) {
my $active = 'style="display: none;"';
if($activeClass == 1){
$active = 'style="display: block;"';
@@ -3162,7 +3161,10 @@ $r->print(' ');
(($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) {
$env{'form.folderpath'} = 'supplemental&'.
&escape(&mt('Supplemental '.$type.' Documents'));
+ }else{
+ $env{'form.folderpath'} = $savefolderpath;
}
+ $env{'form.pagepath'} = '';
if ($allowed) {
my $folderseq=
'/uploaded/'.$coursedom.'/'.$coursenum.'/supplemental_'.time.
@@ -3180,7 +3182,7 @@ $r->print(' ');
$lt{'comment'}:
- print(' ');
}
- }
$r->print(' ');
if ($allowed) {
$r->print('
@@ -3292,74 +3286,53 @@ $r->print('');
}
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
-
-
-
ENDOPTIONFORM
}
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,$varcd,$orderhash_ref) = @_;
+ my %orderhash = %{$orderhash_ref};
my $form;
-
-
$form = ''.&mt($varcd).'';
- $form .= ' ';
+ $form .= '';
foreach my $name (sort(keys(%orderhash))){
if($name eq 'zz'){
- $form .= '- '.&mt($orderhash{$name}).'
';
+ $form .= '- '.&mt(${$orderhash{$name}}[0]).'
';
}else{
- $form .= '- '.&mt($orderhash{$name}).'
';
+ $form .= '- '.&mt(${$orderhash{$name}}[0]).'
';
+ }
+ }
+ $form .= ' ';
+ $form .= '';
+ foreach my $field (keys(%orderhash)){
+ if($field ne 'zz'){
+ $form .= ' '.${$orderhash{$field}}[1].' ';
}
}
- $form .= ' ';
- foreach my $field (keys(%namehash)){
- $form .= ' '.$namehash{$field}.' ';
- }
$form .= ' ';
return $form;
@@ -3374,12 +3347,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',
@@ -3427,7 +3400,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();
@@ -3436,7 +3409,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();
@@ -3445,7 +3418,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();
@@ -3454,7 +3427,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();
@@ -3620,7 +3593,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
|