xo::lti::LTI method get_context (protected)

 <instance of xo::lti::LTI[i]> get_context

Defined in packages/xooauth/tcl/lti-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 ad_conn ad_conn (public) lang::util::localize lang::util::localize (public) subsite::get_element subsite::get_element (public) xo::lti::LTI instproc get_context xo::lti::LTI instproc get_context xo::lti::LTI instproc get_context->ad_conn xo::lti::LTI instproc get_context->lang::util::localize xo::lti::LTI instproc get_context->subsite::get_element

Testcases:
No testcase defined.
Source code:
if {![ns_conn isconnected]} {
    ns_log warning "LTI get_context requires an active connection"
    return
}
if {[info exists :context_id]
    && [info exists :context_title]
    && [info exists :context_label]
} {
    #
    # Everything is already set
    #
    return
}

set community_id ""
#
# Try to get community_id and community_name from dotlrn community.
#
if {[llength [info commands dotlrn_community::get_community_id]] > 0} {
    set community_id [dotlrn_community::get_community_id]
    if {$community_id ne ""} {
        set community_name [lang::util::localize [dotlrn_community::get_community_name $community_id]]
    }
}
#
# If there is still no community_id (and community_name)
# get it from the subsite.
#
if {$community_id eq ""} {
    set community_id [ad_conn subsite_id]
    set community_name [subsite::get_element  -subsite_id $community_id  -element instance_name]
}
if {$community_id ne "" && ![info exists :context_id]} {
    set :context_id $community_id
}
if {$community_name ne ""} {
    if {![info exists :context_title]} {
        set :context_title $community_name
    }
    if {![info exists :context_label]} {
        set :context_label $community_name
    }
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: