--- loncom/interface/londocs.pm 2009/01/30 11:39:38 1.332 +++ loncom/interface/londocs.pm 2009/02/10 12:20:18 1.338 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.332 2009/01/30 11:39:38 tempelho Exp $ +# $Id: londocs.pm,v 1.338 2009/02/10 12:20:18 ehlerst Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2764,7 +2764,7 @@ sub handler { 'sipr' => 'Simple Problem', 'drbx' => 'Drop Box', 'scuf' => 'Score Upload Form', - 'bull' => 'Bulletin Board', + 'bull' => 'Discussion Board', 'mypi' => 'My Personal Info', 'grpo' => 'Group Files', 'rost' => 'Course Roster', @@ -2872,18 +2872,49 @@ ERFORM $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 + +
+ + $uploadtag +
+HIDDENFORM } +# --------------------------------------------------------- Main tab structure + my $activeClass = 1; + $r->print('
'); # --------------------------------------------------------- Standard documents - $r->print(''); - if (($standard) && ($allowed) && (!$forcesupplement)) { - $r->print(' - -'."\n". -'
'); -# '

'.&mt('Main Course Documents'). -# ($allowed?' '.$help{'Main_Course_Documents'}:'').'

'); + my $active = 'style="display: none;"'; + if($activeClass == 0){ + $active = 'style="display: block;"'; + } + $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') { $folder='default'; @@ -2898,11 +2929,6 @@ ERFORM #$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(); } @@ -3037,38 +3063,9 @@ NASOFORM 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=(< @@ -3118,72 +3115,57 @@ NSYLFORM NGFFORM - my $specialdocumentsform=(< -$newfolderform -
-$newpageform -
-$newsylform -
-$newnavform -
-$newsmppageform -
-$newsmpproblemform -
-$newdropboxform -
-$newexuploadform -
-$newbulform -
-$newaboutmeform -
-$newaboutsomeoneform -
-$newgroupfileform -
-$newrosterform -ENDFORM + my $specialdocumentsform=(<$newfolderform +
$newpageform +
$newsylform +
$newnavform +
$newsmppageform +
$newsmpproblemform +
$newdropboxform +
$newexuploadform +
$newbulform +
$newaboutmeform +
$newaboutsomeoneform +
$newgroupfileform +
$newrosterform +SPDOFORM -$r->print($specialdocumentsform); my %orderhash = ( 'aa' => 'New Document', 'bb' => 'Published Documents', 'cc' => 'Special Documents', 'dd' => 'More Options', - 'zz' => 'Hide all Option', + 'zz' => 'Hide all Options', ); my %namehash = ( 'New Document' => $fileuploadform, 'Published Documents' => $simpleeditdefaultform, 'Special Documents' => $specialdocumentsform, 'More Options' => $extresourcesform.'
'.$imspform.'
'.$recoverform, - 'drei' => 'dr', ); -my $varcd = 'Course Documents'; -$r->print(&generate_edit_table($varcd,\%namehash,\%orderhash)); - +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); + if ($error) { + $r->print('

'.$error.'

'); + } +$r->print(''); } if ($env{'form.pagepath'}) { - $r->print(< -$newexuploadform -ENDBLOCK } - $r->print('
'); -#$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'; @@ -3193,10 +3175,6 @@ ENDBLOCK $env{'form.folderpath'} = 'supplemental&'. &escape(&mt('Supplemental '.$type.' Documents')); } - my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); - if ($error) { - $r->print('

'.$error.'

'); - } if ($allowed) { my $folderseq= '/uploaded/'.$coursedom.'/'.$coursenum.'/supplemental_'.time. @@ -3275,30 +3253,36 @@ SNSFORM SNAMFORM - $r->print(< -
  • $lt{'nd'}
  • -
  • $lt{'sd'}
  • -
  • $lt{'hao'}
  • - - - - -
    -$supupdocform - -$supnewfolderform -
    -$supnewextform -
    -$supnewsylform -
    -$supnewaboutmeform -
    -ENDSUPFORM + + +my %suporderhash = ( + 'ee' => 'New Document', + 'ff' => 'Special Documents', + 'zz' => 'Hide all Options', + ); + +my %supnamehash = ( + 'New Document' => $supupdocform, + 'Special Documents' => $supnewfolderform.'
    '.$supnewextform.'
    '.$supnewsylform.'
    '.$supnewaboutmeform, + ); + +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)); +my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); + if ($error) { + $r->print('

    '.$error.'

    '); } - } - $r->print(''); +$r->print('
    '); + } + } +$r->print(''); +$r->print('
    '); if ($allowed) { $r->print('
    @@ -3308,7 +3292,6 @@ ENDSUPFORM
    '); } - } else { unless ($upload_result eq 'phasetwo') { # -------------------------------------------------------- This is showdoc mode @@ -3324,24 +3307,18 @@ ENDSUPFORM } 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 -
    • @@ -3365,35 +3342,35 @@ sub generate_admin_options {
    -
     
    + ENDOPTIONFORM } sub generate_edit_table { - my ($varcd,$namehash_ref,$orderhash_ref) = @_; + 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 $form; - #foreach my $id (keys(%tablehash)){ - $form = '

    '.&mt('Upload '.$varcd).'

    '; - $form .= '