ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 35 of file ContextRepository.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 47 of file ContextRepository.php.

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

48  {
49  global $DIC;
50  $this->wrapper = $DIC->http()->wrapper();
51  $this->refinery = $DIC->refinery();
52  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ administration()

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

Definition at line 87 of file ContextRepository.php.

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

◆ desktop()

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

Definition at line 69 of file ContextRepository.php.

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

◆ external()

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

Definition at line 64 of file ContextRepository.php.

64  : ScreenContext
65  {
66  return $this->get(BasicScreenContext::class, 'external');
67  }

◆ get()

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

Definition at line 97 of file ContextRepository.php.

97  : ScreenContext
98  {
99  if (!isset($this->contexts[$identifier])) {
100  $this->contexts[$identifier] = new $class_name($identifier);
101  }
102 
103  return $this->contexts[$identifier];
104  }

◆ lti()

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

Definition at line 92 of file ContextRepository.php.

92  : ScreenContext
93  {
94  return $this->get(BasicScreenContext::class, self::C_LTI);
95  }

◆ main()

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

Definition at line 54 of file ContextRepository.php.

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

◆ repository()

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

Definition at line 74 of file ContextRepository.php.

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

74  : ScreenContext
75  {
76  $context = $this->get(BasicScreenContext::class, self::C_REPO);
77  $ref_id = $this->wrapper->query()->has('ref_id')
78  ? $this->wrapper->query()->retrieve('ref_id', $this->refinery->kindlyTo()->int())
79  : null;
80  if ($ref_id) {
81  $context = $context->withReferenceId(new ReferenceId($ref_id));
82  }
83 
84  return $context;
85  }
$context
Definition: webdav.php:31
$ref_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:

Field Documentation

◆ $contexts

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

Definition at line 37 of file ContextRepository.php.

◆ $refinery

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

Definition at line 45 of file ContextRepository.php.

◆ $wrapper

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

Definition at line 44 of file ContextRepository.php.

◆ C_ADMINISTRATION

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

Definition at line 41 of file ContextRepository.php.

◆ C_DESKTOP

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

Definition at line 39 of file ContextRepository.php.

◆ C_LTI

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

Definition at line 42 of file ContextRepository.php.

◆ C_MAIN

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

Definition at line 38 of file ContextRepository.php.

◆ C_REPO

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

Definition at line 40 of file ContextRepository.php.


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