version 1.334, 2005/07/15 05:20:37
|
version 1.339, 2005/09/23 22:18:26
|
Line 90 my %colormap =
|
Line 90 my %colormap =
|
my $hurryUpColor = "#FF0000"; |
my $hurryUpColor = "#FF0000"; |
|
|
sub launch_win { |
sub launch_win { |
my ($mode,$script,$toplinkitems)=@_; |
my ($mode,$script,$toplinkitems,$firsttime)=@_; |
my $result; |
my $result; |
if ($script ne 'no') { |
if ($script ne 'no') { |
$result.='<script type="text/javascript">'; |
$result.='<script type="text/javascript">'; |
} |
} |
$result.='function launch_navmapwin() { |
if ($firsttime) { |
|
$result.='function launch_navmapwin() { |
|
newWindow=open(\'/adm/navmaps?launchExternalRoles\',\'loncapanav\',\'width=400,height=600,scrollbars=1\'); |
|
}'; |
|
} else { |
|
$result.='function launch_navmapwin() { |
newWindow=open(\'/adm/navmaps?launchExternal\',\'loncapanav\',\'width=400,height=600,scrollbars=1\'); |
newWindow=open(\'/adm/navmaps?launchExternal\',\'loncapanav\',\'width=400,height=600,scrollbars=1\'); |
}'; |
}'; |
|
} |
if ($mode eq 'now') { |
if ($mode eq 'now') { |
$result.="\nlaunch_navmapwin();\n"; |
$result.="\nlaunch_navmapwin();\n"; |
} |
} |
Line 205 MENU
|
Line 211 MENU
|
ENDSUBM |
ENDSUBM |
return; |
return; |
} |
} |
if ($ENV{QUERY_STRING} eq 'launchExternal') { |
if ($ENV{QUERY_STRING} =~ /^launchExternal/) { |
&Apache::lonnet::put('environment',{'remotenavmap' => 'on'}); |
&Apache::lonnet::put('environment',{'remotenavmap' => 'on'}); |
&Apache::lonnet::appenv('environment.remotenavmap' => 'on'); |
&Apache::lonnet::appenv('environment.remotenavmap' => 'on'); |
|
my $menu=&Apache::lonmenu::reopenmenu(); |
|
my $navstatus=&Apache::lonmenu::get_nav_status(); |
|
if ($menu) { |
|
$r->print(<<MENU); |
|
<script type="text/javascript"> |
|
swmenu=$menu |
|
swmenu.clearTimeout(swmenu.menucltim); |
|
$navstatus |
|
</script> |
|
MENU |
|
} |
|
} |
|
if ($ENV{QUERY_STRING} eq 'turningOffExternal') { |
|
$env{'environment.remotenavmap'}='off'; |
} |
} |
|
|
# Create the nav map |
# Create the nav map |
Line 290 ENDSUBM
|
Line 310 ENDSUBM
|
|
|
if ($ENV{QUERY_STRING} eq 'launchExternal') { |
if ($ENV{QUERY_STRING} eq 'launchExternal') { |
$r->print(' |
$r->print(' |
<form name="returnwin" action="/adm/flip?postdata=return%3a" |
<form name="returnwin" action="/adm/flip?postdata=navlaunch%3a" |
method="post" target="loncapaclient"> |
method="post" target="loncapaclient"> |
</form>'); |
</form>'); |
$r->print(' |
$r->print(' |
Line 1164 sub render_communication_status {
|
Line 1184 sub render_communication_status {
|
my $discussionHTML = ""; my $feedbackHTML = ""; my $errorHTML = ""; |
my $discussionHTML = ""; my $feedbackHTML = ""; my $errorHTML = ""; |
|
|
my $link = $params->{"resourceLink"}; |
my $link = $params->{"resourceLink"}; |
my $linkopen = "<a href='$link'>"; |
my $target; |
|
if ($env{'environment.remotenavmap'} eq 'on') { |
|
$target=' target="loncapaclient" '; |
|
} |
|
my $linkopen = "<a $target href='$link'>"; |
my $linkclose = "</a>"; |
my $linkclose = "</a>"; |
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc"); |
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc"); |
if ($resource->hasDiscussion()) { |
if ($resource->hasDiscussion()) { |
Line 1177 sub render_communication_status {
|
Line 1201 sub render_communication_status {
|
my $feedback = $resource->getFeedback(); |
my $feedback = $resource->getFeedback(); |
foreach (split(/\,/, $feedback)) { |
foreach (split(/\,/, $feedback)) { |
if ($_) { |
if ($_) { |
$feedbackHTML .= ' <a href="/adm/email?display=' |
$feedbackHTML .= ' <a '.$target.' href="/adm/email?display=' |
. &Apache::lonnet::escape($_) . '">' |
. &Apache::lonnet::escape($_) . '">' |
. '<img src="'.$location.'/feedback.gif" ' |
. '<img src="'.$location.'/feedback.gif" ' |
. 'border="0" /></a>'; |
. 'border="0" /></a>'; |
Line 1192 sub render_communication_status {
|
Line 1216 sub render_communication_status {
|
last if ($errorcount>=10); # Only output 10 bombs maximum |
last if ($errorcount>=10); # Only output 10 bombs maximum |
if ($_) { |
if ($_) { |
$errorcount++; |
$errorcount++; |
$errorHTML .= ' <a href="/adm/email?display=' |
$errorHTML .= ' <a '.$target.' href="/adm/email?display=' |
. &Apache::lonnet::escape($_) . '">' |
. &Apache::lonnet::escape($_) . '">' |
. '<img src="'.$location.'/bomb.gif" ' |
. '<img src="'.$location.'/bomb.gif" ' |
. 'border="0" /></a>'; |
. 'border="0" /></a>'; |
Line 1214 sub render_quick_status {
|
Line 1238 sub render_quick_status {
|
$params->{'multipart'} && $part eq "0"; |
$params->{'multipart'} && $part eq "0"; |
|
|
my $link = $params->{"resourceLink"}; |
my $link = $params->{"resourceLink"}; |
my $linkopen = "<a href='$link'>"; |
my $target; |
|
if ($env{'environment.remotenavmap'} eq 'on') { |
|
$target=' target="loncapaclient" '; |
|
} |
|
my $linkopen = "<a $target href='$link'>"; |
my $linkclose = "</a>"; |
my $linkclose = "</a>"; |
|
|
if ($resource->is_problem() && |
if ($resource->is_problem() && |
Line 1373 sub render {
|
Line 1401 sub render {
|
# no columns, no nav maps. |
# no columns, no nav maps. |
return ''; |
return ''; |
} |
} |
my $mustCloseNavMap = 0; |
|
my $navmap; |
my $navmap; |
if (defined($args->{'navmap'})) { |
if (defined($args->{'navmap'})) { |
$navmap = $args->{'navmap'}; |
$navmap = $args->{'navmap'}; |
Line 1422 sub render {
|
Line 1449 sub render {
|
# Step 1: Check to see if we have a navmap |
# Step 1: Check to see if we have a navmap |
if (!defined($navmap)) { |
if (!defined($navmap)) { |
$navmap = Apache::lonnavmaps::navmap->new(); |
$navmap = Apache::lonnavmaps::navmap->new(); |
$mustCloseNavMap = 1; |
|
} |
} |
|
|
# Step two: Locate what kind of here marker is necessary |
# Step two: Locate what kind of here marker is necessary |
Line 1487 sub render {
|
Line 1513 sub render {
|
# Step 1: Check to see if we have a navmap |
# Step 1: Check to see if we have a navmap |
if (!defined($navmap)) { |
if (!defined($navmap)) { |
$navmap = Apache::lonnavmaps::navmap->new(); |
$navmap = Apache::lonnavmaps::navmap->new(); |
$mustCloseNavMap = 1; |
|
} |
} |
|
|
# See if we're being passed a specific map |
# See if we're being passed a specific map |
Line 3611 sub is_page {
|
Line 3636 sub is_page {
|
sub is_problem { |
sub is_problem { |
my $self=shift; |
my $self=shift; |
my $src = $self->src(); |
my $src = $self->src(); |
return ($src =~ /\.(problem|exam|quiz|assess|survey|form|library)$/) |
return ($src =~ /\.(problem|exam|quiz|assess|survey|form|library|task)$/) |
} |
} |
sub contains_problem { |
sub contains_problem { |
my $self=shift; |
my $self=shift; |
Line 4115 sub extractParts {
|
Line 4140 sub extractParts {
|
return; |
return; |
} |
} |
foreach (split(/\,/,$metadata)) { |
foreach (split(/\,/,$metadata)) { |
if ($_ =~ /^part_(.*)$/) { |
if ($_ =~ /^(?:part|Task)_(.*)$/) { |
my $part = $1; |
my $part = $1; |
# This floods the logs if it blows up |
# This floods the logs if it blows up |
if (defined($parts{$part})) { |
if (defined($parts{$part})) { |