Diff for /loncom/publisher/lonpublisher.pm between versions 1.237 and 1.238

version 1.237, 2008/05/28 22:22:35 version 1.238, 2008/06/27 18:52:35
Line 331  sub textfield { Line 331  sub textfield {
     $value=~s/\s+/ /gs;      $value=~s/\s+/ /gs;
     $title=&mt($title);      $title=&mt($title);
     $env{'form.'.$name}=$value;      $env{'form.'.$name}=$value;
     return "\n<p><font color=\"#800000\" face=\"helvetica\"><b>$title:".      return "\n".&Apache::lonhtmlcommon::row_title($title)
            "</b></font></p><br />".             .'<input type="text" name="'.$name.'" size="80" value="'.$value.'" />'
            '<input type="text" name="'.$name.'" size=80 value="'.$value.'" />';             .&Apache::lonhtmlcommon::row_closure();
 }  }
   
 sub text_with_browse_field {  sub text_with_browse_field {
Line 343  sub text_with_browse_field { Line 343  sub text_with_browse_field {
     $value=~s/\s+/ /gs;      $value=~s/\s+/ /gs;
     $title=&mt($title);      $title=&mt($title);
     $env{'form.'.$name}=$value;      $env{'form.'.$name}=$value;
     return "\n<p><font color=\"#800000\" face=\"helvetica\"><b>$title:".      return "\n".&Apache::lonhtmlcommon::row_title($title)
            "</b></font></p><br />".            .'<input type="text" name="'.$name.'" size="80" value="'.$value.'" />'
            '<input type="text" name="'.$name.'" size=80 value="'.$value.'" />'.            .'<br />'
    '<a href="javascript:openbrowser(\'pubform\',\''.$name.'\',\''.$restriction.'\');">'.&mt('Select').'</a>&nbsp;'.    .'<a href="javascript:openbrowser(\'pubform\',\''.$name.'\',\''.$restriction.'\');">'
    '<a href="javascript:opensearcher(\'pubform\',\''.$name.'\');">'.&mt('Search').'</a>';            .&mt('Select')
                .'</a>&nbsp;'
     .'<a href="javascript:opensearcher(\'pubform\',\''.$name.'\');">'
             .&mt('Search')
             .'</a>'
             .&Apache::lonhtmlcommon::row_closure();
 }  }
   
 sub hiddenfield {  sub hiddenfield {
Line 372  sub selectbox { Line 376  sub selectbox {
     } else {      } else {
  $env{'form.'.$name}=$idlist[0];   $env{'form.'.$name}=$idlist[0];
     }      }
     my $selout="\n<p><font color=\"#800000\" face=\"helvetica\"><b>$title:".      my $selout="\n".&Apache::lonhtmlcommon::row_title($title)
  '</b></font></p><br /><select name="'.$name.'">';                .'<select name="'.$name.'">';
     foreach (@idlist) {      foreach (@idlist) {
         $selout.='<option value=\''.$_.'\'';          $selout.='<option value=\''.$_.'\'';
         if ($_ eq $value) {          if ($_ eq $value) {
Line 381  sub selectbox { Line 385  sub selectbox {
  }   }
         else {$selout.='>'.&{$functionref}($_).'</option>';}          else {$selout.='>'.&{$functionref}($_).'</option>';}
     }      }
     return $selout.'</select>';      $selout.='</select>'.&Apache::lonhtmlcommon::row_closure();
       return $selout;
 }  }
   
 sub select_level_form {  sub select_level_form {
Line 1190  sub publish { Line 1195  sub publish {
 #   $env{'from.'..} so that it can be used by the phase two handler in  #   $env{'from.'..} so that it can be used by the phase two handler in
 #    batch mode  #    batch mode
   
     my $intr_scrout.=      my $intr_scrout.=&Apache::lonhtmlcommon::start_pick_box()
  '<form name="pubform" action="/adm/publish" method="post">'.                      .'<form name="pubform" action="/adm/publish" method="post">';
  '<p>'.($env{'form.makeobsolete'}?'':'<input type="submit" value="'.&mt('Finalize Publication').'" />').'</p>'.      unless ($env{'form.makeobsolete'}) {
          $intr_scrout.=&Apache::lonhtmlcommon::row_title()
                       .'<input type="submit" value="'
                       .&mt('Finalize Publication')
                       .'" />'
                       .&Apache::lonhtmlcommon::row_closure()
       }
       $intr_scrout.=
  &hiddenfield('phase','two').   &hiddenfield('phase','two').
  &hiddenfield('filename',$env{'form.filename'}).   &hiddenfield('filename',$env{'form.filename'}).
  &hiddenfield('allmeta',&escape($allmeta)).   &hiddenfield('allmeta',&escape($allmeta)).
Line 1204  sub publish { Line 1216  sub publish {
  &textfield('Subject','subject',$metadatafields{'subject'});   &textfield('Subject','subject',$metadatafields{'subject'});
  # --------------------------------------------------- Scan content for keywords   # --------------------------------------------------- Scan content for keywords
   
     my $keywords_help = Apache::loncommon::help_open_topic("Publishing_Keywords");      my $keywords_help = &Apache::loncommon::help_open_topic("Publishing_Keywords");
     my $KEYWORDS=&mt('Keywords');  
     my $CheckAll=&mt('check all');  
     my $UncheckAll=&mt('uncheck all');  
     my $keywordout=<<"END";      my $keywordout=<<"END";
 <script>  <script>
 function checkAll(field) {  function checkAll(field) {
Line 1220  function uncheckAll(field) { Line 1229  function uncheckAll(field) {
         field[i].checked = false ;          field[i].checked = false ;
 }  }
 </script>  </script>
 <p><font color="#800000" face="helvetica"><b>$KEYWORDS:</b></font>  
  $keywords_help</b>  
 <input type="button" value="$CheckAll" onclick="javascript:checkAll(document.pubform.keywords)" />   
 <input type="button" value="$UncheckAll" onclick="javascript:uncheckAll(document.pubform.keywords)" />   
 </p>  
 <br />  
 END  END
     $keywordout.='<table border="2"><tr>';      $keywordout.="\n".&Apache::lonhtmlcommon::row_title(&mt('Keywords'))
                   .$keywords_help
                   .'<input type="button" value="'.&mt('check all').'" onclick="javascript:checkAll(document.pubform.keywords)" />'
                   .'<input type="button" value="'.&mt('uncheck all').'" onclick="javascript:uncheckAll(document.pubform.keywords)" />'
                   .'</p><br />'
                   .'<table border="2"><tr>';
     my $colcount=0;      my $colcount=0;
   
     foreach (sort keys %keywords) {      foreach (sort keys %keywords) {
Line 1250  END Line 1258  END
     }      }
     $env{'form.keywords'}=~s/\,$//;      $env{'form.keywords'}=~s/\,$//;
   
     $keywordout.='</tr></table>';      $keywordout.='</tr></table>'
                    .&Apache::lonhtmlcommon::row_closure();
   
     $intr_scrout.=$keywordout;      $intr_scrout.=$keywordout;
   
Line 1258  END Line 1267  END
   
     $intr_scrout.=&textfield('Notes','notes',$metadatafields{'notes'});      $intr_scrout.=&textfield('Notes','notes',$metadatafields{'notes'});
   
     $intr_scrout.=      $intr_scrout.="\n".&Apache::lonhtmlcommon::row_title(&mt('Abstract'))
  "\n<p><font color=\"#800000\" face=\"helvetica\"><b>".&mt('Abstract').":".                   .'<textarea cols="80" rows="5" name="abstract">'
  "</b></font></p><br />".                   .$metadatafields{'abstract'}
  '<textarea cols="80" rows="5" name="abstract">'.                   .'</textarea>'
  $metadatafields{'abstract'}.'</textarea></p>';                   .&Apache::lonhtmlcommon::row_closure();
   
     $source=~/\.(\w+)$/;      $source=~/\.(\w+)$/;
   
       $intr_scrout.="\n".&Apache::lonhtmlcommon::row_title(&mt('Grade Levels'))
                    .&mt('Lowest Grade Level:').'&nbsp;'
                    .&select_level_form($metadatafields{'lowestgradelevel'},'lowestgradelevel')
   #                .&Apache::lonhtmlcommon::row_closure();
   #   $intr_scrout.="\n".&Apache::lonhtmlcommon::row_title(&mt('Highest Grade Level'))
                    .' '.&mt('Highest Grade Level:').'&nbsp;'
                    .&select_level_form($metadatafields{'highestgradelevel'},'highestgradelevel')
                    .&Apache::lonhtmlcommon::row_closure();
   
     $intr_scrout.=      $intr_scrout.=&textfield('Standards','standards',$metadatafields{'standards'});
  "\n<p><font color=\"#800000\" face=\"helvetica\"><b>".  
  &mt('Lowest Grade Level').':'.  
  "</b></font></p><br />".  
  &select_level_form($metadatafields{'lowestgradelevel'},'lowestgradelevel').  
  "\n<p><font color=\"#800000\" face=\"helvetica\"><b>".  
  &mt('Highest Grade Level').':'.  
  "</b></font></p><br />".  
  &select_level_form($metadatafields{'highestgradelevel'},'highestgradelevel').  
  &textfield('Standards','standards',$metadatafields{'standards'});  
   
   
   
   
     $intr_scrout.=&hiddenfield('mime',$1);      $intr_scrout.=&hiddenfield('mime',$1);
   
Line 1338  END Line 1343  END
      (grep !/^priv$/,(&Apache::loncommon::copyrightids)));       (grep !/^priv$/,(&Apache::loncommon::copyrightids)));
  }   }
  my $copyright_help =   my $copyright_help =
     Apache::loncommon::help_open_topic('Publishing_Copyright');      &Apache::loncommon::help_open_topic('Publishing_Copyright');
  $intr_scrout =~ s/Distribution:/'Distribution: ' . $copyright_help/ge;          my $replace=&mt('Copyright/Distribution:');
  $intr_scrout.=&text_with_browse_field('Custom Distribution File','customdistributionfile',$metadatafields{'customdistributionfile'},'rights').$copyright_help;   $intr_scrout =~ s/$replace/$replace.' '.$copyright_help/ge;
   
    $intr_scrout.=&text_with_browse_field('Custom Distribution File','customdistributionfile',$metadatafields{'customdistributionfile'},'rights');
  $intr_scrout.=&selectbox('Source Distribution','sourceavail',   $intr_scrout.=&selectbox('Source Distribution','sourceavail',
  $defaultsourceoption,   $defaultsourceoption,
  \&Apache::loncommon::source_copyrightdescription,   \&Apache::loncommon::source_copyrightdescription,
  (&Apache::loncommon::source_copyrightids));   (&Apache::loncommon::source_copyrightids));
 # $intr_scrout.=&text_with_browse_field('Source Custom Distribution File','sourcerights',$metadatafields{'sourcerights'},'rights');  # $intr_scrout.=&text_with_browse_field('Source Custom Distribution File','sourcerights',$metadatafields{'sourcerights'},'rights');
  my $uctitle=&mt('Obsolete');   my $uctitle=&mt('Obsolete');
  $intr_scrout.=          my $obsolete_checked=($metadatafields{'obsolete'})?' checked="1" ':'';
     "\n<p><label><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:".          $intr_scrout.="\n".&Apache::lonhtmlcommon::row_title($uctitle)
     '</b></font> <input type="checkbox" name="obsolete" ';                       .'<input type="checkbox" name="obsolete" '.$obsolete_checked.'/ >'
  if ($metadatafields{'obsolete'}) {                       .&Apache::lonhtmlcommon::row_closure(1);
     $intr_scrout.=' checked="1" ';          $intr_scrout.=&text_with_browse_field('Suggested Replacement for Obsolete File',
  }  
  $intr_scrout.='/ ></label></p>'.  
     &text_with_browse_field('Suggested Replacement for Obsolete File',  
     'obsoletereplacement',      'obsoletereplacement',
     $metadatafields{'obsoletereplacement'});      $metadatafields{'obsoletereplacement'});
     } else {      } else {
Line 1385  END Line 1389  END
     $metadatafields{'obsoletereplacement'});      $metadatafields{'obsoletereplacement'});
    }     }
     if (!$batch) {      if (!$batch) {
  $scrout.=$intr_scrout.'<p><input type="submit" value="'.   $scrout.=$intr_scrout
     &mt($env{'form.makeobsolete'}?'Make Obsolete':'Finalize Publication').'" /></p></form>';              .&Apache::lonhtmlcommon::row_title()
               .'<input type="submit" value="'
       .&mt($env{'form.makeobsolete'}?'Make Obsolete':'Finalize Publication')
               .'" />'.&Apache::lonhtmlcommon::row_closure()
               .'</form>'
               .&Apache::lonhtmlcommon::end_pick_box();
     }      }
     return($scrout,0);      return($scrout,0);
 }  }
Line 1710  sub phasetwo { Line 1719  sub phasetwo {
         $r->print(          $r->print(
            '<hr /><a href="'.$thisdistarget.'"><font size="+2">'.             '<hr /><a href="'.$thisdistarget.'"><font size="+2">'.
            &mt('View Published Version').'</font></a>'.             &mt('View Published Version').'</font></a>'.
            '<p><a href="'.$thissrc.'"><font size=+2>'.             '<p><a href="'.$thissrc.'"><font size="+2">'.
   &mt('Back to Source').'</font></a></p>'.    &mt('Back to Source').'</font></a></p>'.
            '<p><a href="'.$thissrcdir.             '<p><a href="'.$thissrcdir.
                    '"><font size="+2">'.                     '"><font size="+2">'.

Removed from v.1.237  
changed lines
  Added in v.1.238


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