version 1.382, 2006/05/15 19:29:03
|
version 1.389, 2006/06/29 16:32:14
|
Line 40 use Apache::lonnet;
|
Line 40 use Apache::lonnet;
|
use POSIX qw (floor strftime); |
use POSIX qw (floor strftime); |
use Data::Dumper; # for debugging, not always |
use Data::Dumper; # for debugging, not always |
use Time::HiRes qw( gettimeofday tv_interval ); |
use Time::HiRes qw( gettimeofday tv_interval ); |
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA; |
|
|
# symbolic constants |
# symbolic constants |
sub SYMB { return 1; } |
sub SYMB { return 1; } |
Line 258 MENU
|
Line 260 MENU
|
} |
} |
|
|
# Header |
# Header |
$r->print(&Apache::loncommon::start_page('Navigate Course Contents',$js, |
my $course_type = &Apache::loncommon::course_type(); |
|
$r->print(&Apache::loncommon::start_page('Navigate '.$course_type. |
|
' Contents', |
|
$js, |
{'only_body' => $body_only, |
{'only_body' => $body_only, |
'force_register' => |
'force_register' => |
$env{'form.register'},})); |
$env{'form.register'},})); |
Line 268 MENU
|
Line 273 MENU
|
|
|
# Check that it's defined |
# Check that it's defined |
if (!($navmap->courseMapDefined())) { |
if (!($navmap->courseMapDefined())) { |
$r->print(&Apache::loncommon::help_open_menu('','Navigation Screen','Navigation_Screen','',undef,'RAT')); |
$r->print(&Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',undef,'RAT')); |
$r->print('<font size="+2" color="red">'.&mt('Coursemap undefined.'). |
$r->print('<span class="LC_error">'.&mt('Coursemap undefined.'). |
'</font>' . |
'</span>' . |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |
Line 469 sub getLinkForResource {
|
Line 474 sub getLinkForResource {
|
my $anchor; |
my $anchor; |
if ($res->is_page()) { |
if ($res->is_page()) { |
foreach (@$stack) { if (defined($_)) { $anchor = $_; } } |
foreach (@$stack) { if (defined($_)) { $anchor = $_; } } |
$anchor=&Apache::lonnet::escape($anchor->shown_symb()); |
$anchor=&escape($anchor->shown_symb()); |
return ($res->link(),$res->shown_symb(),$anchor); |
return ($res->link(),$res->shown_symb(),$anchor); |
} |
} |
# in case folder was skipped over as "only sequence" |
# in case folder was skipped over as "only sequence" |
my ($map,$id,$src)=&Apache::lonnet::decode_symb($res->symb()); |
my ($map,$id,$src)=&Apache::lonnet::decode_symb($res->symb()); |
if ($map=~/\.page$/) { |
if ($map=~/\.page$/) { |
my $url=&Apache::lonnet::clutter($map); |
my $url=&Apache::lonnet::clutter($map); |
$anchor=&Apache::lonnet::escape($src->shown_symb()); |
$anchor=&escape($src->shown_symb()); |
return ($url,$res->shown_symb(),$anchor); |
return ($url,$res->shown_symb(),$anchor); |
} |
} |
} |
} |
Line 1091 sub render_resource {
|
Line 1096 sub render_resource {
|
|
|
if ($resource->is_problem()) { |
if ($resource->is_problem()) { |
if ($part eq '0' || $params->{'condensed'}) { |
if ($part eq '0' || $params->{'condensed'}) { |
$icon ='<img src="'.$location.'/problem.gif" alt="'.&mt('Problem').'" border="0" />'; |
$icon = '<img src="'.$location.'/'; |
|
if ($resource->is_task()) { |
|
$icon .= 'task.gif" alt="'.&mt('Task'); |
|
} else { |
|
$icon .= 'problem.gif" alt="'.&mt('Problem'); |
|
} |
|
$icon .='" border="0" />'; |
} else { |
} else { |
$icon = $params->{'indentString'}; |
$icon = $params->{'indentString'}; |
} |
} |
Line 1122 sub render_resource {
|
Line 1133 sub render_resource {
|
removeFromFilter($filter, $mapId); |
removeFromFilter($filter, $mapId); |
$linkopen .= "&condition=" . $it->{CONDITION} . '&hereType=' |
$linkopen .= "&condition=" . $it->{CONDITION} . '&hereType=' |
. $params->{'hereType'} . '&here=' . |
. $params->{'hereType'} . '&here=' . |
&Apache::lonnet::escape($params->{'here'}) . |
&escape($params->{'here'}) . |
'&jump=' . |
'&jump=' . |
&Apache::lonnet::escape($resource->symb()) . |
&escape($resource->symb()) . |
"&folderManip=1\">"; |
"&folderManip=1\">"; |
|
|
} else { |
} else { |
Line 1176 sub render_resource {
|
Line 1187 sub render_resource {
|
!$params->{'condensed'}) { |
!$params->{'condensed'}) { |
my $displaypart=$resource->part_display($part); |
my $displaypart=$resource->part_display($part); |
$partLabel = " (".&mt('Part: [_1]', $displaypart).")"; |
$partLabel = " (".&mt('Part: [_1]', $displaypart).")"; |
if ($link!~/\#/) { $link.='#'.&Apache::lonnet::escape($part); } |
if ($link!~/\#/) { $link.='#'.&escape($part); } |
$title = ""; |
$title = ""; |
} |
} |
|
|
Line 1220 sub render_communication_status {
|
Line 1231 sub render_communication_status {
|
foreach (split(/\,/, $feedback)) { |
foreach (split(/\,/, $feedback)) { |
if ($_) { |
if ($_) { |
$feedbackHTML .= ' <a '.$target.' href="/adm/email?display=' |
$feedbackHTML .= ' <a '.$target.' href="/adm/email?display=' |
. &Apache::lonnet::escape($_) . '">' |
. &escape($_) . '">' |
. '<img src="'.$location.'/feedback.gif" ' |
. '<img src="'.$location.'/feedback.gif" ' |
. 'border="0" /></a>'; |
. 'border="0" /></a>'; |
} |
} |
Line 1235 sub render_communication_status {
|
Line 1246 sub render_communication_status {
|
if ($_) { |
if ($_) { |
$errorcount++; |
$errorcount++; |
$errorHTML .= ' <a '.$target.' href="/adm/email?display=' |
$errorHTML .= ' <a '.$target.' href="/adm/email?display=' |
. &Apache::lonnet::escape($_) . '">' |
. &escape($_) . '">' |
. '<img src="'.$location.'/bomb.gif" ' |
. '<img src="'.$location.'/bomb.gif" ' |
. 'border="0" /></a>'; |
. 'border="0" /></a>'; |
} |
} |
Line 1469 sub render {
|
Line 1480 sub render {
|
$navmap = Apache::lonnavmaps::navmap->new(); |
$navmap = Apache::lonnavmaps::navmap->new(); |
if (!defined($navmap)) { |
if (!defined($navmap)) { |
# no londer in course |
# no londer in course |
return '<font color="red">'.&mt('No course selected').'</font><br /> |
return '<span class="LC_error">'.&mt('No course selected').'</span><br /> |
<a href="/adm/roles">'.&mt('Select a course').'</a><br />'; |
<a href="/adm/roles">'.&mt('Select a course').'</a><br />'; |
} |
} |
} |
} |
Line 1608 sub render {
|
Line 1619 sub render {
|
my ($link,$text); |
my ($link,$text); |
if ($condition) { |
if ($condition) { |
$link='"navmaps?condition=0&filter=&'.$queryString. |
$link='"navmaps?condition=0&filter=&'.$queryString. |
'&here='.&Apache::lonnet::escape($here).'"'; |
'&here='.&escape($here).'"'; |
$text='Close all folders'; |
$text='Close all folders'; |
} else { |
} else { |
$link='"navmaps?condition=1&filter=&'.$queryString. |
$link='"navmaps?condition=1&filter=&'.$queryString. |
'&here='.&Apache::lonnet::escape($here).'"'; |
'&here='.&escape($here).'"'; |
$text='Open all folders'; |
$text='Open all folders'; |
} |
} |
if ($args->{'caller'} eq 'navmapsdisplay') { |
if ($args->{'caller'} eq 'navmapsdisplay') { |
Line 1658 END
|
Line 1669 END
|
|
|
if ($args->{'caller'} eq 'navmapsdisplay') { |
if ($args->{'caller'} eq 'navmapsdisplay') { |
$result .= '<table><tr><td>'. |
$result .= '<table><tr><td>'. |
&Apache::loncommon::help_open_menu('','Navigation Screen','Navigation_Screen','',undef,'RAT').'</td>'; |
&Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',undef,'RAT').'</td>'; |
if ($env{'environment.remotenavmap'} ne 'on') { |
if ($env{'environment.remotenavmap'} ne 'on') { |
$result .= '<td> </td>'; |
$result .= '<td> </td>'; |
} else { |
} else { |
Line 1923 END
|
Line 1934 END
|
my $srcHasQuestion = $src =~ /\?/; |
my $srcHasQuestion = $src =~ /\?/; |
$args->{"resourceLink"} = $src. |
$args->{"resourceLink"} = $src. |
($srcHasQuestion?'&':'?') . |
($srcHasQuestion?'&':'?') . |
'symb=' . &Apache::lonnet::escape($symb).$anchor; |
'symb=' . &escape($symb).$anchor; |
} |
} |
# Now, we've decided what parts to show. Loop through them and |
# Now, we've decided what parts to show. Loop through them and |
# show them. |
# show them. |
Line 2228 sub generate_email_discuss_status {
|
Line 2239 sub generate_email_discuss_status {
|
foreach my $msgid (@keys) { |
foreach my $msgid (@keys) { |
if ((!$emailstatus{$msgid}) || ($emailstatus{$msgid} eq 'new')) { |
if ((!$emailstatus{$msgid}) || ($emailstatus{$msgid} eq 'new')) { |
my $plain= |
my $plain= |
&Apache::lonnet::unescape(&Apache::lonnet::unescape($msgid)); |
&LONCAPA::unescape(&LONCAPA::unescape($msgid)); |
if ($plain=~/ \[([^\]]+)\]\:/) { |
if ($plain=~/ \[([^\]]+)\]\:/) { |
my $url=$1; |
my $url=$1; |
if ($plain=~/\:Error \[/) { |
if ($plain=~/\:Error \[/) { |
Line 2574 sub parmval_real {
|
Line 2585 sub parmval_real {
|
my $result=''; |
my $result=''; |
|
|
my ($mapname,$id,$fn)=&Apache::lonnet::decode_symb($symb); |
my ($mapname,$id,$fn)=&Apache::lonnet::decode_symb($symb); |
|
$mapname = &Apache::lonnet::deversion($mapname); |
# ----------------------------------------------------- Cascading lookup scheme |
# ----------------------------------------------------- Cascading lookup scheme |
my $rwhat=$what; |
my $rwhat=$what; |
$what=~s/^parameter\_//; |
$what=~s/^parameter\_//; |
Line 4164 email data was not extracted when the na
|
Line 4175 email data was not extracted when the na
|
used like this: |
used like this: |
|
|
for (split(/\,/, $res->getFeedback())) { |
for (split(/\,/, $res->getFeedback())) { |
my $link = &Apache::lonnet::escape($_); |
my $link = &escape($_); |
... |
... |
|
|
and use the link as appropriate. |
and use the link as appropriate. |