--- loncom/publisher/lonpubdir.pm 2006/04/06 20:52:50 1.89
+++ loncom/publisher/lonpubdir.pm 2006/06/22 20:49:19 1.93
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Construction Space Directory Lister
#
-# $Id: lonpubdir.pm,v 1.89 2006/04/06 20:52:50 albertel Exp $
+# $Id: lonpubdir.pm,v 1.93 2006/06/22 20:49:19 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -36,6 +36,7 @@ use Apache::Constants qw(:common :http :
use Apache::loncacc;
use Apache::loncommon();
use Apache::lonhtmlcommon();
+use Apache::londiff();
use Apache::lonlocal;
use Apache::lonmsg;
use Apache::lonmenu;
@@ -104,13 +105,13 @@ sub handler {
# Start off the directory table.
$r->print('
Directory Contents:
');
- $r->print(''.
- ''.&mt('Type').' | '.
- ''.&mt('Actions').' | '.
- ''.&mt('Name').' | '.
- ''.&mt('Title').' | '.
- ''.&mt('Status').' | '.
- ''.&mt('Last Modified').
+ $r->print(''.
+ ''.&mt('Type').' | '.
+ ''.&mt('Actions').' | '.
+ ''.&mt('Name').' | '.
+ ''.&mt('Title').' | '.
+ ''.&mt('Status').' | '.
+ ''.&mt('Last Modified').
' | '."\n");
my $filename;
@@ -209,10 +210,10 @@ sub startpage {
{'body_title' =>
$pagetitle,}));
} else {
- $r->print(&Apache::loncommon::start_page('Construction Space',undef,
- {'only_body' => 1,}));
+ $r->print(&Apache::loncommon::start_page('Construction Space',undef));
$r->print($pagetitle);
}
+
my $pubdirscript=(<
top.document.title = '$thisdisfn/ - LON-CAPA Construction Space';
@@ -363,14 +364,14 @@ sub dircontrols {
updc => 'Upload a new document'
);
$r->print(<
+
- $lt{'acti'} |
- $lt{'updc'} |
- $lt{'crea'} |
+ $lt{'acti'} |
+ $lt{'updc'} |
+ $lt{'crea'} |
-
+ |
|
-
+ |
|
-
+ |
|
@@ -539,15 +540,19 @@ sub putdirectory {
'';
$$numdir ++;
}
- $r->print(''.
+ $r->print(' '.
' | '.
''.$actionitem.' | '.
- ''.
- $disfilename.' | '.
- ''.($kaputt?&Apache::lonhtmlcommon::authorbombs($resdir.'/'.$disfilename.'/'):'').$Apache::lonpublisher::metadatafields{'title'}.' '.
- $Apache::lonpublisher::metadatafields{'subject'}.' '.
- $Apache::lonpublisher::metadatafields{'keywords'}.' | '.
+ ''.
+ $disfilename.' | '.
+ ''.($kaputt?&Apache::lonhtmlcommon::authorbombs($resdir.'/'.$disfilename.'/'):'').$Apache::lonpublisher::metadatafields{'title'});
+ if ($Apache::lonpublisher::metadatafields{'subject'} ne '') {
+ $r->print(' '.
+ $Apache::lonpublisher::metadatafields{'subject'}.
+ ' ');
+ }
+ $r->print($Apache::lonpublisher::metadatafields{'keywords'}.' | '.
''.&Apache::lonlocal::locallocaltime($modtime).' | '.
" \n");
}
@@ -563,7 +568,7 @@ sub putresource {
&Apache::lonnet::devalidate_cache_new('meta',$targetdir.'/'.$filename);
my $pubstatus = 'unpublished';
my $status=&mt('Unpublished');
- my $bgcolor='#FFAA99';
+ my $css_class='LC_browser_file';
my $title=' ';
my $publish_button=&mt('Publish');
# my $action_buttons=
@@ -571,21 +576,30 @@ sub putresource {
# $uname.'/'.$thisdisfn.'/'.$filename.'">'.
# &mt('Delete').'';
if (-e $resdir.'/'.$filename) {
+ my $same=0;
my ($rdev,$rino,$rmode,$rnlink,
$ruid,$rgid,$rrdev,$rsize,
$ratime,$rmtime,$rctime,
$rblksize,$rblocks)=stat($resdir.'/'.$filename);
+ if ($rmtime>=$cmtime) {
+ $same=1;
+ } else {
+ if (&Apache::londiff::are_different_files($resdir.'/'.$filename,
+ '/home/'.$uname.'/public_html/'.$thisdisfn.'/'.$filename)) {
+ $same=0;
+ } else {
+ $same=1;
+ }
+ }
$publish_button=&mt('Re-publish');
- if ($rmtime>=$cmtime) {
+ if ($same) {
$pubstatus = 'published';
$status=&mt('Published').' '.
&mt(&getCopyRightString($targetdir.'/'.$filename)).' '.
&mt(&getSourceRightString($targetdir.'/'.$filename));
- $bgcolor='#CCFF88';
if (&Apache::lonnet::metadata($targetdir.'/'.$filename,'obsolete')) {
$pubstatus = 'obsolete';
$status=&mt('Obsolete');
- $bgcolor='#AAAAAA';
}
# } else {
# $action_buttons='';
@@ -598,7 +612,6 @@ sub putresource {
$status=&mt('Modified').' '.
&mt(&getCopyRightString($targetdir.'/'.$filename)).' '.
&mt(&getSourceRightString($targetdir.'/'.$filename));
- $bgcolor='#FFFF77';
# $action_buttons='';
$title=''.
&getTitleString($targetdir.'/'.$filename).'';
@@ -632,13 +645,13 @@ sub putresource {
}
my $pub_select = '';
&create_pubselect($r,\$pub_select,$udom,$uname,$thisdisfn,$filename,$resdir,$pubstatus,$publish_button,$numres);
- $r->print(''.
+ $r->print(' '.
''.($filename=~/[\#\~]$/?' ':
'').' | '.
''.$pub_select.' | '.
- ''.
+ ' | '.
''.
- $filename.''.$editlink2.$editlink.
+ $filename.''.$editlink2.$editlink.
' | '.
''.$title.' | '.
''.$status.' | '.
|