--- loncom/publisher/lonpubdir.pm 2010/02/12 16:04:18 1.114.2.2 +++ loncom/publisher/lonpubdir.pm 2008/11/28 16:10:26 1.115 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Construction Space Directory Lister # -# $Id: lonpubdir.pm,v 1.114.2.2 2010/02/12 16:04:18 raeburn Exp $ +# $Id: lonpubdir.pm,v 1.115 2008/11/28 16:10:26 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -62,7 +62,7 @@ sub handler { &Apache::loncacc::constructaccess( $fn,$r->dir_config('lonDefDomain')); unless (($uname) && ($udom)) { - $r->log_reason($uname.':'.$udom. + $r->log_reason($uname.' at '.$udom. ' trying to list directory '.$env{'form.filename'}. ' ('.$fn.') - not authorized', $r->filename); @@ -74,7 +74,7 @@ sub handler { $fn=~s/\/$//; unless ($fn) { - $r->log_reason($env{'user.name'}.':'.$env{'user.domain'}. + $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}. ' trying to list empty directory', $r->filename); return HTTP_NOT_FOUND; } @@ -106,14 +106,16 @@ sub handler { # Start off the directory table. $r->print('

'.&mt('Directory Contents:').'

'); - $r->print(''. - ''. - ''. - ''. - ''. - ''. - ''."\n"); + $r->print(&Apache::loncommon::start_data_table() + .&Apache::loncommon::start_data_table_header_row() + .'' + .'' + .'' + .'' + .'' + .'' + .&Apache::loncommon::end_data_table_header_row() + ); my $filename; my $dirptr=16384; # Mask indicating a directory in stat.cmode. @@ -139,7 +141,9 @@ sub handler { } closedir(DIR); - $r->print('
'.&mt('Type').''.&mt('Actions').''.&mt('Name').''.&mt('Title').''.&mt('Status').''.&mt('Last Modified'). - '
'.&mt('Type').''.&mt('Actions').''.&mt('Name').''.&mt('Title').''.&mt('Status').''.&mt('Last Modified').'
'.&Apache::loncommon::end_page()); + $r->print(&Apache::loncommon::end_data_table() + .&Apache::loncommon::end_page() + ); return OK; } # @@ -156,8 +160,7 @@ sub getEffectiveUrl { # Replace the ~username of the URL with /home/username/public_html # so that we don't have to worry about ~ expansion internally. # - $fn=~s/^https?\:\/\/[^\/]+\///; - + $fn=~s/^http\:\/\/[^\/]+\///; $fn=~s/^\///; $fn=~s{~($LONCAPA::username_re)}{/home/$1/public_html}; @@ -331,7 +334,8 @@ ENDPUBDIRSCRIPT if ((($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) && $env{'environment.remote'} ne 'off') { - $r->print('

'.&mt('Co-Author [_1]',$uname.':'.$udom).'

'); + $r->print('

'.&mt('Co-Author').': '.$uname.' at '.$udom. + '

'); } } @@ -449,7 +453,7 @@ sub pubbuttons { ''. ''); +&mt('Edit Directory Catalog Information').'" />'); } sub resourceactions { @@ -566,7 +570,7 @@ sub putdirectory { ''.$actionitem.''. ''. $disfilename.''. - ''.($kaputt?&Apache::lonhtmlcommon::authorbombs($resdir.'/'.$disfilename.'/'):'').$Apache::lonpublisher::metadatafields{'title'}); + ''.($kaputt?&Apache::lonhtmlcommon::authorbombs($resdir.'/'.$disfilename.'/'):'').$Apache::lonpublisher::metadatafields{'title'}); if ($Apache::lonpublisher::metadatafields{'subject'} ne '') { $r->print(' '. $Apache::lonpublisher::metadatafields{'subject'}. @@ -621,17 +625,9 @@ sub putresource { $meta_same = 0; } $publish_button=&mt('Re-publish'); - - 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)}; - + my $rights_status = + &mt(&getCopyRightString($targetdir.'/'.$filename)).' '. + &mt(&getSourceRightString($targetdir.'/'.$filename)); $title = ''. &getTitleString($targetdir.'/'.$filename).''; @@ -696,7 +692,7 @@ sub putresource { } my $pub_select = ''; &create_pubselect($r,\$pub_select,$udom,$uname,$thisdisfn,$filename,$resdir,$pubstatus,$publish_button,$numres); - $r->print(''. + $r->print(&Apache::loncommon::start_data_table_row(). ''.($filename=~/[\#\~]$/?' ': '').''. ''.$pub_select.''. @@ -705,9 +701,11 @@ sub putresource { $filename.''.$editlink2.$editlink. ''. ''.$title.''. - ''.$status.''. + '  '. # Display publication status + ''.$status.''. ''.&Apache::lonlocal::locallocaltime($cmtime).''. - "\n"); + &Apache::loncommon::end_data_table_row() + ); return OK; }