');
+ $r->print('
');
# --------------------------------------------------------- Standard documents
my $savefolderpath;
my $active = 'style="display: none;"';
@@ -2925,7 +2951,12 @@ HIDDENFORM
}
my $postexec='';
if ($folder eq 'default') {
- $r->print('');
+ $r->print(''
+ );
} else {
#$postexec='self.close();';
}
@@ -2943,14 +2974,14 @@ HIDDENFORM
my $recoverform=(<
-
+
RFORM
my $imspform=(<
-
+
IMSPFORM
@@ -2971,7 +3002,7 @@ NNFORM
$help{'Simple Page'}
+ onclick="javascript:makesmppage();" /> $help{'Simple Page'}
NSPFORM
@@ -2982,7 +3013,7 @@ NSPFORM
$help{'Simple Problem'}
+ onclick="javascript:makesmpproblem();" />$help{'Simple Problem'}
@@ -2994,7 +3025,7 @@ NSPROBFORM
+ onclick="javascript:makedropbox();" />
NDBFORM
@@ -3005,7 +3036,7 @@ NDBFORM
+ onclick="javascript:makeexamupload();" />
$help{'Score_Upload_Form'}
@@ -3017,7 +3048,7 @@ NEXUFORM
+ onclick="javascript:makebulboard();" />
$help{'Bulletin Board'}
@@ -3041,7 +3072,7 @@ NAMFORM
+ onclick="javascript:makeabout();" />
NASOFORM
@@ -3071,7 +3102,7 @@ my $newfolderform;
$help{'Adding_Pages'}
@@ -3083,7 +3114,7 @@ NPFORM
$help{'Adding_Folders'}
@@ -3100,7 +3131,7 @@ NFFORM
NSYLFORM
-
+
my $newgroupfileform=(<
$uploadtag
@@ -3125,21 +3156,15 @@ if($env{'form.pagepath'}) {
}
my %orderhash = (
- 'aa' => 'New Document',
- 'bb' => 'Published Documents',
- 'cc' => 'Special Documents',
- 'dd' => 'Tools',
- 'zz' => 'Hide all Options',
- );
-my %namehash = (
- 'New Document' => $fileuploadform.'
'.$newfolderform,
- 'Published Documents' => $simpleeditdefaultform,
- 'Special Documents' => $specialdocumentsform,
- 'Tools' => $extresourcesform.'
'.$imspform.'
'.$recoverform.'
'.&generate_admin_options($containertag,$uploadtag,\%help,\%env),
+ 'aa' => ['Upload 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 $varcd = 'Main Course Documents';
-$r->print(&generate_edit_table($tid,$varcd,\%namehash,\%orderhash));
+$r->print(&generate_edit_table($tid,$varcd,\%orderhash));
$hadchanges=0;
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
if ($error) {
@@ -3206,7 +3231,7 @@ SUPDOCFORM
$help{'Adding_Folders'}
@@ -3219,7 +3244,7 @@ SNFFORM
$help{'Adding_External_Resource'}
@@ -3252,26 +3277,21 @@ SNAMFORM
my %suporderhash = (
- 'ee' => 'New Document',
- 'ff' => 'Special Documents',
- 'zz' => 'Hide all Options',
- );
-
-my %supnamehash = (
- 'New Document' => $supupdocform.'
'.$supnewfolderform,
- 'Special Documents' => $supnewextform.'
'.$supnewsylform.'
'.$supnewaboutmeform,
+ 'ee' => ['Upload Document',$supupdocform.'
'.$supnewfolderform],
+ 'ff' => ['Special Documents',$supnewextform.'
'.$supnewsylform.'
'.$supnewaboutmeform],
+ 'zz' => ['Hide all Options'],
);
my $tid='2';
my $varscd = 'Supplemental Course Documents';
-$r->print(&generate_edit_table($tid,$varscd,\%supnamehash,\%suporderhash));
+$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('
');
if ($allowed) {
$r->print('
@@ -3294,7 +3314,7 @@ $r->print('
');
}
$r->print(&Apache::loncommon::end_page());
return OK;
-}
+}
sub generate_admin_options {
my ($containertag,$uploadtag,$help_ref,$env_ref) = @_;
@@ -3324,27 +3344,28 @@ ENDOPTIONFORM
sub generate_edit_table {
- my ($tid,$varcd,$namehash_ref,$orderhash_ref) = @_;
- my %namehash = %{$namehash_ref};
+ my ($tid,$varcd,$orderhash_ref) = @_;
my %orderhash = %{$orderhash_ref};
my $form;
- $form = '
'.&mt($varcd).'
';
+ $form = '
'.&mt($varcd).'
';
$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(%namehash)){
- $form .= '
'.$namehash{$field}.'
';
- }
+ foreach my $field (keys(%orderhash)){
+ if($field ne 'zz'){
+ $form .= '
'.${$orderhash{$field}}[1].'
';
+ }
+ }
$form .= '
';
-
+
return $form;
}