ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\GlobalScreen\ScreenContext\ContextRepository Class Reference

The Collection of all available Contexts in the System. More...

+ Collaboration diagram for ILIAS\GlobalScreen\ScreenContext\ContextRepository:

Public Member Functions

 __construct ()
 
 main ()
 
function external ()
 
 desktop ()
 
 repository ()
 
 administration ()
 
 lti ()
 

Protected Attributes

WrapperFactory $wrapper
 
Factory $refinery
 

Private Member Functions

 get (string $class_name, string $identifier)
 

Private Attributes

array $contexts = []
 
const C_MAIN = 'main'
 
const C_DESKTOP = 'desktop'
 
const C_REPO = 'repo'
 
const C_ADMINISTRATION = 'administration'
 
const C_LTI = 'lti'
 

Detailed Description

The Collection of all available Contexts in the System.

You can use them in your

See also
ScreenContextAwareProvider to announce you are interested in.
Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 34 of file ContextRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\GlobalScreen\ScreenContext\ContextRepository::__construct ( )

Definition at line 61 of file ContextRepository.php.

References $DIC, and ILIAS\Repository\refinery().

62  {
63  global $DIC;
64  $this->wrapper = $DIC->http()->wrapper();
65  $this->refinery = $DIC->refinery();
66  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ administration()

ILIAS\GlobalScreen\ScreenContext\ContextRepository::administration ( )

Definition at line 101 of file ContextRepository.php.

101  : ScreenContext
102  {
103  return $this->get(BasicScreenContext::class, self::C_ADMINISTRATION);
104  }

◆ desktop()

ILIAS\GlobalScreen\ScreenContext\ContextRepository::desktop ( )

Definition at line 83 of file ContextRepository.php.

83  : ScreenContext
84  {
85  return $this->get(BasicScreenContext::class, self::C_DESKTOP);
86  }

◆ external()

function ILIAS\GlobalScreen\ScreenContext\ContextRepository::external ( )

Definition at line 78 of file ContextRepository.php.

78  : ScreenContext
79  {
80  return $this->get(BasicScreenContext::class, 'external');
81  }

◆ get()

ILIAS\GlobalScreen\ScreenContext\ContextRepository::get ( string  $class_name,
string  $identifier 
)
private

Definition at line 111 of file ContextRepository.php.

111  : ScreenContext
112  {
113  if (!isset($this->contexts[$identifier])) {
114  $this->contexts[$identifier] = new $class_name($identifier);
115  }
116 
117  return $this->contexts[$identifier];
118  }

◆ lti()

ILIAS\GlobalScreen\ScreenContext\ContextRepository::lti ( )

Definition at line 106 of file ContextRepository.php.

106  : ScreenContext
107  {
108  return $this->get(BasicScreenContext::class, self::C_LTI);
109  }

◆ main()

ILIAS\GlobalScreen\ScreenContext\ContextRepository::main ( )

Definition at line 68 of file ContextRepository.php.

68  : ScreenContext
69  {
70  return $this->get(BasicScreenContext::class, self::C_MAIN);
71  }

◆ repository()

ILIAS\GlobalScreen\ScreenContext\ContextRepository::repository ( )

Definition at line 88 of file ContextRepository.php.

References $context, $ref_id, null, and ILIAS\Repository\refinery().

88  : ScreenContext
89  {
90  $context = $this->get(BasicScreenContext::class, self::C_REPO);
91  $ref_id = $this->wrapper->query()->has('ref_id')
92  ? $this->wrapper->query()->retrieve('ref_id', $this->refinery->kindlyTo()->int())
93  : null;
94  if ($ref_id) {
95  return $context->withReferenceId(new ReferenceId($ref_id));
96  }
97 
98  return $context;
99  }
$context
Definition: webdav.php:31
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$ref_id
Definition: ltiauth.php:65
+ Here is the call graph for this function:

Field Documentation

◆ $contexts

array ILIAS\GlobalScreen\ScreenContext\ContextRepository::$contexts = []
private

Definition at line 36 of file ContextRepository.php.

◆ $refinery

Factory ILIAS\GlobalScreen\ScreenContext\ContextRepository::$refinery
protected

Definition at line 59 of file ContextRepository.php.

◆ $wrapper

WrapperFactory ILIAS\GlobalScreen\ScreenContext\ContextRepository::$wrapper
protected

Definition at line 58 of file ContextRepository.php.

◆ C_ADMINISTRATION

const ILIAS\GlobalScreen\ScreenContext\ContextRepository::C_ADMINISTRATION = 'administration'
private

Definition at line 52 of file ContextRepository.php.

◆ C_DESKTOP

const ILIAS\GlobalScreen\ScreenContext\ContextRepository::C_DESKTOP = 'desktop'
private

Definition at line 44 of file ContextRepository.php.

◆ C_LTI

const ILIAS\GlobalScreen\ScreenContext\ContextRepository::C_LTI = 'lti'
private

Definition at line 56 of file ContextRepository.php.

◆ C_MAIN

const ILIAS\GlobalScreen\ScreenContext\ContextRepository::C_MAIN = 'main'
private

Definition at line 40 of file ContextRepository.php.

◆ C_REPO

const ILIAS\GlobalScreen\ScreenContext\ContextRepository::C_REPO = 'repo'
private

Definition at line 48 of file ContextRepository.php.


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