Index: openacs-4/contrib/packages/portal/tcl/portal-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/portal-procs.tcl,v diff -u -r1.31 -r1.32 --- openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 20 Jun 2004 00:39:05 -0000 1.31 +++ openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 20 Jun 2004 01:11:22 -0000 1.32 @@ -324,6 +324,7 @@ if { $portal_id == [get_admin_portal_id] } { set portal(theme_id) [portal::get_theme_id -portal_id [get_user_portal_id]] } + return [array get portal] } @@ -424,12 +425,10 @@ {-link_all 0} {-extra_td_html ""} {-table_html_args ""} + {-extra_td_selected_p 0} } { - wraps portal::dimensional to create a dotlrn navbar + Wraps portal::dimensional to create a dotlrn navbar - DRB: I'm only keeping this POS around for .LRN ... the portal package itself - builds a multirow navbar suitable for use with the templating system. - @return the id of the page @param portal_id @param link the relative link to set for hrefs @@ -441,7 +440,7 @@ lappend ad_dim_struct [list $page_num $name [list]] } - set ad_dim_struct "{ page_num \"Page:\" 0 [list $ad_dim_struct] }" + set ad_dim_struct "{ page_num [list [_ new-portal.Page_1]] 0 [list $ad_dim_struct] }" return [dimensional -no_header \ -no_bars \ @@ -450,6 +449,7 @@ -pre_html $pre_html \ -post_html $post_html \ -extra_td_html $extra_td_html \ + -extra_td_selected_p $extra_td_selected_p \ -table_html_args $table_html_args \ $ad_dim_struct \ $link] @@ -469,93 +469,120 @@ {-no_header:boolean} {-no_bars:boolean} {-link_all 0} + {-names_in_cells_p 1} {-th_bgcolor "#ECECEC"} {-td_align "center"} {-extra_td_html ""} {-table_html_args "border=0 cellspacing=0 cellpadding=3 width=100%"} + {-class_html ""} {-pre_html ""} {-post_html ""} + {-extra_td_selected_p 0} option_list {url {}} {options_set ""} {optionstype url} } { An enhanced ad_dimensional. see that proc for usage details - } { if {[empty_string_p $option_list]} { return } - + if {[empty_string_p $options_set]} { set options_set [ns_getform] } - + if {[empty_string_p $url]} { set url [ad_conn url] } - - set html "\n\n \n" - + + set html "\n
\n" + if {!$no_header_p} { foreach option $option_list { - append html " \n" + append html "\n" } } - - append html " \n \n" - + + append html " \n" + foreach option $option_list { - append html " " + set end_html "" + set break_html "" + set post_selected_html "$post_html" + } else { + append html " \n" + if {$extra_td_selected_p} { + append html "${pre_selected_td_html}${pre_html}$extra_td_html${post_html}\n" + } else { + append html "${pre_td_html}$extra_td_html${post_html}\n" + } } - append html " \n
[lindex $option 1]
[lindex $option 1]
" - + if {!$no_bars_p} { append html "\[" } + + + if { $names_in_cells_p } { + set pre_td_html "" + set pre_selected_td_html "" + set post_html "$post_html" + set td_html "" + set pre_selected_td_html "" + set post_selected_html "$post_html" + set end_html "" + set td_html "" + post_html "$post_html" + if {!$no_bars_p} { + set break_html " | " + } else { + append break_html "   " + } + } # find out what the current option value is. # check if a default is set otherwise the first value is used set option_key [lindex $option 0] set option_val [lindex $option 2] if {![empty_string_p $options_set]} { - set option_val [ns_set get $options_set $option_key] + set options_set_val [ns_set get $options_set $option_key] + if { ![empty_string_p $options_set_val] } { + set option_val $options_set_val + } } - + set first_p 1 foreach option_value [lindex $option 3] { set thisoption_name [lindex $option_value 0] - set thisoption_value [lindex $option_value 1] + # We allow portal page names to have embedded message catalog keys + # that we localize on the fly + set thisoption_value [ad_quotehtml [lang::util::localize [lindex $option_value 1]]] set thisoption_link_p 1 if {[llength $option_value] > 3} { set thisoption_link_p [lindex $option_value 3] } if {$first_p} { set first_p 0 - } else { - if {!$no_bars_p} { - append html " | " - } else { - append html "   " - } + } else { + append html $break_html } - + if {([string equal $option_val $thisoption_name] == 1 && !$link_all) || !$thisoption_link_p} { - append html "${pre_html}${thisoption_value}${post_html}" + append html "${pre_selected_td_html}${pre_html}${thisoption_value}${post_selected_html}\n" } else { - append html "${pre_html}${thisoption_value}${post_html}" + append html "${pre_td_html}${pre_html}${thisoption_value}${post_html}\n" } } if {!$no_bars_p} { append html "\]" } - - append html "$extra_td_html
\n" + append html " \n$end_html\n" } - ad_proc datasource_list { } { Returns a list of portal datasources which have been mapped to the given portal