version 1.567, 2025/01/03 05:38:17
|
version 1.571, 2025/02/03 19:07:54
|
Line 48 described at http://www.lon-capa.org.
|
Line 48 described at http://www.lon-capa.org.
|
|
|
=head1 OVERVIEW |
=head1 OVERVIEW |
|
|
X<lonnavmaps, overview> When a user enters a course, LON-CAPA examines the |
X<lonnavmaps, overview> |
|
When a user enters a course, LON-CAPA examines the |
course structure and caches it in what is often referred to as the |
course structure and caches it in what is often referred to as the |
"big hash" X<big hash>. You can see it if you are logged into |
"big hash" X<big hash>. You can see it if you are logged into |
LON-CAPA, in a course, by going to /adm/test. The content of |
LON-CAPA, in a course, by going to /adm/test. The content of |
Line 1120 sub render_resource {
|
Line 1121 sub render_resource {
|
} |
} |
|
|
# Decide what to display |
# Decide what to display |
$result .= "$newBranchText$linkopen$icon$linkclose"; |
$result .= "$newBranchText$linkopen$icon"; |
|
|
my $curMarkerBegin = ''; |
my $curMarkerBegin = ''; |
my $curMarkerEnd = ''; |
my $curMarkerEnd = ''; |
Line 1160 sub render_resource {
|
Line 1161 sub render_resource {
|
$linkopen = "<a href=\"$link\">"; |
$linkopen = "<a href=\"$link\">"; |
} |
} |
} |
} |
$result .= "$curMarkerBegin$linkopen$title$partLabel$linkclose$curMarkerEnd$editmapLink$nonLinkedText</td>"; |
$result .= "$curMarkerBegin$title$partLabel$curMarkerEnd$linkclose$editmapLink$nonLinkedText</td>"; |
|
|
return $result; |
return $result; |
} |
} |
Line 1572 sub render {
|
Line 1573 sub render {
|
my $curRes; |
my $curRes; |
my $foundJump = 0; |
my $foundJump = 0; |
my $counter = 0; |
my $counter = 0; |
|
|
while (($curRes = $mapIterator->next()) && !$foundJump) { |
while (($curRes = $mapIterator->next()) && !$foundJump) { |
if (ref($curRes)) { $counter++; } |
if (ref($curRes)) { $counter++; } |
|
# Speed up display after course initialization |
|
# when $jump is empty. Note: we still need |
|
# $counter to be 1 in that case if there is at |
|
# least one resource. |
|
last if (($jump eq '') && ($counter)); |
|
|
if (ref($curRes) && $jump eq $curRes->symb()) { |
if (ref($curRes) && $jump eq $curRes->symb()) { |
|
|
# This is why we have to use the main iterator instead of the |
# This is why we have to use the main iterator instead of the |
Line 1594 sub render {
|
Line 1600 sub render {
|
my $printKey = $args->{'printKey'}; |
my $printKey = $args->{'printKey'}; |
my $printCloseAll = $args->{'printCloseAll'}; |
my $printCloseAll = $args->{'printCloseAll'}; |
if (!defined($printCloseAll)) { $printCloseAll = 1; } |
if (!defined($printCloseAll)) { $printCloseAll = 1; } |
|
|
# Print key? |
# Print key? |
if ($printKey) { |
if ($printKey) { |
$result .= '<table border="0" cellpadding="2" cellspacing="0">'; |
my $location = &Apache::loncommon::lonhttpdurl("/adm/lonMisc"); |
$result.='<tr><td align="right" valign="bottom">Key: </td>'; |
$result .= '<div class="LC_navtools">'."\n". |
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc"); |
'<span class="LC_middle LC_right">'.&mt('Key').':</span>'. |
if ($navmap->{LAST_CHECK}) { |
'<span class="LC_middle LC_center"> '. |
$result .= |
'<img src="'.$location.'/chat.gif" alt="" /> '.&mt('Unread Discussion'). |
'<img src="'.$location.'/chat.gif" alt="" /> '.&mt('New discussion since').' '. |
' '. |
strftime("%A, %b %e at %I:%M %P", localtime($navmap->{LAST_CHECK})). |
'<img src="'.$location.'/feedback.gif" alt="" /> '. |
'</td><td align="center" valign="bottom"> '. |
&mt('New message (click to open)'). |
'<img src="'.$location.'/feedback.gif" alt="" /> '.&mt('New message (click to open)').'<p>'. |
'</span></div>'. |
'</td>'; |
'<div style="padding:0;clear:both;margin:0;border:0"></div>'."\n"; |
} else { |
|
$result .= '<td align="center" valign="bottom"> '. |
|
'<img src="'.$location.'/chat.gif" alt="" /> '.&mt('Discussions').'</td><td align="center" valign="bottom">'. |
|
' <img src="'.$location.'/feedback.gif" alt="" /> '.&mt('New message (click to open)'). |
|
'</td>'; |
|
} |
|
|
|
$result .= '</tr></table>'; |
|
} |
} |
|
|
if ($printCloseAll && !$args->{'resource_no_folder_link'}) { |
if ($printCloseAll && !$args->{'resource_no_folder_link'}) { |
Line 1711 END
|
Line 1709 END
|
$result .= "<br />\n"; |
$result .= "<br />\n"; |
|
|
# Data |
# Data |
$result.=&Apache::loncommon::start_data_table("LC_tableOfContent"); |
if ($counter) { |
|
$result.=&Apache::loncommon::start_data_table("LC_tableOfContent"); |
|
} |
|
|
my $res = "Apache::lonnavmaps::resource"; |
my $res = "Apache::lonnavmaps::resource"; |
my %condenseStatuses = |
my %condenseStatuses = |
Line 2109 END
|
Line 2109 END
|
} |
} |
} |
} |
|
|
$result.=&Apache::loncommon::end_data_table(); |
if ($counter) { |
|
$result.=&Apache::loncommon::end_data_table(); |
|
} |
|
|
# Print out the part that jumps to #curloc if it exists |
# Print out the part that jumps to #curloc if it exists |
# delay needed because the browser is processing the jump before |
# delay needed because the browser is processing the jump before |
Line 2148 sub show_linkitems_toolbar {
|
Line 2150 sub show_linkitems_toolbar {
|
if (ref($args->{'linkitems'}) eq 'HASH') { |
if (ref($args->{'linkitems'}) eq 'HASH') { |
my $numlinks = scalar(keys(%{$args->{'linkitems'}})); |
my $numlinks = scalar(keys(%{$args->{'linkitems'}})); |
if ($numlinks > 1) { |
if ($numlinks > 1) { |
$result = '<td>'. |
$result = '<div class="LC_navtools">'. |
&Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen', |
&Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen', |
undef,'RAT'). |
undef,'RAT'). |
'</td>'. |
'</div><div class="LC_navtools"> '.&mt('Tools:').'</div>'; |
'<td> </td>'. |
|
'<td class="LC_middle">'.&mt('Tools:').'</td>'; |
|
} |
} |
$result .= '<td align="left">'."\n". |
$result .= '<div class="LC_navtools">'."\n". |
'<ul id="LC_toolbar">'; |
'<ul id="LC_toolbar">'; |
my @linkorder = ('firsthomework','everything','uncompleted', |
my @linkorder = ('firsthomework','everything','uncompleted', |
'changefolder','clearbubbles','printout','edittoplevel'); |
'changefolder','clearbubbles','printout','edittoplevel'); |
Line 2183 sub show_linkitems_toolbar {
|
Line 2183 sub show_linkitems_toolbar {
|
} |
} |
} |
} |
$result .= '</ul>'. |
$result .= '</ul>'. |
'</td>'; |
'</div>'; |
if (($numlinks==1) && (exists($args->{'linkitems'}{'edittoplevel'}))) { |
if (($numlinks==1) && (exists($args->{'linkitems'}{'edittoplevel'}))) { |
$result .= '<td><a href="'.$args->{'linkitems'}{'edittoplevel'}{'cmd'}.'">'. |
$result .= '<div class="LC_navtools">'. |
&mt('Content Editor').'</a></td>'; |
' <a href="'.$args->{'linkitems'}{'edittoplevel'}{'cmd'}.'">'. |
|
&mt('Content Editor').'</a></div>'; |
} |
} |
} |
} |
if ($args->{'sort_html'}) { |
if ($args->{'sort_html'}) { |
$result .= '<td> </td><td> </td><td> </td>'. |
$result .= '<div class="LC_navtools"> '. |
'<td align="right">'.$args->{'sort_html'}.'</td>'; |
$args->{'sort_html'}.'</div>'; |
} |
} |
} |
} |
if ($result) { |
if ($result) { |
$result = "<table><tr>$result</tr></table>"; |
$result = '<div class="LC_navtools">'.$result.'</div>'."\n". |
|
'<div style="padding:0;clear:both;margin:0;border:0"></div>'."\n"; |
} |
} |
return $result; |
return $result; |
} |
} |