Gets the context panel for a given context.

@param contextId the context id
@return the context panel
513761
private ContextUsersPanel getContextPanel(int contextId) {
		ContextUsersPanel panel = this.userPanelsMap.get(contextId);
		if (panel == null) {
			panel = new ContextUsersPanel(this, contextId);
			this.userPanelsMap.put(contextId, panel);
		}
		return panel;
	}
875088
public static function get_contexts_for_userid(int $userid) : contextlist {
        global $DB;

        $contextlist = new contextlist();

        // The role_capabilities table contains user data.
        $contexts = [
            CONTEXT_SYSTEM,
            CONTEXT_USER,
            CONTEXT_COURSECAT,
            CONTEXT_COURSE,
            CONTEXT_MODULE,
            CONTEXT_BLOCK
        ];
        list($insql, $inparams) = $DB->get_in_or_equal($contexts, SQL_PARAMS_NAMED);
        $sql = "SELECT ctx.id
                  FROM {context} ctx
                  JOIN {role_capabilities} rc
                    ON rc.contextid = ctx.id
                   AND ((ctx.contextlevel {$insql} AND rc.modifierid = :modifierid)
                    OR (ctx.contextlevel = :contextlevel AND ctx.instanceid = :userid))";
        $params = [
            'modifierid' => $userid,
            'contextlevel' => CONTEXT_USER,
            'userid' => $userid
         ];
        $params += $inparams;

        $contextlist->add_from_sql($sql, $params);

        // The role_assignments table contains user data.
        $contexts = [
            CONTEXT_SYSTEM,
            CONTEXT_USER,
            CONTEXT_COURSECAT,
            CONTEXT_COURSE,
            CONTEXT_MODULE,
            CONTEXT_BLOCK
        ];
        list($insql, $inparams) = $DB->get_in_or_equal($contexts, SQL_PARAMS_NAMED);
        $params = [
            'userid' => $userid,
            'modifierid' => $userid
         ];
        $params += $inparams;
        $sql = "SELECT ctx.id
                  FROM {role_assignments} ra
                  JOIN {context} ctx
                    ON ctx.id = ra.contextid
                   AND ctx.contextlevel {$insql}
                 WHERE (ra.userid = :userid
                    OR ra.modifierid = :modifierid)
                   AND ra.component != 'tool_cohortroles'";
        $contextlist->add_from_sql($sql, $params);

        return $contextlist;
    }
1208761
def _get_context_id(self):
        """"""

        from furious.context import get_current_context

        context_id = self._options.get('context_id')

        if context_id:
            return context_id

        try:
            context = get_current_context()
        except errors.NotInContextError:
            context = None
            self.update_options(context_id=None)

        if context:
            context_id = context.id
            self.update_options(context_id=context_id)

        return context_id
803378
public static ServletResponse getContextResponse()
    {
        ServiceContext context = (ServiceContext) _localContext.get();

        if (context != null)
            return context._response;
        else
            return null;
    }
454813
public static PageContext getPageContext(JspContext jspContext) {
        if(!(jspContext instanceof PageContext))
            throw new IllegalStateException(Bundle.getErrorString("DataGridUtil_IllegalJspContext", new Object[]{(jspContext != null ? jspContext.getClass().getName() : "null")}));
        else
            return (PageContext)jspContext;
    }
318028
public static final Map<String, Object> getContext() {
        Map<String, Object> ctx = CTX_HOLDER.get();
        if (ctx == null) {
            return null;
        }
        return ctx;
    }
375132
public DisplayContext getContext(DisplayContext.Type type) {
        return (type == DisplayContext.Type.CAPITALIZATION && capitalizationSetting != null)?
                capitalizationSetting: DisplayContext.CAPITALIZATION_NONE;
    }
924258
@Override
    public String getContextPath() {
        try {
            collaborator.preInvoke(componentMetaData);
            return request.getContextPath();
        } finally {
            collaborator.postInvoke();
        }
    }
1326040
private String getContextInfo(CmsContainerPageElementPanel element) {

        CmsContainerPageContainer container;
        if (m_handler.m_controller.isGroupcontainerEditing()) {
            container = (CmsContainerPageContainer)((CmsContainerPageElementPanel)element.getParentTarget()).getParentTarget();
        } else {
            container = (CmsContainerPageContainer)element.getParentTarget();
        }
        JSONObject result = new JSONObject();
        putString(result, CmsCntPageData.JSONKEY_ELEMENT_ID, element.getId());
        CmsUUID detailId = m_handler.m_controller.getData().getDetailId();
        if (detailId != null) {
            putString(result, CmsCntPageData.JSONKEY_DETAIL_ELEMENT_ID, "" + detailId);
        }
        putString(result, CmsCntPageData.JSONKEY_NAME, "" + container.getContainerId());
        putString(result, CmsCntPageData.JSONKEY_TYPE, "" + container.getContainerType());
        result.put(CmsCntPageData.JSONKEY_WIDTH, new JSONNumber(container.getConfiguredWidth()));
        result.put(CmsCntPageData.JSONKEY_DETAILVIEW, JSONBoolean.getInstance(container.isDetailView()));
        result.put(CmsCntPageData.JSONKEY_DETAILONLY, JSONBoolean.getInstance(container.isDetailOnly()));
        result.put(CmsCntPageData.JSONKEY_MAXELEMENTS, new JSONNumber(1));
        JSONObject presets = new JSONObject();
        Map<String, String> presetsMap = container.getSettingPresets();
        for (Map.Entry<String, String> entry : presetsMap.entrySet()) {
            presets.put(entry.getKey(), new JSONString(entry.getValue()));
        }
        result.put(CmsCntPageData.JSONKEY_PRESETS, presets);
        return result.toString();
    }
661509
public List<User> getUIConfiguredUsers(int contextId) {
		ContextUsersPanel panel = this.userPanelsMap.get(contextId);
		if (panel != null) {
			return Collections.unmodifiableList(panel.getUsersTableModel().getUsers());
		}
		return null;
	}
416853
public static function get_contexts_for_userid(int $userid) : contextlist {
        $sql = "SELECT id
                  FROM {context}
                 WHERE instanceid = :userid
                       AND contextlevel = :contextlevel";

        $contextlist = new contextlist();
        $contextlist->set_component('tool_dataprivacy');
        $contextlist->add_from_sql($sql, ['userid' => $userid, 'contextlevel' => CONTEXT_USER]);
        return $contextlist;
    }
315293
public com.google.api.Context getContext() {
    return context_ == null ? com.google.api.Context.getDefaultInstance() : context_;
  }
704285
public static Context getContext()
    {
        if (ctx == null)
        {
            try
            {
                setContext(null);
            }
            catch (Exception e)
            {
                log.error("Cannot instantiate the InitialContext", e);
                throw new OJBRuntimeException(e);
            }
        }
        return ctx;
    }
354519
@NonNull public Context getContext() {
        if (searchView != null) {
            return searchView.getContext();
        } else if (supportView != null) {
            return supportView.getContext();
        }
        throw new IllegalStateException(ERROR_NO_SEARCHVIEW);
    }
751296
public static <T> T getContext(ELContext context, Class<T> key, T defaultValue) {
        @SuppressWarnings("unchecked")
        final T result = (T) context.getContext(key);
        return result == null ? defaultValue : result;
    }
233811
public static String getContext(final HttpServletRequest request) {
    String context = request.getContextPath();
    if ((context == null) || (context.equals("."))) {
      context = "";
    }

    return context;
  }
1150058
protected ELContext getELContext() {
	FacesContext fc = getFacesContext();
	ELContext result = null;
	if (null != fc) {
	    result = fc.getELContext();
	}
	return result;
    }