group::get_member_state_pretty (public)

 group::get_member_state_pretty -member_state member_state \
    [ -component component ] [ -user_name user_name ] \
    [ -community_name community_name ] [ -site_name site_name ] \
    [ -url url ] [ -locale locale ]

Defined in packages/acs-subsite/tcl/group-procs.tcl

Returns the pretty-name of a member state.

Switches:
-member_state (required)
-component (optional, defaults to "pretty_name")
-user_name (optional)
-community_name (optional)
-site_name (optional)
-url (optional)
-locale (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-admin/www/users/member-state-change.tcl packages/acs-admin/ www/users/member-state-change.tcl group::get_member_state_pretty group::get_member_state_pretty packages/acs-admin/www/users/member-state-change.tcl->group::get_member_state_pretty packages/acs-subsite/lib/user-subsites.tcl packages/acs-subsite/ lib/user-subsites.tcl packages/acs-subsite/lib/user-subsites.tcl->group::get_member_state_pretty packages/acs-subsite/www/members/index.tcl packages/acs-subsite/ www/members/index.tcl packages/acs-subsite/www/members/index.tcl->group::get_member_state_pretty packages/acs-subsite/www/members/member-state-change.tcl packages/acs-subsite/ www/members/member-state-change.tcl packages/acs-subsite/www/members/member-state-change.tcl->group::get_member_state_pretty lang::util::localize lang::util::localize (public) group::get_member_state_pretty->lang::util::localize

Testcases:
No testcase defined.
Source code:
    if {$member_state ni {approved banned deleted merged "needs approval" rejected}} {
        error "invalid member_state '$member_state'"
    }
    #
    # We can't use spaces in message keys, so replace it with a "_".
    #
    regsub -all -- " " $member_state "_" member_state

    switch -- $component {
        pretty_name {
            set message #acs-kernel.member_state_$member_state#
        }
        action {
            if {$user_name eq ""} { error "user_name must be specified and must be nonempty" }
            set message #acs-kernel.member_state_action_$member_state#
        }
        account_mail {
            if {$site_name eq ""} { error "site_name must be specified and must be nonempty" }
            if {[string match "#*#" $site_name]} {
                # site names can be localized
                set site_name [lang::util::localize $site_name $locale]
            }
            if {$url eq ""} { error "url must be specified and must be nonempty" }
            set message #acs-kernel.member_state_account_mail_$member_state#
        }
        community_mail {
            if {$community_name eq ""} { error "community_name must be specified and must be nonempty" }
            if {[string match "#*#" $community_name]} {
                # community_names can be localized
                set community_name [lang::util::localize $community_name $locale]
            }
            if {$url eq ""} { error "url must be specified and must be nonempty" }
            set message #acs-kernel.member_state_community_mail_$member_state#
        }
        default {
            error "invalid component '$component'"
        }
    }

    return [lang::util::localize $message $locale]
XQL Not present:
Generic
PostgreSQL XQL file:
packages/acs-subsite/tcl/group-procs-postgresql.xql

Oracle XQL file:
packages/acs-subsite/tcl/group-procs-oracle.xql

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