[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonhtmlcommon.pm lonmenu.pm
droeschl
droeschl@source.lon-capa.org
Tue, 10 Nov 2009 13:58:55 -0000
This is a MIME encoded message
--droeschl1257861535
Content-Type: text/plain
droeschl Tue Nov 10 13:58:55 2009 EDT
Modified files:
/loncom/interface loncommon.pm lonhtmlcommon.pm lonmenu.pm
Log:
Changed innerregister menu to a new layout. All options available to students are
listed in the same line as breadcrumbs, advanced options which are only available
to roles such as course coordinators are listed in a seperate menu below.
This is work in progress.
--droeschl1257861535
Content-Type: text/plain
Content-Disposition: attachment; filename="droeschl-20091110135855.txt"
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.912 loncom/interface/loncommon.pm:1.913
--- loncom/interface/loncommon.pm:1.912 Fri Nov 6 16:53:17 2009
+++ loncom/interface/loncommon.pm Tue Nov 10 13:58:55 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.912 2009/11/06 16:53:17 bisitz Exp $
+# $Id: loncommon.pm,v 1.913 2009/11/10 13:58:55 droeschl Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -4885,6 +4885,47 @@
margin: 0;
}
+/* #SD START (work in progress)*/
+
+ul.LC_bct {
+ margin: 0;
+ padding: 0;
+}
+ul.LC_bct ol {
+ display: inline;
+}
+ul.LC_bct ul {
+ display: inline;
+ padding: 0;
+}
+ul.LC_bct li {
+ list-style-type: none;
+ display: inline;
+}
+
+
+ul.LC_breadcrumb_tools {
+}
+
+li.LC_breadcrumb_tools {
+}
+li.LC_breadcrumb_tools img{
+ vertical-align: middle;
+}
+
+.LC_breadcrumb_tools_A {
+ margin: 0 0 0 1em;
+}
+.LC_breadcrumb_tools_B {
+ float: right;
+ margin-top: 0.4em;
+}
+.LC_breadcrumb_tools_C {
+ margin: 0 1em 0 0;
+ float: right;
+}
+/* #SD END */
+
table#LC_title_bar td {
background: $tabbg;
}
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.241 loncom/interface/lonhtmlcommon.pm:1.242
--- loncom/interface/lonhtmlcommon.pm:1.241 Sat Nov 7 17:25:43 2009
+++ loncom/interface/lonhtmlcommon.pm Tue Nov 10 13:58:55 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.241 2009/11/07 17:25:43 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.242 2009/11/10 13:58:55 droeschl Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1342,6 +1342,7 @@
############################################################
{
my @Crumbs;
+ my %tools = ();
sub breadcrumbs {
my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, $CourseBreadcrumbs) = @_;
@@ -1438,8 +1439,12 @@
.$links;
}
+ #SD START (work in progress!)
+ add_tools(\$links);
+ #SD END
$links = htmltag('div', $links,
{ id => "LC_breadcrumbs" }) unless ($CourseBreadcrumbs) ;
+ add_advtools(\$links);
# Return the @Crumbs stack to what we started with
push(@Crumbs,$last);
@@ -1450,11 +1455,58 @@
sub clear_breadcrumbs {
undef(@Crumbs);
+ undef(%tools);
}
sub add_breadcrumb {
push(@Crumbs,@_);
}
+
+
+ #SD START (work in progress!)
+ sub add_breadcrumb_tool {
+ my ($category, $html) = @_;
+ return unless $html;
+ if (!defined(%tools)) {
+ my %tools = ( A => [], B => [], C => []);
+ }
+ push @{$tools{$category}}, $html;
+ }
+
+ sub add_tools {
+ my ($links) = @_;
+ return unless defined %tools;
+ my $html = '<ul class="LC_bct">';
+ for my $category ('A','B') {
+ $html .= '<li class="LC_breadcrumb_tools">'
+ . '<ul class="LC_breadcrumb_tools'
+ . " LC_breadcrumb_tools_$category\">";
+ for my $item (@{$tools{$category}}){
+ #SD ugly! I'll fix that later on
+ $item =~ s/align="(right|left)"//;
+ $item =~ s/<span(.*?)\/span>//;
+ $html .= "<li>$item</li>";
+ }
+ $html .= '</li></ul>';
+ if ($category eq 'A') { $html .= "<li>$$links</li>"; }
+ }
+ $$links = $html.'</ul>';
+ }
+
+ sub add_advtools {
+ my ($links) = @_;
+ return unless (defined $tools{'C'}) and (scalar (@{$tools{'C'}}) > 0);
+ my $html = start_funclist();
+ for my $item (@{$tools{'C'}}){
+ next unless $item;
+ $item =~ s/align="(right|left)"//;
+ $html .= add_item_funclist($item);
+ }
+ $html .= end_funclist();
+ $html = Apache::loncommon::head_subbox($html);
+ $$links .= $html;
+ }
+ #SD END
} # End of scope for @Crumbs
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.300 loncom/interface/lonmenu.pm:1.301
--- loncom/interface/lonmenu.pm:1.300 Wed Nov 4 16:22:24 2009
+++ loncom/interface/lonmenu.pm Tue Nov 10 13:58:55 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.300 2009/11/04 16:22:24 raeburn Exp $
+# $Id: lonmenu.pm,v 1.301 2009/11/10 13:58:55 droeschl Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -567,7 +567,7 @@
&Apache::lonhtmlcommon::clear_breadcrumbs();
&Apache::lonhtmlcommon::add_breadcrumb(@crumbs);
- $breadcrumb .= &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0);
+ #$breadcrumb .= &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0);
unless (($env{'request.state'} eq 'edit') || ($newmail) ||
($env{'request.state'} eq 'construct') ||
($env{'form.register'})) {
@@ -817,51 +817,87 @@
my $addremote=0;
foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} }
my $inlinebuttons='';
- if ($addremote) {
- # Registered, textual output
- if ($env{'environment.icons'} eq 'iconsonly') {
- $inlinebuttons=(<<ENDARROWSINLINE);
-<tr><td>
-$inlineremote[21] $inlineremote[23]
-ENDARROWSINLINE
- if (&hidden_button_check() ne 'yes') {
- $inlinebuttons .= (<<ENDINLINEICONS);
-$inlineremote[61] $inlineremote[63]
-$inlineremote[71] $inlineremote[72] $inlineremote[73]
-$inlineremote[81] $inlineremote[82] $inlineremote[83]
-$inlineremote[91] $inlineremote[92] $inlineremote[93]</td></tr>
-ENDINLINEICONS
- }
- } else {
- if ($inlineremote[21] ne '' || $inlineremote[23] ne '') {
- $inlinebuttons=(<<ENDFIRSTLINE);
-<tr><td>$inlineremote[21]</td><td> </td><td>$inlineremote[23]</td></tr>
-ENDFIRSTLINE
- }
- if (&hidden_button_check() ne 'yes') {
- foreach my $row (6..9) {
- if ($inlineremote[${row}.'1'] ne ''
- || $inlineremote[$row.'2'] ne ''
- || $inlineremote[$row.'3'] ne '') {
- $inlinebuttons .= <<"ENDLINE";
-<tr><td>$inlineremote["${row}1"]</td><td>$inlineremote["${row}2"]</td><td>$inlineremote["${row}3"]</td></tr>
-ENDLINE
- }
- }
- }
- }
- }
+ if ($addremote) {
+
+ #SD START (work in progress!)
+ # Arrows for navigation
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'A', $inlineremote[21] );
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'A', $inlineremote[23] );
+ if(hidden_button_check() ne 'yes'){
+ # notes
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[93]);
+ # bookmark
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[91]);
+ # evaluate
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[81]);
+ # feedback
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[82]);
+ # print
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[83]);
+ # metadata
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[63]);
+
+ # ?
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[61]);
+ # ?
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[71]);
+ # ?
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[72]);
+ # ?
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[73]);
+ # ?
+ Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[92]);
+
+ }
+
+ #SD END
+# # Registered, textual output
+# if ( $env{'environment.icons'} eq 'iconsonly' ) {
+# $inlinebuttons = (<<ENDARROWSINLINE);
+#<tr><td>
+#$inlineremote[21] $inlineremote[23]
+#ENDARROWSINLINE
+# if ( &hidden_button_check() ne 'yes' ) {
+# $inlinebuttons .= (<<ENDINLINEICONS);
+#$inlineremote[61] $inlineremote[63]
+#$inlineremote[71] $inlineremote[72] $inlineremote[73]
+#$inlineremote[81] $inlineremote[82] $inlineremote[83]
+#$inlineremote[91] $inlineremote[92] $inlineremote[93]</td></tr>
+#ENDINLINEICONS
+# }
+# } else { # not iconsonly
+# if ( $inlineremote[21] ne '' || $inlineremote[23] ne '' ) {
+# $inlinebuttons = (<<ENDFIRSTLINE);
+#<tr><td>$inlineremote[21]</td><td> </td><td>$inlineremote[23]</td></tr>
+#ENDFIRSTLINE
+# }
+# if ( &hidden_button_check() ne 'yes' ) {
+# foreach my $row ( 6 .. 9 ) {
+# if ( $inlineremote[ ${row} . '1' ] ne ''
+# || $inlineremote[ $row . '2' ] ne ''
+# || $inlineremote[ $row . '3' ] ne '' )
+# {
+# $inlinebuttons .= <<"ENDLINE";
+#<tr><td>$inlineremote["${row}1"]</td><td>$inlineremote["${row}2"]</td><td>$inlineremote["${row}3"]</td></tr>
+#ENDLINE
+# }
+# }
+# }
+# }
+ }
+ #SD see below
+ $breadcrumb = &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0);
$result =(<<ENDREGTEXT);
<script type="text/javascript">
// BEGIN LON-CAPA Internal
</script>
$timesync
$breadcrumb
-$tablestart
-$inlinebuttons
-$tableend
+<!--$tablestart--!>
+<!--$inlinebuttons--!>
+<!--$tableend --!>
$newmail
-$separator
+<!--$separator--!>
<script type="text/javascript">
// END LON-CAPA Internal
</script>
@@ -1245,7 +1281,7 @@
$inlineremote[$idx]='<a title="'.$desc.'" href="javascript:'.$act.';">'.$pic.'</a>';
} else {
$inlineremote[$idx]=
- '<a class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.
+ '<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.
'<span class="LC_menubuttons_inline_text">'.$desc.'</span></a>';
}
}
--droeschl1257861535--