ILIAS  release_8 Revision v8.24
ILIAS\GlobalScreen\ScreenContext\ContextRepository Class Reference

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

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

Public Member Functions

 __construct ()
 
 main ()
 
 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

Class ContextRepository 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 46 of file ContextRepository.php.

47 {
48 global $DIC;
49 $this->wrapper = $DIC->http()->wrapper();
50 $this->refinery = $DIC->refinery();
51 }
global $DIC
Definition: feed.php:28

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

+ Here is the call graph for this function:

Member Function Documentation

◆ administration()

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

Definition at line 102 of file ContextRepository.php.

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

References ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_ADMINISTRATION.

◆ desktop()

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

Definition at line 80 of file ContextRepository.php.

80 : ScreenContext
81 {
82 return $this->get(BasicScreenContext::class, self::C_DESKTOP);
83 }

References ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_DESKTOP.

◆ external()

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

Definition at line 72 of file ContextRepository.php.

72 : ScreenContext
73 {
74 return $this->get(BasicScreenContext::class, 'external');
75 }

◆ get()

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

Definition at line 115 of file ContextRepository.php.

115 : ScreenContext
116 {
117 if (!isset($this->contexts[$identifier])) {
118 $this->contexts[$identifier] = new $class_name($identifier);
119 }
120
121 return $this->contexts[$identifier];
122 }

◆ lti()

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

Definition at line 110 of file ContextRepository.php.

110 : ScreenContext
111 {
112 return $this->get(BasicScreenContext::class, self::C_LTI);
113 }

References ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_LTI.

◆ main()

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

Definition at line 56 of file ContextRepository.php.

56 : ScreenContext
57 {
58 return $this->get(BasicScreenContext::class, self::C_MAIN);
59 }

References ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_MAIN.

◆ repository()

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

Definition at line 88 of file ContextRepository.php.

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 : 0;
94 $context = $context->withReferenceId(new ReferenceId($ref_id));
95
96 return $context;
97 }
$ref_id
Definition: ltiauth.php:67
$context
Definition: webdav.php:29

References $context, $ref_id, ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_REPO, and ILIAS\Repository\refinery().

+ 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 44 of file ContextRepository.php.

◆ $wrapper

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

Definition at line 43 of file ContextRepository.php.

◆ C_ADMINISTRATION

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

◆ C_DESKTOP

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

◆ C_LTI

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

◆ C_MAIN

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

◆ C_REPO

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

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