[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonnavmaps.pm
droeschl
droeschl@source.lon-capa.org
Tue, 24 Feb 2009 20:10:31 -0000
This is a MIME encoded message
--droeschl1235506231
Content-Type: text/plain
droeschl Tue Feb 24 20:10:31 2009 EDT
Modified files:
/loncom/interface loncommon.pm lonnavmaps.pm
Log:
Changes related to new layout of table of contents.
New icons for MIME-types will follow asap.
--droeschl1235506231
Content-Type: text/plain
Content-Disposition: attachment; filename="droeschl-20090224201031.txt"
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.752 loncom/interface/loncommon.pm:1.753
--- loncom/interface/loncommon.pm:1.752 Sun Feb 22 18:30:27 2009
+++ loncom/interface/loncommon.pm Tue Feb 24 20:10:30 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.752 2009/02/22 18:30:27 harmsja Exp $
+# $Id: loncommon.pm,v 1.753 2009/02/24 20:10:30 droeschl Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2810,7 +2810,8 @@
return;
}
return '<a href="/adm/'.$domain.'/'.$username.'/aboutme"'.
- ($target?' target="$target"':'').' title="'.&mt("View this user's personal information page").'">'.$link.'</a>';
+ ($target?' target="$target"':'').' title="'.&mt("View this user's personal
+homepage").'">'.$link.'</a>';
}
# ------------------------------------------------------------ Syllabus Wrapper
@@ -4525,7 +4526,7 @@
/* just for tests */
.LC_300Box { width:300px; }
-.LC_400Box {width:400px; }
+.LC_200Box {width:200px; }
.LC_500Box {width:500px; }
.LC_600Box {width:600px; }
.LC_800Box {width:800px;}
@@ -5819,6 +5820,11 @@
margin: 10px 20px 10px 0px;
overflow:hidden;
}
+div.LC_columnSection > .LC_ContentBox,
+div.LC_columnSection > .LC_ContentBoxSpecial
+ {
+ width: 400px;
+}
.ContentBoxSpecialTemplate
{
@@ -5832,7 +5838,9 @@
div.LC_columnSection > .ContentBoxSpecialTemplate
{
width: 600px;
+
}
+
.clear{
clear: both;
line-height: 0px;
@@ -5891,6 +5899,28 @@
font-style:normal;
}
+table#LC_tableOfContent{
+ border-collapse: collapse;
+ border-spacing:0;
+ padding:3px;
+ border:0;
+ background-color:#ffffff;
+ font-size:90%;
+}
+table#LC_tableOfContent a {
+ text-decoration: none;
+}
+
+table#LC_tableOfContent tr.LC_trOdd{
+ background-color:#eeeeee;
+}
+
+table#LC_tableOfContent img{
+ border: none;
+ height: 1.3em;
+ vertical-align: text-bottom;
+ margin-right: 0.3em;
+}
END
}
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.425 loncom/interface/lonnavmaps.pm:1.426
--- loncom/interface/lonnavmaps.pm:1.425 Sat Feb 14 14:39:31 2009
+++ loncom/interface/lonnavmaps.pm Tue Feb 24 20:10:30 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.425 2009/02/14 14:39:31 schulted Exp $
+# $Id: lonnavmaps.pm,v 1.426 2009/02/24 20:10:30 droeschl Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -865,34 +865,32 @@
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons");
# If this is a new branch, label it so
if ($params->{'isNewBranch'}) {
- $newBranchText = "<img src='$location/branch.gif' border='0' alt='Branch' />";
+ $newBranchText = "<img src='$location/branch.gif' alt='Branch' />";
}
# links to open and close the folder
-
- my $linkopen = "<a href=\"$link\">";
-
-
+ my $whitespaceLocation = &Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace_21_21.gif");
+ my $linkopen = "<img src='$whitespaceLocation' alt='' />"."<a href=\"$link\">";
my $linkclose = "</a>";
# Default icon: unknown page
- my $icon = "<img src='$location/unknown.gif' alt='' border='0' alt=' ' ' />";
+ my $icon = "<img class=\"LC_contentImage\" src='$location/unknown.gif' alt='' />";
if ($resource->is_problem()) {
if ($part eq '0' || $params->{'condensed'}) {
- $icon = '<img src="'.$location.'/';
+ $icon = '<img class="LC_contentImage" src="'.$location.'/';
if ($resource->is_task()) {
$icon .= 'task.gif" alt="'.&mt('Task');
} else {
$icon .= 'problem.gif" alt="'.&mt('Problem');
}
- $icon .='" border="0" />';
+ $icon .='" />';
} else {
$icon = $params->{'indentString'};
}
} else {
- $icon = "<img src='".&Apache::loncommon::icon($resource->src)."' alt=' ' border='0' />";
+ $icon = "<img class=\"LC_contentImage\" src='".&Apache::loncommon::icon($resource->src)."' alt='' />";
}
# Display the correct map icon to open or shut map
@@ -902,15 +900,15 @@
if ($it->{CONDITION}) {
$nowOpen = !$nowOpen;
}
-
+
my $folderType = $resource->is_sequence() ? 'folder' : 'page';
my $title=$resource->title;
- $title=~s/\"/\"/g;
+ $title=~s/\"/\&qout;/g;
if (!$params->{'resource_no_folder_link'}) {
$icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') . '.gif';
- $icon = "<img src='$location/$icon' alt=\"".
- ($nowOpen ? &mt('Open Folder') : &mt('Close Folder')).' '.$title."\" border='0' />";
-
+ $icon = "<img src='$location/arrow." . ($nowOpen ? 'closed' : 'open') . ".gif' alt='' />"
+ ."<img class=\"LC_contentImage\" src='$location/$icon' alt=\""
+ .($nowOpen ? &mt('Open Folder') : &mt('Close Folder')).' '.$title."\" />";
$linkopen = "<a href=\"" . $params->{'url'} . '?' .
$params->{'queryString'} . '&filter=';
$linkopen .= ($nowOpen xor $it->{CONDITION}) ?
@@ -925,10 +923,8 @@
} else {
# Don't allow users to manipulate folder
- $icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') .
- '.nomanip.gif';
- $icon = "<img src='$location/$icon' alt=\"".
- ($nowOpen ? &mt('Open Folder') : &mt('Close Folder')).' '.$title."\" border='0' />";
+ $icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') . '.gif';
+ $icon = "<img class=\"LC_space\" src='$whitespaceLocation' alt='' />"."<img class=\"LC_contentImage\" src='$location/$icon' alt=\"".($nowOpen ? &mt('Open Folder') : &mt('Close Folder')).' '.$title."\" />";
$linkopen = "";
$linkclose = "";
@@ -944,10 +940,11 @@
if (($resource->is_practice()) && ($resource->is_raw_problem())) {
$nonLinkedText .=' <font color="green"><b>'.&mt('not graded').'</b></font>';
}
-
- # We're done preparing and finally ready to start the rendering
- my $result = "<td align='left' valign='middle'>";
+ # We're done preparing and finally ready to start the rendering
+ my $result = '<td class="LC_middle">';
+ my $newfolderType = $resource->is_sequence() ? 'folder' : 'page';
+
my $indentLevel = $params->{'indentLevel'};
if ($newBranchText) { $indentLevel--; }
@@ -957,7 +954,6 @@
}
# Decide what to display
-
$result .= "$newBranchText$linkopen$icon$linkclose";
my $curMarkerBegin = '';
@@ -988,9 +984,9 @@
$target=' target="loncapaclient" ';
}
if (!$params->{'resource_nolink'} && !$resource->is_sequence() && !$resource->is_empty_sequence) {
- $result .= " $curMarkerBegin<a $target href=\"$link\">$title$partLabel</a>$curMarkerEnd $nonLinkedText</td>";
+ $result .= "$curMarkerBegin<a $target href=\"$link\">$title$partLabel</a>$curMarkerEnd$nonLinkedText</td>";
} else {
- $result .= " $curMarkerBegin$title$partLabel$curMarkerEnd $nonLinkedText</td>";
+ $result .= "$curMarkerBegin$linkopen$title$partLabel</a>$curMarkerEnd$nonLinkedText</td>";
}
return $result;
@@ -1010,7 +1006,7 @@
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc");
if ($resource->hasDiscussion()) {
$discussionHTML = $linkopen .
- '<img alt="'.&mt('New Discussion').'" border="0" src="'.$location.'/chat.gif" />' .
+ '<img alt="'.&mt('New Discussion').'" src="'.$location.'/chat.gif" />' .
$linkclose;
}
@@ -1020,8 +1016,7 @@
if ($msgid) {
$feedbackHTML .= ' <a '.$target.' href="/adm/email?display='
. &escape($msgid) . '">'
- . '<img alt="'.&mt('New E-mail').'" src="'.$location.'/feedback.gif" '
- . 'border="0" /></a>';
+ . '<img alt="'.&mt('New E-mail').'" src="'.$location.'/feedback.gif" /></a>';
}
}
}
@@ -1035,8 +1030,7 @@
$errorcount++;
$errorHTML .= ' <a '.$target.' href="/adm/email?display='
. &escape($msgid) . '">'
- . '<img alt="'.&mt('New Error').'" src="'.$location.'/bomb.gif" '
- . 'border="0" /></a>';
+ . '<img alt="'.&mt('New Error').'" src="'.$location.'/bomb.gif" /></a>';
}
}
}
@@ -1044,8 +1038,7 @@
if ($params->{'multipart'} && $part != '0') {
$discussionHTML = $feedbackHTML = $errorHTML = '';
}
-
- return "<td width=\"75\" align=\"left\" valign=\"middle\">$discussionHTML$feedbackHTML$errorHTML </td>";
+ return "<td class=\"LC_middle\">$discussionHTML$feedbackHTML$errorHTML </td>";
}
sub render_quick_status {
@@ -1061,28 +1054,28 @@
}
my $linkopen = "<a $target href=\"$link\">";
my $linkclose = "</a>";
-
+
+ $result .= '<td class="LC_middle">';
if ($resource->is_problem() &&
!$firstDisplayed) {
-
my $icon = $statusIconMap{$resource->simpleStatus($part)};
my $alt = $iconAltTags{$icon};
if ($icon) {
my $location=
&Apache::loncommon::lonhttpdurl("/adm/lonIcons/$icon");
- $result .= "<td valign='middle' width='50' align='right'>$linkopen<img width='25' height='25' src='$location' border='0' alt='$alt' />$linkclose</td>\n";
+ $result .= "$linkopen<img src='$location' alt='$alt' />$linkclose";
} else {
- $result .= "<td width='30'> </td>\n";
+ $result .= " ";
}
} else { # not problem, no icon
- $result .= "<td width='30'> </td>\n";
+ $result .= " ";
}
-
+ $result .= "</td>\n";
return $result;
}
sub render_long_status {
my ($resource, $part, $params) = @_;
- my $result = "<td align='right' valign='middle'>\n";
+ my $result = '<td class="LC_middle LC_right">';
my $firstDisplayed = !$params->{'condensed'} &&
$params->{'multipart'} && $part eq "0";
@@ -1497,22 +1490,23 @@
$result .= "<br />\n";
# Data
- $result .= '<table cellspacing="0" cellpadding="3" border="0" bgcolor="#FFFFFF">' ."\n";
+ $result .= '<table id="LC_tableOfContent">' ."\n";
+
my $res = "Apache::lonnavmaps::resource";
my %condenseStatuses =
( $res->NETWORK_FAILURE => 1,
$res->NOTHING_SET => 1,
$res->CORRECT => 1 );
- my @backgroundColors = ("#FFFFFF", "#F6F6F6");
+ my @backgroundColors = ("LC_trEven", "LC_trOdd");
# Shared variables
$args->{'counter'} = 0; # counts the rows
$args->{'indentLevel'} = 0;
$args->{'isNewBranch'} = 0;
- $args->{'condensed'} = 0;
- my $location=
- &Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace1.gif");
- $args->{'indentString'} = setDefault($args->{'indentString'}, "<img src='$location' width='25' height='1' alt=' ' border='0' />");
+ $args->{'condensed'} = 0;
+
+ my $location = &Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace_21_21.gif");
+ $args->{'indentString'} = setDefault($args->{'indentString'}, "<img src='$location' alt='' />");
$args->{'displayedHereMarker'} = 0;
# If we're suppressing empty sequences, look for them here. Use DFS for speed,
@@ -1740,7 +1734,7 @@
$rownum ++;
my $backgroundColor = $backgroundColors[$rownum % scalar(@backgroundColors)];
- $result .= " <tr bgcolor='$backgroundColor'>\n";
+ $result .= " <tr class='$backgroundColor'>\n";
# Set up some data about the parts that the cols might want
my $filter = $it->{FILTER};
@@ -3746,7 +3740,7 @@
sub is_sequence {
my $self=shift;
return $self->navHash("is_map_", 1) &&
- $self->navHash("map_type_" . $self->map_pc()) eq 'sequence';
+ $self->navHash("map_type_" . $self->map_pc()) eq 'sequence';
}
sub is_survey {
my $self = shift();
--droeschl1235506231--