ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ILIAS\GlobalScreen\ScreenContext\ContextRepository Class Reference

Class ContextRepository. More...

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

Public Member Functions

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

Data Fields

const C_MAIN = 'main'
 
const C_DESKTOP = 'desktop'
 
const C_REPO = 'repo'
 
const C_ADMINISTRATION = 'administration'
 
const C_LTI = 'lti'
 

Private Member Functions

 get (string $class_name, string $identifier)
 

Private Attributes

 $contexts = []
 

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

Member Function Documentation

◆ administration()

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

Definition at line 78 of file ContextRepository.php.

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

References ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_ADMINISTRATION.

◆ desktop()

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

Definition at line 57 of file ContextRepository.php.

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

References ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_DESKTOP.

◆ external()

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

Definition at line 48 of file ContextRepository.php.

48 : ScreenContext
49 {
50 return $this->get(BasicScreenContext::class, 'external');
51 }

◆ get()

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

Definition at line 99 of file ContextRepository.php.

100 {
101 if (!isset($this->contexts[$identifier])) {
102 $this->contexts[$identifier] = new $class_name($identifier);
103 }
104
105 return $this->contexts[$identifier];
106 }

◆ lti()

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

Definition at line 87 of file ContextRepository.php.

87 : ScreenContext
88 {
89 return $this->get(BasicScreenContext::class, self::C_LTI);
90 }

References ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_LTI.

◆ main()

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

Definition at line 30 of file ContextRepository.php.

30 : ScreenContext
31 {
32 return $this->get(BasicScreenContext::class, self::C_MAIN);
33 }

References ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_MAIN.

◆ repository()

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

Definition at line 66 of file ContextRepository.php.

66 : ScreenContext
67 {
68 $context = $this->get(BasicScreenContext::class, self::C_REPO);
69 $context = $context->withReferenceId(new ReferenceId((int) ($_GET['ref_id'] ?? 0)));
70
71 return $context;
72 }
$_GET["client_id"]
$context
Definition: webdav.php:26

References $_GET, $context, and ILIAS\GlobalScreen\ScreenContext\ContextRepository\C_REPO.

Field Documentation

◆ $contexts

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

Definition at line 19 of file ContextRepository.php.

◆ C_ADMINISTRATION

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

◆ C_DESKTOP

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

◆ C_LTI

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

◆ C_MAIN

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

◆ C_REPO

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

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