Diff for /loncom/publisher/lonpubdir.pm between versions 1.105 and 1.110.2.1

version 1.105, 2007/11/02 19:24:44 version 1.110.2.1, 2008/12/21 04:36:58
Line 105  sub handler { Line 105  sub handler {
   my $numres = 0;    my $numres = 0;
       
   # Start off the directory table.    # Start off the directory table.
   $r->print('<h3>Directory Contents:</h3>');    $r->print('<h3>'.&mt('Directory Contents:').'</h3>');
   $r->print('<table id="LC_browser"><tr>'.    $r->print('<table id="LC_browser"><tr>'.
             '<th>'.&mt('Type').'</th>'.              '<th>'.&mt('Type').'</th>'.
             '<th>'.&mt('Actions').'</th>'.              '<th>'.&mt('Actions').'</th>'.
Line 156  sub getEffectiveUrl { Line 156  sub getEffectiveUrl {
  #   Replace the ~username of the URL with /home/username/public_html   #   Replace the ~username of the URL with /home/username/public_html
  #   so that we don't have to worry about ~ expansion internally.   #   so that we don't have to worry about ~ expansion internally.
  #   #
  $fn=~s/^http\:\/\/[^\/]+\///;   $fn=~s/^https?\:\/\/[^\/]+\///;
         $fn=~s/^\///;          $fn=~s/^\///;
         $fn=~s{~($LONCAPA::username_re)}{/home/$1/public_html};          $fn=~s{~($LONCAPA::username_re)}{/home/$1/public_html};
   
Line 197  sub startpage { Line 197  sub startpage {
     my $formaction='/priv/'.$uname.$thisdisfn.'/';      my $formaction='/priv/'.$uname.$thisdisfn.'/';
     $formaction=~s|/+|/|g;      $formaction=~s|/+|/|g;
     my $pagetitle .= &Apache::loncommon::help_open_menu('','',3,'Authoring').      my $pagetitle .= &Apache::loncommon::help_open_menu('','',3,'Authoring').
         '<font face="Arial, Helvetica, sans-serif" size="+1"><b>Construction Space</b>:</font>&nbsp;'.          '<font face="Arial, Helvetica, sans-serif" size="+1"><b>'.&mt('Construction Space').'</b>:</font>&nbsp;'.
         '<form name="dirs" method="post" action="'.$formaction.          '<form name="dirs" method="post" action="'.$formaction.
         '" target="_parent"><tt><b>'.          '" target="_parent"><tt><b>'.
         &Apache::lonhtmlcommon::crumbs($uname.$thisdisfn.'/','_top','/priv','','+1',1)."</b></tt><br />".          &Apache::lonhtmlcommon::crumbs($uname.$thisdisfn.'/','_top','/priv','','+1',1)."</b></tt><br />".
Line 217  sub startpage { Line 217  sub startpage {
     }      }
   
     my $esc_thisdisfn = &Apache::loncommon::escape_single($thisdisfn);      my $esc_thisdisfn = &Apache::loncommon::escape_single($thisdisfn);
       my $doctitle = 'LON-CAPA '.&mt('Construction Space');
       my $newname = &mt('New Name');
     my $pubdirscript=(<<ENDPUBDIRSCRIPT);      my $pubdirscript=(<<ENDPUBDIRSCRIPT);
 <script type="text/javascript">  <script type="text/javascript">
 top.document.title = '$esc_thisdisfn/ - LON-CAPA Construction Space';  top.document.title = '$esc_thisdisfn/ - $doctitle';
 // Store directory location for menu bar to find  // Store directory location for menu bar to find
   
 parent.lastknownpriv='/~$uname$esc_thisdisfn/';  parent.lastknownpriv='/~$uname$esc_thisdisfn/';
Line 313  parent.lastknownpriv='/~$uname$esc_thisd Line 315  parent.lastknownpriv='/~$uname$esc_thisd
     }      }
     function changename(theform,activity) {      function changename(theform,activity) {
         var oldname=theform.dispfilename.value;          var oldname=theform.dispfilename.value;
         var newname=prompt('New Name',oldname);          var newname=prompt('$newname',oldname);
         if (newname == "" || !newname || newname == oldname)  {          if (newname == "" || !newname || newname == oldname)  {
             return              return
         }          }
Line 369  sub dircontrols { Line 371  sub dircontrols {
        updc => 'Upload a new document',         updc => 'Upload a new document',
        pick => 'Please select an action to perform using the new filename',         pick => 'Please select an action to perform using the new filename',
                                       );                                        );
       my $mytype = $lt{'type'}; # avoid conflict with " and ' in javascript
     $r->print(<<END);      $r->print(<<END);
         <table id="LC_cstr_controls">          <table id="LC_cstr_controls">
          <tr>           <tr>
Line 429  sub dircontrols { Line 432  sub dircontrols {
                     <option value="newtaskfile">$lt{'nbt'}:</option>                      <option value="newtaskfile">$lt{'nbt'}:</option>
                     <option value="newlibraryfile">$lt{'nlib'}:</option>                      <option value="newlibraryfile">$lt{'nlib'}:</option>
             <option value="newdir">$lt{'nsub'}:</option>              <option value="newdir">$lt{'nsub'}:</option>
   </select>&nbsp;<input type="text" name="newfilename" value="Type Name Here" onfocus="if (this.value == 'Type Name Here') this.value=''" />&nbsp;<input type="button" value="Go" onclick="validate_go();" />    </select>&nbsp;<input type="text" name="newfilename" value="$lt{'type'}" onfocus="if (this.value == '$mytype') this.value=''" />&nbsp;<input type="button" value="Go" onclick="validate_go();" />
  </span>   </span>
  </form>   </form>
   </td>    </td>
Line 538  sub putdirectory { Line 541  sub putdirectory {
  ));   ));
         my $actionitem = '';          my $actionitem = '';
         if ($dirname eq '..') {          if ($dirname eq '..') {
             $actionitem = 'Go to ...';              $actionitem = &mt('Go to ...');
         } else {          } else {
             $actionitem =               $actionitem = 
                     '<form name="dirselect_'.$$numdir.                      '<form name="dirselect_'.$$numdir.
Line 653  sub putresource { Line 656  sub putresource {
  }    } 
   
  $title.="\n".'<br /><a href="/~'.$uname.$thisdisfn.'/'.$filename.'.meta">'.    $title.="\n".'<br /><a href="/~'.$uname.$thisdisfn.'/'.$filename.'.meta">'. 
     ($$bombs{$targetdir.'/'.$filename}?'<img src="/adm/lonMisc/bomb.gif" border="0" alt="bomb" />':'Edit Metadata').'</a>';      ($$bombs{$targetdir.'/'.$filename}?'<img src="/adm/lonMisc/bomb.gif" border="0" alt="'.&mt('bomb').'" />':&mt('Edit Metadata')).'</a>';
   
  if (!$meta_same) {   if (!$meta_same) {
     $title = &mt('Metadata Modified').'<br />'.$title.      $title = &mt('Metadata Modified').'<br />'.$title.

Removed from v.1.105  
changed lines
  Added in v.1.110.2.1


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