ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilContext Class Reference

Service context (factory) class. More...

+ Collaboration diagram for ilContext:

Static Public Member Functions

static init ($a_type)
 Init context by type. More...
 
static supportsRedirects ()
 Are redirects supported? More...
 
static hasUser ()
 Based on user authentication? More...
 
static usesHTTP ()
 Uses HTTP aka browser. More...
 
static hasHTML ()
 Has HTML output. More...
 
static usesTemplate ()
 Uses template engine. More...
 
static initClient ()
 Init client. More...
 
static doAuthentication ()
 Try authentication. More...
 
static getType ()
 Get context type. More...
 

Data Fields

const CONTEXT_WEB = 1
 
const CONTEXT_CRON = 2
 
const CONTEXT_RSS = 3
 
const CONTEXT_ICAL = 4
 
const CONTEXT_SOAP = 5
 
const CONTEXT_WEBDAV = 6
 
const CONTEXT_RSS_AUTH = 7
 
const CONTEXT_WEB_ACCESS_CHECK = 8
 
const CONTEXT_SESSION_REMINDER = 9
 
const CONTEXT_SOAP_WITHOUT_CLIENT = 10
 
const CONTEXT_UNITTEST = 11
 
const CONTEXT_REST = 12
 
const CONTEXT_SCORM = 13
 

Protected Member Functions

 getClassForType ($a_type)
 Get class name for type id. More...
 

Static Protected Member Functions

static callContext ($a_method)
 Call current content. More...
 

Static Protected Attributes

static $class_name
 
static $type
 

Detailed Description

Service context (factory) class.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 13 of file class.ilContext.php.

Member Function Documentation

◆ callContext()

static ilContext::callContext (   $a_method)
staticprotected

Call current content.

Parameters
string$a_method
Returns
bool

Definition at line 108 of file class.ilContext.php.

109 {
110 if(!self::$class_name)
111 {
112 self::init(self::CONTEXT_WEB);
113 }
114 return call_user_func(array(self::$class_name, $a_method));
115 }
static init($a_type)
Init context by type.

References init().

Referenced by doAuthentication(), hasHTML(), hasUser(), initClient(), supportsRedirects(), usesHTTP(), and usesTemplate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doAuthentication()

static ilContext::doAuthentication ( )
static

Try authentication.

Returns
bool

Definition at line 190 of file class.ilContext.php.

191 {
192 return (bool)self::callContext("doAuthentication");
193 }
static callContext($a_method)
Call current content.

References callContext().

Referenced by ilInitialisation\initILIAS().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getClassForType()

ilContext::getClassForType (   $a_type)
protected

Get class name for type id.

Parameters
int$a_type
Returns
string

Definition at line 57 of file class.ilContext.php.

58 {
59 switch($a_type)
60 {
62 return "ilContextWeb";
63
65 return "ilContextCron";
66
68 return "ilContextRss";
69
71 return "ilContextIcal";
72
74 return "ilContextSoap";
75
77 return "ilContextWebdav";
78
80 return "ilContextRssAuth";
81
83 return "ilContextWebAccessCheck";
84
86 return "ilContextSessionReminder";
87
89 return "ilContextSoapWithoutClient";
90
92 return "ilContextUnitTest";
93
95 return 'ilContextRest';
96
98 return 'ilContextScorm';
99 }
100 }
const CONTEXT_CRON
const CONTEXT_RSS_AUTH
const CONTEXT_SOAP_WITHOUT_CLIENT
const CONTEXT_WEB
const CONTEXT_WEBDAV
const CONTEXT_UNITTEST
const CONTEXT_SCORM
const CONTEXT_ICAL
const CONTEXT_WEB_ACCESS_CHECK
const CONTEXT_SESSION_REMINDER
const CONTEXT_SOAP
const CONTEXT_RSS
const CONTEXT_REST

References CONTEXT_CRON, CONTEXT_ICAL, CONTEXT_REST, CONTEXT_RSS, CONTEXT_RSS_AUTH, CONTEXT_SCORM, CONTEXT_SESSION_REMINDER, CONTEXT_SOAP, CONTEXT_SOAP_WITHOUT_CLIENT, CONTEXT_UNITTEST, CONTEXT_WEB, CONTEXT_WEB_ACCESS_CHECK, and CONTEXT_WEBDAV.

Referenced by init().

+ Here is the caller graph for this function:

◆ getType()

static ilContext::getType ( )
static

Get context type.

Returns
int

Definition at line 200 of file class.ilContext.php.

201 {
202 return self::$type;
203 }

References $type.

Referenced by ilSoapAdministration\initIlias(), ilMail\isSOAPEnabled(), and ilECSTaskScheduler\start().

+ Here is the caller graph for this function:

◆ hasHTML()

static ilContext::hasHTML ( )
static

Has HTML output.

Returns
bool

Definition at line 160 of file class.ilContext.php.

161 {
162 return (bool)self::callContext("hasHTML");
163 }

References callContext().

Referenced by ilInitialisation\handleMaintenanceMode(), ilInitialisation\initILIAS(), and ilInitialisation\redirect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasUser()

static ilContext::hasUser ( )
static

Based on user authentication?

Returns
bool

Definition at line 140 of file class.ilContext.php.

141 {
142 return (bool)self::callContext("hasUser");
143 }

References callContext().

Referenced by ilInitialisation\initILIAS().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

static ilContext::init (   $a_type)
static

Init context by type.

Parameters
int$a_type
Returns
bool

Definition at line 38 of file class.ilContext.php.

39 {
41 if($class_name)
42 {
43 include_once "Services/Context/classes/class.".$class_name.".php";
44 self::$class_name = $class_name;
45 self::$type = $a_type;
46 return true;
47 }
48 return false;
49 }
static $class_name
getClassForType($a_type)
Get class name for type id.

References $class_name, and getClassForType().

Referenced by callContext(), ilSoapAdministration\getClientInfoXML(), ilSoapAdministration\getInstallationInfoXML(), and ilCalendarRemoteAccessHandler\initIlias().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initClient()

static ilContext::initClient ( )
static

Init client.

Returns
bool

Definition at line 180 of file class.ilContext.php.

181 {
182 return (bool)self::callContext("initClient");
183 }

References callContext().

Referenced by ilInitialisation\initILIAS().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ supportsRedirects()

static ilContext::supportsRedirects ( )
static

Are redirects supported?

Returns
bool

Definition at line 122 of file class.ilContext.php.

123 {
124 global $ilCtrl;
125
126 // asynchronous calls must never be redirected
127 if($ilCtrl && $ilCtrl->isAsynch())
128 {
129 return false;
130 }
131
132 return (bool)self::callContext("supportsRedirects");
133 }
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, and callContext().

Referenced by ilUserRequestTargetAdjustment\adjust(), ilAuthApache\login(), and ilInitialisation\redirect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ usesHTTP()

static ilContext::usesHTTP ( )
static

Uses HTTP aka browser.

Returns
bool

Definition at line 150 of file class.ilContext.php.

151 {
152 return (bool)self::callContext("usesHTTP");
153 }

References callContext().

Referenced by ilUtil\_getHttpPath(), ilInitialisation\initClient(), ilInitialisation\initSettings(), ilInitialisation\initUser(), and ilInitialisation\redirect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ usesTemplate()

static ilContext::usesTemplate ( )
static

Uses template engine.

Returns
bool

Definition at line 170 of file class.ilContext.php.

171 {
172 return (bool)self::callContext("usesTemplate");
173 }

References callContext().

Referenced by ilInitialisation\requireCommonIncludes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $class_name

ilContext::$class_name
staticprotected

Definition at line 15 of file class.ilContext.php.

Referenced by init().

◆ $type

ilContext::$type
staticprotected

Definition at line 16 of file class.ilContext.php.

Referenced by getType().

◆ CONTEXT_CRON

const ilContext::CONTEXT_CRON = 2

Definition at line 19 of file class.ilContext.php.

Referenced by getClassForType(), and ilMail\isSOAPEnabled().

◆ CONTEXT_ICAL

const ilContext::CONTEXT_ICAL = 4

Definition at line 21 of file class.ilContext.php.

Referenced by getClassForType(), and ilCalendarRemoteAccessHandler\initIlias().

◆ CONTEXT_REST

const ilContext::CONTEXT_REST = 12

Definition at line 29 of file class.ilContext.php.

Referenced by getClassForType().

◆ CONTEXT_RSS

const ilContext::CONTEXT_RSS = 3

Definition at line 20 of file class.ilContext.php.

Referenced by getClassForType().

◆ CONTEXT_RSS_AUTH

const ilContext::CONTEXT_RSS_AUTH = 7

Definition at line 24 of file class.ilContext.php.

Referenced by getClassForType().

◆ CONTEXT_SCORM

const ilContext::CONTEXT_SCORM = 13

Definition at line 30 of file class.ilContext.php.

Referenced by getClassForType().

◆ CONTEXT_SESSION_REMINDER

const ilContext::CONTEXT_SESSION_REMINDER = 9

Definition at line 26 of file class.ilContext.php.

Referenced by getClassForType().

◆ CONTEXT_SOAP

const ilContext::CONTEXT_SOAP = 5

Definition at line 22 of file class.ilContext.php.

Referenced by getClassForType(), and ilSoapAdministration\initIlias().

◆ CONTEXT_SOAP_WITHOUT_CLIENT

const ilContext::CONTEXT_SOAP_WITHOUT_CLIENT = 10

◆ CONTEXT_UNITTEST

const ilContext::CONTEXT_UNITTEST = 11

Definition at line 28 of file class.ilContext.php.

Referenced by getClassForType().

◆ CONTEXT_WEB

const ilContext::CONTEXT_WEB = 1

Definition at line 18 of file class.ilContext.php.

Referenced by getClassForType(), and ilECSTaskScheduler\start().

◆ CONTEXT_WEB_ACCESS_CHECK

const ilContext::CONTEXT_WEB_ACCESS_CHECK = 8

Definition at line 25 of file class.ilContext.php.

Referenced by getClassForType().

◆ CONTEXT_WEBDAV

const ilContext::CONTEXT_WEBDAV = 6

Definition at line 23 of file class.ilContext.php.

Referenced by getClassForType().


The documentation for this class was generated from the following file: