Index: openacs-4/packages/theme-zen/tcl/navigation-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/theme-zen/tcl/navigation-procs.tcl,v
diff -u -N -r1.8 -r1.9
--- openacs-4/packages/theme-zen/tcl/navigation-procs.tcl 19 Jun 2018 13:35:53 -0000 1.8
+++ openacs-4/packages/theme-zen/tcl/navigation-procs.tcl 19 Jun 2018 13:45:23 -0000 1.9
@@ -30,7 +30,7 @@
namespace eval zen {
ad_proc -public portal_navbar {
-
+
} {
A helper procedure that generates the Navbar, ie the tabs,
for dotlrn. It is called from the zen-master template.
@@ -51,11 +51,11 @@
set pvt_home_url [ad_pvt_home]
set pvt_home_name [_ acs-subsite.Your_Account]
set logout_url [ad_get_logout_url]
-
+
# Site-wide admin link
set admin_url {}
set dotlrn_admin_url ""
-
+
set sw_admin_p [acs_user::site_wide_admin_p -user_id $untrusted_user_id]
set dotlrn_admin_p [permission::permission_p \
-party_id $user_id \
@@ -64,7 +64,7 @@
if { $dotlrn_admin_p } {
set dotlrn_admin_url [dotlrn::get_admin_url]
}
-
+
if { $sw_admin_p } {
set admin_url "/acs-admin/"
set locale_admin_url "/acs-lang/admin"
@@ -73,7 +73,7 @@
-object_id [subsite::get_element -element object_id] \
-privilege admin \
-party_id $untrusted_user_id]
-
+
if { $subsite_admin_p } {
set admin_url "[subsite::get_element -element url]admin/"
}
@@ -82,7 +82,7 @@
set login_url [ad_get_login_url -return]
set user_name {}
}
-
+
set navbar "
"
set tabs_list [list]
@@ -127,12 +127,12 @@
# show title of the community instead of community type
# pretty name
set community_message_key [dotlrn_community::get_community_name $community_id]
- }
+ }
lappend tabs_list [list [dotlrn_community::get_community_url $community_id] $community_message_key $community_access_key]
set which_tab_selected $which_tab
incr which_tab
- }
+ }
# DRB: If we haven't found a tab to select, use the previous value if one
# exists, otherwise don't select any tab. Don't write to the database for
@@ -156,23 +156,23 @@
set which_tab 0
foreach tab_entry $tabs_list {
foreach {url name accesskey} $tab_entry {}
- set localizedName [lang::util::localize $name]
+ set localizedName [lang::util::localize $name]
if { $which_tab == $which_tab_selected } {
append navbar [subst {
- -
- $localizedName
-
- }]
+ -
+ $localizedName
+
+ }]
} else {
append navbar [subst {
- -
- $localizedName
-
- }]
+ -
+ $localizedName
+
+ }]
}
- incr which_tab
+ incr which_tab
}
-
+
append navbar "\n
"
}
@@ -188,18 +188,18 @@
with the portal pages on it) for dotlrn. It is called from the
dotlrn-master template
} {
-
+
set dotlrn_url [dotlrn::get_url]
set community_id [dotlrn_community::get_community_id]
set control_panel_name control-panel
set control_panel_url "$dotlrn_url/$control_panel_name"
-
+
if { $community_id eq "" } {
# We are not under a dotlrn community. However we could be
# under /dotlrn (i.e. in the user's portal) or anywhere
# else on the site
set link "[dotlrn::get_url]/"
-
+
if {[dotlrn::user_p -user_id $user_id] &&
[ad_get_client_property dotlrn home_tab_selected_p] } {
# this user is a dotlrn user, we've selected the home tab,
@@ -216,9 +216,9 @@
#
# We are under a dotlrn community. Get the community's portal_id, etc.
#
-
+
# some defaults
- set text [dotlrn_community::get_community_header_name $community_id]
+ set text [dotlrn_community::get_community_header_name $community_id]
set control_panel_name one-community-admin
# link is important : it sets the options_set value, which will be used later to select the current page
set link [dotlrn_community::get_community_url $community_id]
@@ -229,7 +229,7 @@
-user_id $user_id \
-community_id $community_id
]
-
+
if {!$admin_p} {
# the user can't admin this community, perhaps they are a
# humble member instead?
@@ -240,9 +240,9 @@
# explicitly turned off
set show_control_panel 1
}
-
+
if {$admin_p || $member_p} {
-
+
set portal_id [dotlrn_community::get_portal_id \
-community_id $community_id
]
@@ -254,7 +254,7 @@
}
}
- #AG: This code belongs in the portal package, near portal::subnavbar. For display reasons we need to do this
+ #AG: This code belongs in the portal package, near portal::subnavbar. For display reasons we need to do this
#as a ul instead of a table, which portal::subnavbar returns. Obviously we shouldn't be letting display-level
#stuff decide where we put our code, but first we'll need to mod the portal package accordingly.
@@ -268,38 +268,38 @@
#My Space and Control Panel
regsub -all {[^0-9]} $page_num {} page_num
}
-
-
+
+
set subnavbar ""
db_foreach list_page_nums_select {} {
if {$page_num eq $sort_key} {
append subnavbar [subst {
-
- $pretty_name
-
- }]
+
+ $pretty_name
+
+ }]
} else {
append subnavbar [subst {
-
- $pretty_name
-
- }]
+
+ $pretty_name
+
+ }]
}
- }
+ }
- if { $community_id ne "" && $admin_p } {
+ if { $community_id ne "" && $admin_p } {
if {[string match "*/one-community-admin*" [ad_conn url]]} {
append subnavbar [subst {
-
- [_ dotlrn.Admin]
-
- }]
+
+ [_ dotlrn.Admin]
+
+ }]
} else {
append subnavbar [subst {
-
- [_ dotlrn.Admin]
-
- }]
+
+ [_ dotlrn.Admin]
+
+ }]
}
}