[LON-CAPA-cvs] cvs: loncom(version_2_9_X) /publisher lonpubdir.pm

raeburn raeburn@source.lon-capa.org
Thu, 11 Feb 2010 21:49:19 -0000


raeburn		Thu Feb 11 21:49:19 2010 EDT

  Modified files:              (Branch: version_2_9_X)
    /loncom/publisher	lonpubdir.pm 
  Log:
  - Backport 1.118, 1.119, 1.120, 1.124.
  
  
Index: loncom/publisher/lonpubdir.pm
diff -u loncom/publisher/lonpubdir.pm:1.114 loncom/publisher/lonpubdir.pm:1.114.2.1
--- loncom/publisher/lonpubdir.pm:1.114	Thu Nov 20 15:19:28 2008
+++ loncom/publisher/lonpubdir.pm	Thu Feb 11 21:49:19 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construction Space Directory Lister
 #
-# $Id: lonpubdir.pm,v 1.114 2008/11/20 15:19:28 jms Exp $
+# $Id: lonpubdir.pm,v 1.114.2.1 2010/02/11 21:49:19 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -62,7 +62,7 @@
     &Apache::loncacc::constructaccess(
              $fn,$r->dir_config('lonDefDomain')); 
   unless (($uname) && ($udom)) {
-     $r->log_reason($uname.' at '.$udom.
+     $r->log_reason($uname.':'.$udom.
          ' trying to list directory '.$env{'form.filename'}.
          ' ('.$fn.') - not authorized', 
          $r->filename); 
@@ -74,7 +74,7 @@
   $fn=~s/\/$//;
 
   unless ($fn) { 
-     $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.
+     $r->log_reason($env{'user.name'}.':'.$env{'user.domain'}.
          ' trying to list empty directory', $r->filename); 
      return HTTP_NOT_FOUND;
   } 
@@ -156,7 +156,8 @@
 	#   Replace the ~username of the URL with /home/username/public_html
 	#   so that we don't have to worry about ~ expansion internally.
 	#
-	$fn=~s/^http\:\/\/[^\/]+\///;
+        $fn=~s/^https?\:\/\/[^\/]+\///;
+
         $fn=~s/^\///;
         $fn=~s{~($LONCAPA::username_re)}{/home/$1/public_html};
 	
@@ -330,7 +331,7 @@
 
     if ((($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) &&
 	$env{'environment.remote'} ne 'off') {
-	$r->print('<h3>'.&mt('Co-Author').': '.$uname.' at '.$udom.
+        $r->print('<h3>'.&mt('Co-Author [_1]',$uname.':'.$udom).'</h3>');
 		  '</h3>');
     }
 }
@@ -449,7 +450,7 @@
               '<input type="submit" value="'.&mt('Publish Directory').'" /></td><td>'.
 '<input type="button" onclick="window.location='."'/~".
                $uname.$thisdisfn."/default.meta'".'" value="'.
-&mt('Edit Directory Catalog Information').'" /></td></tr></table></form>');
+&mt('Edit Directory Metadata').'" /></td></tr></table></form>');
 }
 
 sub resourceactions {
@@ -621,9 +622,17 @@
 	    $meta_same = 0;
 	}
 	$publish_button=&mt('Re-publish');
-	my $rights_status =
-	    &mt(&getCopyRightString($targetdir.'/'.$filename)).' '.
-	    &mt(&getSourceRightString($targetdir.'/'.$filename));
+
+        my $rights_status =
+            &mt(&getCopyRightString($targetdir.'/'.$filename)).', ';
+
+        my %lt_SourceRight = &Apache::lonlocal::texthash(
+               'open'   => 'Source: open',
+               'closed' => 'Source: closed',
+        );
+        $rights_status .=
+            $lt_SourceRight{&getSourceRightString($targetdir.'/'.$filename)};
+
 	$title = '<a href="/res/'.$targetdir.'/'.$filename.
 	    '.meta" target="cat">'.
 	    &getTitleString($targetdir.'/'.$filename).'</a>';