dir_alpha_nav_bar (public)

 dir_alpha_nav_bar [ -group_id group_id ] [ -all_users all_users ] \
    letter [ excluded_vars ]

Defined in packages/directory/tcl/directory-procs.tcl

Returns an A-Z bar with greyed out letters not in initial_list and bolds "letter". Includes all existing url vars except those in the "excluded_vars" list.

Switches:
-group_id (optional)
-all_users (optional)
Parameters:
letter (required)
excluded_vars (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 packages/directory/www/index.tcl packages/directory/ www/index.tcl dir_alpha_nav_bar dir_alpha_nav_bar packages/directory/www/index.tcl->dir_alpha_nav_bar ad_conn ad_conn (public) dir_alpha_nav_bar->ad_conn db_list db_list (public) dir_alpha_nav_bar->db_list db_map db_map (public) dir_alpha_nav_bar->db_map dir_all_letters dir_all_letters (public) dir_alpha_nav_bar->dir_all_letters dir_app_group_info dir_app_group_info (public) dir_alpha_nav_bar->dir_app_group_info

Testcases:
No testcase defined.
Source code:
    if {$all_users == "t"} {
        set table_and_group [db_map table_and_group_1]
    } else {
        set table_and_group [db_map table_and_group_2]
        set group_id [lindex [dir_app_group_info] 0]
    }

    set url "[ad_conn url]?"
    set exclude_list [list "letter"]
    foreach v $excluded_vars { 
    lappend exclude_list $v
    }

    set query_args [export_ns_set_vars url $exclude_list]
    if { ![empty_string_p $query_args] } {
    append url "$query_args&"
    }

    set initial_list [db_list initial_list "
    select distinct upper(substr(last_name,1,1)) 
          from $table_and_group"]

    set html_list [list]
    foreach l [dir_all_letters] {
    if {$l ni $initial_list} {
        # This means no user has this initial
        lappend html_list "<font color=gray>$l</font>"
    } elseif { [string compare $l $letter] == 0 } {
        lappend html_list "<b>$l</b>"
    } else {
        lappend html_list "<a href=${url}letter=$l>$l</a>"
    }
    }
    if { [empty_string_p $letter] || [string compare $letter "all"] == 0 } {
    lappend html_list "<b>All</b>"
    } else {
    lappend html_list "<a href=${url}letter=all>All</a>"
    }
    return [join $html_list " | "]
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
<fullquery name="dir_alpha_nav_bar.initial_list">
    <querytext>
      
	select distinct upper(substr(last_name,1,1)) 
          from $table_and_group
      </querytext>
</fullquery>

<fullquery name="dir_alpha_nav_bar.table_and_group_1">
    <querytext>
          dir_all_users m where 1=1
      </querytext>
</fullquery>

<fullquery name="dir_alpha_nav_bar.table_and_group_2">
    <querytext>
          dir_group_members m where group_id = :group_id
      </querytext>
</fullquery>
packages/directory/tcl/directory-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: