ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
 
const CONTEXT_WAC = 14
 

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 112 of file class.ilContext.php.

113 {
114 if(!self::$class_name)
115 {
116 self::init(self::CONTEXT_WEB);
117 }
118 return call_user_func(array(self::$class_name, $a_method));
119 }
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 194 of file class.ilContext.php.

195 {
196 return (bool)self::callContext("doAuthentication");
197 }
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 58 of file class.ilContext.php.

59 {
60 switch($a_type)
61 {
63 return "ilContextWeb";
64
66 return "ilContextCron";
67
69 return "ilContextRss";
70
72 return "ilContextIcal";
73
75 return "ilContextSoap";
76
78 return "ilContextWebdav";
79
81 return "ilContextRssAuth";
82
84 return "ilContextWebAccessCheck";
85
87 return "ilContextSessionReminder";
88
90 return "ilContextSoapWithoutClient";
91
93 return "ilContextUnitTest";
94
96 return 'ilContextRest';
97
99 return 'ilContextScorm';
100
102 return 'ilContextWAC';
103 }
104 }
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
const CONTEXT_WAC

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_WAC, 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 204 of file class.ilContext.php.

205 {
206 return self::$type;
207 }

References $type.

Referenced by ilFileDelivery\__construct(), ilAuthContainerMDB2\__construct(), ilSoapAdministration\initIlias(), ilLoggerFactory\isConsoleAvailable(), 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 164 of file class.ilContext.php.

165 {
166 return (bool)self::callContext("hasHTML");
167 }

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 144 of file class.ilContext.php.

145 {
146 return (bool)self::callContext("hasUser");
147 }

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 39 of file class.ilContext.php.

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

References $class_name, and getClassForType().

Referenced by callContext(), ilSoapAdministration\getClientInfoXML(), ilSoapAdministration\getInstallationInfoXML(), ilCalendarRemoteAccessHandler\initIlias(), and ilWebAccessChecker\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 184 of file class.ilContext.php.

185 {
186 return (bool)self::callContext("initClient");
187 }

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 126 of file class.ilContext.php.

127 {
128 global $ilCtrl;
129
130 // asynchronous calls must never be redirected
131 if($ilCtrl && $ilCtrl->isAsynch())
132 {
133 return false;
134 }
135
136 return (bool)self::callContext("supportsRedirects");
137 }
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 154 of file class.ilContext.php.

155 {
156 return (bool)self::callContext("usesHTTP");
157 }

References callContext().

Referenced by ilUtil\_getHttpPath(), ilLanguageDetectorFactory\getValidInstances(), 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 174 of file class.ilContext.php.

175 {
176 return (bool)self::callContext("usesTemplate");
177 }

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

◆ 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_WAC

const ilContext::CONTEXT_WAC = 14

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

Referenced by getClassForType(), and ilWebAccessChecker\initILIAS().

◆ CONTEXT_WEB

const ilContext::CONTEXT_WEB = 1

◆ 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: