--- loncom/publisher/lonpubdir.pm 2006/06/26 22:47:27 1.94
+++ loncom/publisher/lonpubdir.pm 2006/11/22 20:16:16 1.96
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Construction Space Directory Lister
#
-# $Id: lonpubdir.pm,v 1.94 2006/06/26 22:47:27 albertel Exp $
+# $Id: lonpubdir.pm,v 1.96 2006/11/22 20:16:16 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -309,7 +309,8 @@ parent.lastknownpriv='/~$uname$thisdisfn
return
}
function changename(theform,activity) {
- var newname=prompt('New Name');
+ var oldname=theform.dispfilename.value;
+ var newname=prompt('New Name',oldname);
if (newname == "" || !newname) {
return
}
@@ -571,6 +572,7 @@ sub putresource {
my $css_class='LC_browser_file';
my $title=' ';
my $publish_button=&mt('Publish');
+ my $cstr_dir = '/home/'.$uname.'/public_html/'.$thisdisfn.'/';
# my $action_buttons=
# '
'.
@@ -585,44 +587,67 @@ sub putresource {
$same=1;
} else {
if (&Apache::londiff::are_different_files($resdir.'/'.$filename,
- '/home/'.$uname.'/public_html/'.$thisdisfn.'/'.$filename)) {
+ $cstr_dir.'/'.$filename)) {
$same=0;
} else {
$same=1;
}
}
+ my $meta_cmtime = (stat($cstr_dir.'/'.$filename.'.meta'))[9];
+ my $meta_rmtime = (stat($resdir.'/'.$filename.'.meta'))[9];
+ my $meta_same = 1;
+ if ($meta_rmtime < $meta_cmtime
+ && &Apache::londiff::are_different_files($resdir.'/'.$filename.'.meta',
+ $cstr_dir.'/'.$filename.'.meta')) {
+ $meta_same = 0;
+ }
$publish_button=&mt('Re-publish');
+ my $rights_status =
+ &mt(&getCopyRightString($targetdir.'/'.$filename)).' '.
+ &mt(&getSourceRightString($targetdir.'/'.$filename));
+ $title = ''.
+ &getTitleString($targetdir.'/'.$filename).'';
+ &Apache::lonnet::logthis("same $same meta $meta_same");
if ($same) {
- $pubstatus = 'published';
- $status=&mt('Published').'
'.
- &mt(&getCopyRightString($targetdir.'/'.$filename)).' '.
- &mt(&getSourceRightString($targetdir.'/'.$filename));
if (&Apache::lonnet::metadata($targetdir.'/'.$filename,'obsolete')) {
$pubstatus = 'obsolete';
$status=&mt('Obsolete');
- }
+ } else {
+ if (!$meta_same) {
+ $pubstatus = 'metamodified';
+ } else {
+ $pubstatus = 'published';
+ }
+ $status=&mt('Published').
+ '
'. $rights_status;
+ }
# } else {
# $action_buttons='';
# }
- $title=''.
- &getTitleString($targetdir.'/'.$filename).'';
} else {
$pubstatus = 'modified';
- $status=&mt('Modified').'
'.
- &mt(&getCopyRightString($targetdir.'/'.$filename)).' '.
- &mt(&getSourceRightString($targetdir.'/'.$filename));
+ $status=&mt('Modified').
+ '
'. $rights_status;
# $action_buttons='';
- $title=''.
- &getTitleString($targetdir.'/'.$filename).'';
if (&Apache::loncommon::fileembstyle(($filename=~/\.(\w+)$/)) eq 'ssi') {
$status.='
'.&mt('Diffs').'';
}
- }
+ }
+
$title.="\n".'
'.
($$bombs{$targetdir.'/'.$filename}?'':'Edit Metadata').'';
+
+ if (!$meta_same) {
+ $title = &mt('Metadata Modified').'
'.$title.
+ '
'.&mt('Metadata Diffs').'';
+ $title.="\n".'
'.&mt('Retrieve Metadata').'';
+ }
$status.="\n".'
'.&mt('Retrieve').'';
}
@@ -688,7 +713,9 @@ sub create_pubselect {
''.
'
';
+ &HTML::Entities::encode($uname.$thisdisfn.'/'.$filename,'<>&"').'" />
+ ';
$$numres ++;
}