version 1.37, 2008/12/19 03:55:25
|
version 1.41, 2009/08/11 15:15:01
|
Line 120 sub phaseone {
|
Line 120 sub phaseone {
|
my ($main,$suffix,$is_meta) = &get_file_info($fn); |
my ($main,$suffix,$is_meta) = &get_file_info($fn); |
|
|
if (-e $resfn) { |
if (-e $resfn) { |
$r->print('<form action="/adm/retrieve" method="POST">'. |
$r->print('<form action="/adm/retrieve" method="post">'. |
'<input type="hidden" name="filename" value="/~'.$uname.$fn.'" />'. |
'<input type="hidden" name="filename" value="/~'.$uname.$fn.'" />'. |
'<input type="hidden" name="phase" value="two" />'. |
'<input type="hidden" name="phase" value="two" />'. |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
Line 152 sub phaseone {
|
Line 152 sub phaseone {
|
my $rmtime=&Apache::lonnet::metadata($resdir.'/'.$filename,'lastrevisiondate'); |
my $rmtime=&Apache::lonnet::metadata($resdir.'/'.$filename,'lastrevisiondate'); |
$r->print(&Apache::loncommon::start_data_table_row(). |
$r->print(&Apache::loncommon::start_data_table_row(). |
'<td><input type="radio" name="version" value="'. |
'<td><input type="radio" name="version" value="'. |
$version.'" /></td><td>'.&mt('Previously published version').' '.$version.'</td><td>'. |
$version.'" /></td><td>'.&mt('Previously published version').' '.$version.'</td>'. |
localtime($rmtime).'</td>'); |
'<td>'.&Apache::lonlocal::locallocaltime($rmtime).'</td>'); |
|
|
if (!$is_meta) { |
if (!$is_meta) { |
$r->print('<td><a href="'.$urldir.$filename.'.meta" target=cat>'. |
$r->print('<td><a href="'.$urldir.$filename.'.meta" target="cat">'. |
&mt('Metadata Version').' '.$version.'</a></td>'); |
&mt('Metadata Version').' '.$version.'</a></td>'); |
} |
} |
if ($is_meta |
if ($is_meta |
Line 175 sub phaseone {
|
Line 175 sub phaseone {
|
my $rmtime=&Apache::lonnet::metadata($resfn,'lastrevisiondate'); |
my $rmtime=&Apache::lonnet::metadata($resfn,'lastrevisiondate'); |
$r->print(&Apache::loncommon::start_data_table_row(). |
$r->print(&Apache::loncommon::start_data_table_row(). |
'<td><input type="radio" name="version" value="new" /></td>'. |
'<td><input type="radio" name="version" value="new" /></td>'. |
'<td><b>'.&mt('Currently published version').'</b></td><td>'.localtime($rmtime). |
'<td><b>'.&mt('Currently published version').'</b></td>'. |
'</td>'); |
'<td>'.&Apache::lonlocal::locallocaltime($rmtime).'</td>' |
|
); |
if (!$is_meta) { |
if (!$is_meta) { |
$r->print('<td><a href="'.$urldir.$main.'.'.$suffix.'.meta" target=cat>'. |
$r->print('<td><a href="'.$urldir.$main.'.'.$suffix.'.meta" target="cat">'. |
&mt('Metadata current version').'</a></td>'); |
&mt('Metadata current version').'</a></td>'); |
} |
} |
if ($is_meta |
if ($is_meta |
Line 198 sub phaseone {
|
Line 199 sub phaseone {
|
&mt('This will only retrieve the resource. If you want to retrieve the metadata, you will need to do that separately.'). |
&mt('This will only retrieve the resource. If you want to retrieve the metadata, you will need to do that separately.'). |
'</span></p>'); |
'</span></p>'); |
} |
} |
$r->print('<input type="submit" value="'.&mt('Retrieve version').'" /></form>'); |
$r->print('<input type="submit" value="'.&mt('Retrieve selected Version').'" /></form>'); |
} else { |
} else { |
$r->print('<p class="LC_warning">'.&mt('No previous versions published.').'</p>'); |
$r->print('<p class="LC_warning">'.&mt('No previous versions published.').'</p>'); |
} |
} |
$r->print('<p><a href="/priv/'.$uname.$fn.'">' |
|
.&mt('Back to [_1]','<span class="LC_filename">'.$fn.'</span>') |
my $dir = &Apache::loncommon::authorspace() |
.'</a></p>'); |
.&File::Basename::dirname($fn) |
|
.'/'; |
|
$r->print(&Apache::lonhtmlcommon::start_funclist() |
|
.&Apache::lonhtmlcommon::add_item_funclist( |
|
'<a href="/priv/'.$uname.$fn.'">' |
|
.&mt('Back to Resource') |
|
.'</a>') |
|
.&Apache::lonhtmlcommon::add_item_funclist( |
|
'<a href="'.$dir.'">' |
|
.&mt('Back to Directory') |
|
.'</a>') |
|
.&Apache::lonhtmlcommon::end_funclist() |
|
); |
} |
} |
|
|
# ---------------------------------- Interface for presenting specified version |
# ---------------------------------- Interface for presenting specified version |
Line 254 sub phasetwo {
|
Line 267 sub phasetwo {
|
} |
} |
$r->print('</p>' |
$r->print('</p>' |
.'<p><a href="/priv/'.$uname.$fn.'">' |
.'<p><a href="/priv/'.$uname.$fn.'">' |
.&mt('Back to [_1]',$fn) |
.&mt('Back to Resource') |
.'</a></p>'); |
.'</a></p>'); |
} else { |
} else { |
$r->print('<p class="LC_info">'.&mt('Please pick a version to retrieve:').'</p>'); |
$r->print('<p class="LC_info">'.&mt('Please pick a version to retrieve:').'</p>'); |
Line 321 sub handler {
|
Line 334 sub handler {
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
|
$r->print(&Apache::loncommon::start_page('Retrieve Published Resources')); |
# Breadcrumbs |
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
|
&Apache::lonhtmlcommon::add_breadcrumb({ |
|
'text' => 'Construction Space', |
|
'href' => &Apache::loncommon::authorspace(), |
|
}); |
|
&Apache::lonhtmlcommon::add_breadcrumb({ |
|
'text' => 'Retrieve previous version', |
|
'href' => '', |
|
}); |
|
|
|
$r->print(&Apache::loncommon::start_page('Retrieve Published Resources') |
|
.&Apache::lonhtmlcommon::breadcrumbs() |
|
.&Apache::loncommon::head_subbox( |
|
&Apache::loncommon::CSTR_pageheader()) # FIXME crumbs broken? |
|
); |
|
|
|
$r->print('<p>' |
$r->print('<h1>' |
|
.&mt('Retrieve previous versions of [_1]' |
.&mt('Retrieve previous versions of [_1]' |
,'<span class="LC_filename">'.$fn.'</span>') |
,'<span class="LC_filename">'.$fn.'</span>') |
.'</h1>'); |
.'</p>'); |
|
|
if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) { |
if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) { |
$r->print('<h3><span class="LC_diff_coauthor">'.&mt('Co-Author').': '.$uname. |
$r->print('<p><span class="LC_warning">' |
&mt(' at ').$udom. |
.&mt('Co-Author [_1]' |
'</span></h3>'); |
,&Apache::loncommon::plainname($uname,$udom) |
|
.' ('.$uname.':'.$udom.')') |
|
.'</span></p>'); |
} |
} |
|
|
|
|