version 1.61, 2004/11/13 21:17:55
|
version 1.64, 2005/03/23 22:54:18
|
Line 393 sub attemptread {
|
Line 393 sub attemptread {
|
# --------------------------------------------------------- Build up RAT screen |
# --------------------------------------------------------- Build up RAT screen |
sub ratedt { |
sub ratedt { |
my ($r,$url)=@_; |
my ($r,$url)=@_; |
|
my $frameset = '<frameset rows="1,70,*" border="0">'; |
|
if ($ENV{'environment.remote'} eq 'off') { |
|
$frameset = '<frameset rows="1,250,*" border="0">'; |
|
} |
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
|
|
<html> |
<html> |
Line 401 sub ratedt {
|
Line 405 sub ratedt {
|
var flag=0; |
var flag=0; |
</script> |
</script> |
</head> |
</head> |
<frameset rows="1,50,*" border=0> |
$frameset |
<frame name=server src="$url/loadonly/ratserver" noresize noscroll> |
<frame name=server src="$url/loadonly/ratserver" noresize noscroll> |
<frame name=code src="/adm/rat/code.html"> |
<frame name=code src="$url/loadonly/adveditmenu"> |
<frame name=mapout src="/adm/rat/map.html"> |
<frame name=mapout src="/adm/rat/map.html"> |
</frameset> |
</frameset> |
</html> |
</html> |
Line 1145 sub viewmap {
|
Line 1149 sub viewmap {
|
if ($adv) { |
if ($adv) { |
$r->print('<p><b><font color="red">'.&mt('Map contents are not shown in order.').'</font></b></p><br />'); |
$r->print('<p><b><font color="red">'.&mt('Map contents are not shown in order.').'</font></b></p><br />'); |
} |
} |
|
$r->print( '<table border="0" cellspacing="2" cellpadding="4">'. |
|
'<tr bgcolor="#DDDDDD"><th>'.&mt('Type').'</th>'. |
|
'<th>'.&mt('Title in map').'</th>'. |
|
'<th>'.&mt('Filename of resource').'</th>'. |
|
'<th>'.&mt('Link to published resource').'</th>'. |
|
'<th>'.&mt('Link to resource in Construction Space').'</th>'. |
|
'</tr>'); |
|
my @backgroundColors = ("#FFFFFF", "#F6F6F6"); |
foreach (&attemptread(&Apache::lonnet::filelocation('',$url))) { |
foreach (&attemptread(&Apache::lonnet::filelocation('',$url))) { |
if (defined($_)) { |
if (defined($_)) { |
$idx++; |
$idx++; |
my ($title,$url)=split(/\:/,$_); |
my ($title,$url,$cond)=split(/\:/,$_); |
|
if ($cond eq 'cond') { next; } |
$title=~s/\&colon\;/\:/g; |
$title=~s/\&colon\;/\:/g; |
$url=~s/\&colon\;/\:/g; |
$url=~s/\&colon\;/\:/g; |
unless ($title) { $title=(split(/\//,$url))[-1] }; |
unless ($title) { $title=(split(/\//,$url))[-1] }; |
unless ($title) { $title='<i>Empty</i>'; } |
unless ($title) { $title='<i>'.&mt('Empty').'</i>'; } |
|
my $resurl = &Apache::lonratsrv::qtescape($url); |
|
my $resfilepath = $Apache::lonnet::perlvar{'lonDocRoot'}.$resurl; |
|
my $filename; |
|
if ($resurl =~ m#/([^/]+)$#) { |
|
$filename = $1; |
|
} |
|
my $cstrurl = $resurl; |
|
$cstrurl =~ s#^/res/[^/]+/([^/]+)/#/priv/$1/#; |
|
my $bgcol = $idx%2; |
|
$r->print('<tr bgcolor='.$backgroundColors[$bgcol].'><td>'. |
|
'<img src="'.&Apache::loncommon::icon($resfilepath). |
|
'" /></td><td>'.&Apache::lonratsrv::qtescape($title). |
|
'</td><td>'.$filename.'</td><td>'); |
|
if ($url) { |
|
if (-e $resfilepath) { |
|
$r->print('<a href="'.$resurl.'">'.&mt('Resource space').'</a>'); |
|
} else { |
|
$r->print(&mt('unpublished')); |
|
} |
|
} |
|
$r->print('</td><td>'); |
if ($url) { |
if ($url) { |
$r->print('<a href="'.&Apache::lonratsrv::qtescape($url).'">'); |
$r->print('<a href="'.$cstrurl.'">'. |
|
&mt('Construction space').'</a>'); |
} |
} |
$r->print(&Apache::lonratsrv::qtescape($title)); |
$r->print('</td></tr>'."\n"); |
if ($url) { $r->print('</a>'); } |
|
$r->print('<br>'); |
|
} |
} |
} |
} |
|
$r->print('</table>'); |
$r->print('</body></html>'); |
$r->print('</body></html>'); |
} |
} |
|
|