Index: openacs-4/packages/theme-selva/tcl/selva-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/theme-selva/tcl/selva-procs.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/theme-selva/tcl/selva-procs.tcl 1 Aug 2005 05:04:45 -0000 1.3
+++ openacs-4/packages/theme-selva/tcl/selva-procs.tcl 18 Sep 2005 11:44:51 -0000 1.4
@@ -28,7 +28,33 @@
namespace eval selva {
- ad_proc -public portal_navbar {
+ ad_proc -public portal_navbar {
+
+ } {
+ A helper procedure that generates the Subnavbar (above the portal navbar, ie the tabs)
+ for dotlrn. It is called from the selva-master template.
+ } {
+ set current_url [ad_conn url]
+
+ set subnavbar "
"
+
+ foreach {url name } [parameter::get_from_package_key -package_key "theme-selva" -parameter "AdditionalSubnavbarTabs" -default ""] {
+
+ # if url is /dotlrn or /dotlrn/index we highlight the "Home" tab, otherwise we highlight the tab with the current_url, if there is one, i.e. we are not in a community
+ if { $url == $current_url || ($url == "/dotlrn/" && $current_url == "/dotlrn/index")} {
+ append subnavbar "\n- "
+ #if {$picture != "null" } { append subnavbar "
" }
+ append subnavbar "[_ $name] "
+ } else {
+ append subnavbar "\n- [_ $name]
"
+ }
+
+ }
+
+ append subnavbar "\n
"
+ }
+
+ ad_proc -public portal_subnavbar {
{-user_id:required}
{-link_control_panel:required}
{-control_panel_text:required}
@@ -114,34 +140,25 @@
#page_num will be empty_string for special pages like
#My Space and Control Panel
regsub -all {[^0-9]} $page_num {} page_num
+
set navbar "\n"
db_foreach list_page_nums_select {} {
- if { ("$dotlrn_url/" == [ad_conn url] || "$dotlrn_url/index" == [ad_conn url]) && $sort_key == 0 && $page_num == ""} {
+ #if { "$dotlrn_url/" == [ad_conn url] || "$dotlrn_url/index" == [ad_conn url]) && $sort_key == 0 && $page_num == ""} {
# active tab is first tab and page_num may be ""
- append navbar "\n- $pretty_name
"
- } elseif {$page_num == $sort_key} {
+ #append navbar "\n- $pretty_name
"
+ #} elseif {$page_num == $sort_key} {
# We are looking at the active tab
- append navbar "\n- $pretty_name
"
- } else {
+ # append navbar "\n- $pretty_name
"
+ #} else {
append navbar "\n- $pretty_name
"
- }
+ #}
}
- #
- # Common code for the the behavior of the control panel link (class administration
- # or my account)
- #
+ if {[regexp {dotlrn/clubs/*} [ad_conn url]]} {
+ append navbar "\n- Admin
"
+ }
- if {$show_control_panel} {
- if {$link_control_panel} {
- append navbar "- $control_panel_text
"
-
- } else {
- append navbar "- $control_panel_text
"
- }
- }
-
append navbar "
"
}