--- loncom/interface/londocs.pm 2009/01/28 18:10:04 1.329 +++ loncom/interface/londocs.pm 2009/02/03 14:16:39 1.334 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.329 2009/01/28 18:10:04 droeschl Exp $ +# $Id: londocs.pm,v 1.334 2009/02/03 14:16:39 muellerd Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2872,17 +2872,13 @@ 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))); } # --------------------------------------------------------- Standard documents - $r->print(''); - if (($standard) && ($allowed) && (!$forcesupplement)) { - $r->print(''); } # ----------------------------------------------------- Supplemental documents if (!$forcestandard) { - $r->print(' -ENDSUPFORM - } - } - $r->print('
'); -# '

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

'); my $folder=$env{'form.folder'}; if ($folder eq '' || $folder eq 'supplemental') { $folder='default'; @@ -3036,46 +3032,9 @@ NASOFORM NROSTFORM - $r->print(< -
  • $lt{'nd'}
  • -
  • $lt{'pm'}
  • -
  • $lt{'pubd'}
  • -
  • $lt{'sd'}
  • -
  • $lt{'mo'}
  • -
  • $lt{'hao'}
  • - - - - - - -'."\n". -'
    -$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=(< @@ -3125,51 +3084,47 @@ NSYLFORM NGFFORM - $r->print(< -$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 + + +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, + ); +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)); + } if ($env{'form.pagepath'}) { - $r->print(< -$newexuploadform -ENDBLOCK } - $r->print('
    '); - $r->print('
    '); -# '

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

    '); my $folder=$env{'form.folder'}; unless ($folder=~/^supplemental/) { $folder='supplemental'; @@ -3261,30 +3216,28 @@ SNSFORM SNAMFORM - $r->print(< -
  • $lt{'nd'}
  • -
  • $lt{'sd'}
  • -
  • $lt{'hao'}
  • - - - - -
    -$supupdocform - -$supnewfolderform -
    -$supnewextform -
    -$supnewsylform -
    -$supnewaboutmeform -
    '); + + +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)); + + } + } if ($allowed) { $r->print('
    @@ -3352,27 +3305,33 @@ sub generate_admin_options {
     
    ENDOPTIONFORM + } + sub generate_edit_table { - my ($optionhash_ref,$namehash_ref,$orderhash_ref) = @_; - my %optionhash = %{$optionhash_ref}; #id verlinkt mit inhalt + 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; - $form = '

    '.&mt('Upload Course Documents').'

    '; - $form .= '

    '; + return $form; } @@ -3577,6 +3536,32 @@ function markcopy(folderpath,index,oldti this.document.forms.renameform.submit(); } +function unselectInactive(nav) { + currentNav = document.getElementById(nav); + currentLis = currentNav.getElementsByTagName('LI'); + for (i = 0; i < currentLis.length; i++) { + currentLis[i].className = 'i'; + } +} + +function hideAll(current, nav, data) { + unselectInactive(nav); + current.className = 'active'; + currentData = document.getElementById(data); + currentDivs = currentData.getElementsByTagName('DIV'); + for (i = 0; i < currentDivs.length; i++) { + currentDivs[i].style.display = 'none'; + } +} + +function showPage(current, pageId, nav, data) { + hideAll(current, nav, data); + unselectInactive(nav); + current.className = 'active'; + currentData = document.getElementById(pageId); + currentData.style.display = 'block'; + return false; +} ENDNEWSCRIPT }