Diff for /loncom/interface/londocs.pm between versions 1.353 and 1.360

version 1.353, 2009/03/08 21:49:33 version 1.360, 2009/04/01 14:22:11
Line 1012  sub breadcrumbs { Line 1012  sub breadcrumbs {
     }      }
     $plain=~s/\&gt\;\s*$//;      $plain=~s/\&gt\;\s*$//;
     return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp',      return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp',
        'LC_docs_path'),$randompick,$ishidden,$isencrypted,$plain,$is_random_order);         'LC_docs_path', undef, 1 ),$randompick,$ishidden,$isencrypted,$plain,$is_random_order);
 }  }
   
 sub log_docs {  sub log_docs {
Line 1775  sub entryline { Line 1775  sub entryline {
  '<select name="newpos" onChange="this.form.submit()">';   '<select name="newpos" onChange="this.form.submit()">';
     for (my $i=1;$i<=$#LONCAPA::map::order+1;$i++) {      for (my $i=1;$i<=$#LONCAPA::map::order+1;$i++) {
  if ($i==$incindex) {   if ($i==$incindex) {
     $selectbox.='<option value="" selected="1">('.$i.')</option>';      $selectbox.='<option value="" selected="selected">('.$i.')</option>';
  } else {   } else {
     $selectbox.='<option value="'.$i.'">'.$i.'</option>';      $selectbox.='<option value="'.$i.'">'.$i.'</option>';
  }   }
Line 2000  END Line 2000  END
        'hd' => 'Hidden',         'hd' => 'Hidden',
        'ec' => 'URL hidden');         'ec' => 'URL hidden');
  my $enctext=   my $enctext=
     ((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i?' checked="1"':'');      ((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i?' checked="checked"':'');
  my $hidtext=   my $hidtext=
     ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i?' checked="1"':'');      ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i?' checked="checked"':'');
  $line.=(<<ENDPARMS);   $line.=(<<ENDPARMS);
   <td class="LC_docs_entry_parameter">    <td class="LC_docs_entry_parameter">
     $form_start      $form_start
Line 2889  HIDDENFORM Line 2889  HIDDENFORM
     }      }
 # --------------------------------------------------------- Main tab structure  # --------------------------------------------------------- Main tab structure
     my $activeClass = 1;      my $activeClass = 1;
       my $active = '';
     $r->print('<ul class="LC_TabContentBigger" id="mainnav">');      $r->print('<ul class="LC_TabContentBigger" id="mainnav">');
     if (($standard) && ($allowed) && (!$forcesupplement)) {      if (($standard) && ($allowed) && (!$forcesupplement) && ($env{'form.folderpath'}=~/^default/)) {
  my $active = '';  
         if($activeClass == 1){          if($activeClass == 1){
            $active = 'class="active"';             $active = 'class="active"';
    $activeClass = 0;     $activeClass = 0;
  }   }
  $r->print('<li '.$active.'onclick="javascript:showPage(this,\'Main Course Documents\',\'mainnav\',\'maincoursedoc\');">'.&mt('Main Course Documents').'</li>');  
     }      }
     if (!$forcestandard) {      $r->print('<li '.$active.'onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');">'.&mt('Main Course Documents').'</li>');
  my $active = '';      $active = '';
       if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) {
         if($activeClass == 1){          if($activeClass == 1){
            $active = 'class="active"';             $active = 'class="active"';
         }          }
  $r->print('<li '.$active.'onclick="javascript:showPage(this,\'Supplemental Course Documents\',\'mainnav\',\'maincoursedoc\');">'.&mt('Supplemental Course Documents').'</li>');  
     }      }
     $r->print('<li onclick="javascript:showPage(this,\'Special Admin Options\',\'mainnav\',\'maincoursedoc\');">'.&mt('Special Admin Options').'</li>');      $r->print('<li '.$active.'onclick="javascript:showPage(this,\'Supplemental Course Documents\',\'mainnav\',\'maincoursedoc\');">'.&mt('Supplemental Course Documents').'</li>');
     $r->print('</ul><div class="LC_ContentBoxSpecial" style="margin:0 0;padding:0 0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;">');      $r->print('</ul><div class="LC_ContentBoxSpecial" style="margin:0 0;padding:0 0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;">');
 # --------------------------------------------------------- Standard documents  # --------------------------------------------------------- Standard documents
     if (($standard) && ($allowed) && (!$forcesupplement)) {         my $savefolderpath;
        my $active = 'style="display: none;"';         my $active = 'style="display: none;"';
        if($activeClass == 0){         if($activeClass == 0){
           $active = 'style="display: block;"';            $active = 'style="display: block;"';
        }         }
        $r->print('<div class="LC_ContentBox" id="Main Course Documents" '.$active.'>');         $r->print('<div class="LC_ContentBox" id="mainCourseDocuments" '.$active.'>');
         $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',          $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
                      &mt('Editing the Table of Contents for your '.$type)));                       &mt('Editing the Table of Contents for your '.$type)));
        my $folder=$env{'form.folder'};         my $folder=$env{'form.folder'};
        if ($folder eq '' || $folder eq 'supplemental') {         if ($folder eq '' || $folder=~/^supplemental/) {
            $folder='default';             $folder='default';
      $savefolderpath = $env{'form.folderpath'};
    $env{'form.folderpath'}='default&'.&escape(&mt('Main '.$type.' Documents'));     $env{'form.folderpath'}='default&'.&escape(&mt('Main '.$type.' Documents'));
            $uploadtag = '<input type="hidden" name="folderpath" value="'.             $uploadtag = '<input type="hidden" name="folderpath" value="'.
        &HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />';         &HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />';
Line 3128  my %orderhash = ( Line 3128  my %orderhash = (
                 'aa' => 'New Document',                  'aa' => 'New Document',
                 'bb' => 'Published Documents',                  'bb' => 'Published Documents',
                 'cc' => 'Special Documents',                  'cc' => 'Special Documents',
  'dd' => 'More Options',   'dd' => 'Tools',
                 'zz' => 'Hide all Options',                  'zz' => 'Hide all Options',
                 );                  );
 my %namehash = (  my %namehash = (
                 'New Document' => $fileuploadform.'<br />'.$newfolderform,                  'New Document' => $fileuploadform.'<br />'.$newfolderform,
                 'Published Documents' => $simpleeditdefaultform,                  'Published Documents' => $simpleeditdefaultform,
                 'Special Documents' => $specialdocumentsform,                  'Special Documents' => $specialdocumentsform,
  'More Options' => $extresourcesform.'<br />'.$imspform.'<br />'.$recoverform,   'Tools' => $extresourcesform.'<br />'.$imspform.'<br />'.$recoverform.'<br />'.&generate_admin_options($containertag,$uploadtag,\%help,\%env),
                 );                  );
 my $tid='1';  my $tid='1';
 my $content='content';  
 my $navigation='navigation';  
 my $varcd = 'Main Course Documents';  my $varcd = 'Main Course Documents';
 $r->print(&generate_edit_table($tid,$content,$navigation,$varcd,\%namehash,\%orderhash));  $r->print(&generate_edit_table($tid,$varcd,\%namehash,\%orderhash));
  $hadchanges=0;   $hadchanges=0;
         my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);          my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
        if ($error) {         if ($error) {
Line 3155  $r->print(&generate_edit_table($tid,$con Line 3153  $r->print(&generate_edit_table($tid,$con
 $r->print('</div>');  $r->print('</div>');
        if ($env{'form.pagepath'}) {         if ($env{'form.pagepath'}) {
        }         }
     }  
 # ----------------------------------------------------- Supplemental documents  # ----------------------------------------------------- Supplemental documents
     if (!$forcestandard) {  
        my $active = 'style="display: none;"';         my $active = 'style="display: none;"';
        if($activeClass == 1){         if($activeClass == 1){
           $active = 'style="display: block;"';            $active = 'style="display: block;"';
Line 3171  $r->print('</div>'); Line 3167  $r->print('</div>');
    (($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) {     (($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) {
           $env{'form.folderpath'} = 'supplemental&'.            $env{'form.folderpath'} = 'supplemental&'.
                                     &escape(&mt('Supplemental '.$type.' Documents'));                                      &escape(&mt('Supplemental '.$type.' Documents'));
          }else{
     $env{'form.folderpath'} = $savefolderpath;
        }         }
        if ($allowed) {         if ($allowed) {
    my $folderseq=     my $folderseq=
Line 3189  $r->print('</div>'); Line 3187  $r->print('</div>');
  </span>   </span>
  <br /><br />   <br /><br />
  $lt{'comment'}:<br />   $lt{'comment'}:<br />
  <textarea cols=50 rows=4 name='comment'>   <textarea cols="50" rows="4" name="comment">
  </textarea>   </textarea>
  <br />   <br />
  <input type="hidden" name="folderpath" value="$path" />   <input type="hidden" name="folderpath" value="$path" />
Line 3259  my %suporderhash = ( Line 3257  my %suporderhash = (
                 );                  );
   
 my %supnamehash = (  my %supnamehash = (
                 'New Document' => $supupdocform,                  'New Document' => $supupdocform.'<br />'.$supnewfolderform,
                 'Special Documents' => $supnewfolderform.'<br />'.$supnewextform.'<br />'.$supnewsylform.'<br />'.$supnewaboutmeform,                  'Special Documents' => $supnewextform.'<br />'.$supnewsylform.'<br />'.$supnewaboutmeform,
                 );                  );
   
 my $tid='2';  my $tid='2';
 my $content='content';  
 my $navigation='navigation';  
 my $varscd = 'Supplemental Course Documents';  my $varscd = 'Supplemental Course Documents';
   
 $r->print(&generate_edit_table($tid,$content,$navigation,$varscd,\%supnamehash,\%suporderhash));  $r->print(&generate_edit_table($tid,$varscd,\%supnamehash,\%suporderhash));
 my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);  my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
        if ($error) {         if ($error) {
            $r->print('<p><span class="LC_error">'.$error.'</span></p>');             $r->print('<p><span class="LC_error">'.$error.'</span></p>');
        }         }
 $r->print('</div>');  $r->print('</div>');
  }    } 
    }  
 $r->print('<div class="LC_ContentBox" id="Special Admin Options" style="display: none;">');  
 $r->print(&generate_admin_options($containertag,$uploadtag,\%help,\%env));  
 $r->print('</div>');  
 $r->print('</div>');  $r->print('</div>');
     if ($allowed) {      if ($allowed) {
  $r->print('   $r->print('
Line 3317  sub generate_admin_options { Line 3309  sub generate_admin_options {
   my $exportbut=&exportbutton();    my $exportbut=&exportbutton();
   return (<<ENDOPTIONFORM);    return (<<ENDOPTIONFORM);
  <form action="/adm/coursedocs" method="post" name="courseverify">   <form action="/adm/coursedocs" method="post" name="courseverify">
    <ul style="list-style-type:none">             <input type="submit" name="verify" value="$lt{'vc'}" />$help{'Verify_Content'}<br />
        <li>             <input type="submit" name="versions" value="$lt{'cv'}" />$help{'Check_Resource_Versions'}<br />
            <input type="submit" name="verify" value="$lt{'vc'}" />$help{'Verify_Content'}             $dumpbut<br />
        </li>             $exportbut<br />
        <li>  
            <input type="submit" name="versions" value="$lt{'cv'}" />$help{'Check_Resource_Versions'}  
        </li>  
        <li>  
            $dumpbut  
        </li>  
        <li>  
            $exportbut  
        </li>  
        <li>  
           <input type="submit" name="listsymbs" value="$lt{'ls'}" />            <input type="submit" name="listsymbs" value="$lt{'ls'}" />
         </li>            <input type="hidden" name="folder" value="$env{'form.folder'}" /><br />
         <li>  
           <input type="hidden" name="folder" value="$env{'form.folder'}" />  
           <input type="submit" name="docslog" value="$lt{'sl'}" />            <input type="submit" name="docslog" value="$lt{'sl'}" />
         </li>  
    </ul>  
  </form>   </form>
 <!-- <div style="clear: both; height: 0px;">&nbsp;</div>-->  
 ENDOPTIONFORM  ENDOPTIONFORM
   
 }  }
   
   
 sub generate_edit_table {  sub generate_edit_table {
     my ($tid,$content,$navigation,$varcd,$namehash_ref,$orderhash_ref) = @_;      my ($tid,$varcd,$namehash_ref,$orderhash_ref) = @_;
     my %namehash = %{$namehash_ref};      my %namehash = %{$namehash_ref};
     my %orderhash = %{$orderhash_ref};      my %orderhash = %{$orderhash_ref};
     my $form;      my $form;
   
     $form = '<div class="LC_ContentBoxSpecial"><h4 class="LC_hcell">'.&mt($varcd).'</h4>';      $form = '<div class="LC_ContentBoxSpecial"><h4 class="LC_hcell">'.&mt($varcd).'</h4>';
     $form .= '<ul id="'.$navigation.$tid.'" class="LC_TabContent">';      $form .= '<ul id="navigation'.$tid.'" class="LC_TabContent">';
     foreach my $name (sort(keys(%orderhash))){      foreach my $name (sort(keys(%orderhash))){
         if($name eq 'zz'){          if($name eq 'zz'){
             $form .= '<span class="LC_Right"><li onclick="javascript:hideAll(this, \''.$navigation.$tid.'\' ,\''.$content.$tid.'\');" class="active">'.&mt($orderhash{$name}).'</li></span>';              $form .= '<span class="LC_Right"><li onclick="javascript:hideAll(this, \'navigation'.$tid.'\' ,\'content'.$tid.'\');" class="active">'.&mt($orderhash{$name}).'</li></span>';
         }else{          }else{
             $form .= '<li onclick="javascript:showPage(this, \''.$tid.$orderhash{$name}.'\', \''.$navigation.$tid.'\',\''.$content.$tid.'\');">'.&mt($orderhash{$name}).'</li>';              $form .= '<li onclick="javascript:showPage(this, \''.substr($orderhash{$name},0,3).$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');">'.&mt($orderhash{$name}).'</li>';
         }          }
     }      }
     $form .= '</ul>';      $form .= '</ul>';
     $form .= '<div id="'.$content.$tid.'" style="padding: 0 0; margin: 0 0;">';      $form .= '<div id="content'.$tid.'" style="padding: 0 0; margin: 0 0;">';
     foreach my $field (keys(%namehash)){      foreach my $field (keys(%namehash)){
         $form .= '<div id="'.$tid.$field.'" class="LC_ContentBox" style="display: none;">'.$namehash{$field}.'</div>';          $form .= '<div id="'.substr($field,0,3).$tid.'" class="LC_ContentBox" style="display: none;">'.$namehash{$field}.'</div>';
       }        }
     $form .= '</div></div>';      $form .= '</div></div>';
           

Removed from v.1.353  
changed lines
  Added in v.1.360


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>