forked from ILIAS-eLearning/ILIAS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgs_content.php
More file actions
35 lines (24 loc) · 979 Bytes
/
gs_content.php
File metadata and controls
35 lines (24 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php namespace ILIAS\GlobalScreen\Client;
require_once('./libs/composer/vendor/autoload.php');
use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
class ContentRenderer
{
use Hasher;
public function run()
{
\ilInitialisation::initILIAS();
global $DIC;
$DIC->ctrl()->setTargetScript("/ilias.php");
$GS = $DIC->globalScreen();
$GS->collector()->mainmenu()->collectStructure();
$GS->collector()->mainmenu()->prepareItemsForUIRepresentation();
$unhash = $this->unhash($_GET['item']);
$identification = $GS->identification()->fromSerializedIdentification($unhash);
$item = $GS->collector()->mainmenu()->getSingleItem($identification);
$component = $item->getTypeInformation()->getRenderer()->getComponentForItem($item, true);
echo $DIC->ui()->renderer()->renderAsync($component);
}
}
if (php_sapi_name() !== 'cli') {
(new ContentRenderer())->run();
}