ILIAS  release_4-4 Revision
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  }

◆ doAuthentication()

static ilContext::doAuthentication ( )
static

Try authentication.

Returns
bool

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

Referenced by ilInitialisation\authenticate(), and ilInitialisation\initILIAS().

191  {
192  return (bool)self::callContext("doAuthentication");
193  }
+ 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  {
61  case self::CONTEXT_WEB:
62  return "ilContextWeb";
63 
64  case self::CONTEXT_CRON:
65  return "ilContextCron";
66 
67  case self::CONTEXT_RSS:
68  return "ilContextRss";
69 
70  case self::CONTEXT_ICAL:
71  return "ilContextIcal";
72 
73  case self::CONTEXT_SOAP:
74  return "ilContextSoap";
75 
76  case self::CONTEXT_WEBDAV:
77  return "ilContextWebdav";
78 
79  case self::CONTEXT_RSS_AUTH:
80  return "ilContextRssAuth";
81 
82  case self::CONTEXT_WEB_ACCESS_CHECK:
83  return "ilContextWebAccessCheck";
84 
85  case self::CONTEXT_SESSION_REMINDER:
86  return "ilContextSessionReminder";
87 
88  case self::CONTEXT_SOAP_WITHOUT_CLIENT:
89  return "ilContextSoapWithoutClient";
90 
91  case self::CONTEXT_UNITTEST:
92  return "ilContextUnitTest";
93 
94  case self::CONTEXT_REST:
95  return 'ilContextRest';
96 
97  case self::CONTEXT_SCORM:
98  return 'ilContextScorm';
99  }
100  }

◆ getType()

static ilContext::getType ( )
static

Get context type.

Returns
int

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

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

201  {
202  return self::$type;
203  }
+ 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.

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

161  {
162  return (bool)self::callContext("hasHTML");
163  }
+ 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.

Referenced by ilInitialisation\authenticate(), and ilInitialisation\initILIAS().

141  {
142  return (bool)self::callContext("hasUser");
143  }
+ 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.

References $class_name.

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

39  {
40  $class_name = self::getClassForType($a_type);
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
+ 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.

Referenced by ilInitialisation\initILIAS().

181  {
182  return (bool)self::callContext("initClient");
183  }
+ 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.

References $ilCtrl.

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

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
+ 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.

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

151  {
152  return (bool)self::callContext("usesHTTP");
153  }
+ 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.

Referenced by ilInitialisation\requireCommonIncludes().

171  {
172  return (bool)self::callContext("usesTemplate");
173  }
+ 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.

◆ CONTEXT_CRON

const ilContext::CONTEXT_CRON = 2

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

Referenced by ilMail\isSOAPEnabled().

◆ CONTEXT_ICAL

const ilContext::CONTEXT_ICAL = 4

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

Referenced by ilCalendarRemoteAccessHandler\initIlias().

◆ CONTEXT_REST

const ilContext::CONTEXT_REST = 12

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

◆ CONTEXT_RSS

const ilContext::CONTEXT_RSS = 3

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

◆ CONTEXT_RSS_AUTH

const ilContext::CONTEXT_RSS_AUTH = 7

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

◆ CONTEXT_SCORM

const ilContext::CONTEXT_SCORM = 13

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

◆ CONTEXT_SESSION_REMINDER

const ilContext::CONTEXT_SESSION_REMINDER = 9

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

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

◆ CONTEXT_WEB

const ilContext::CONTEXT_WEB = 1

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

Referenced by ilECSTaskScheduler\start().

◆ CONTEXT_WEB_ACCESS_CHECK

const ilContext::CONTEXT_WEB_ACCESS_CHECK = 8

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

◆ CONTEXT_WEBDAV

const ilContext::CONTEXT_WEBDAV = 6

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


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