ILIAS  release_8 Revision v8.24
ForumGlobalScreenToolsProvider.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
24
30{
31 public const SHOW_FORUM_THREADS_TOOL = 'show_forum_threads_tool';
32 public const REF_ID = 'ref_id';
33 public const FORUM_THEAD = 'frm_thread';
34 public const FORUM_THREAD_ROOT = 'frm_thread_root';
35 public const FORUM_BASE_CONTROLLER = 'frm_base_controller';
36 public const PAGE = 'frm_thread_page';
37
38 public function isInterestedInContexts(): \ILIAS\GlobalScreen\ScreenContext\Stack\ContextCollection
39 {
40 return $this->context_collection->main()->repository()->administration();
41 }
42
43 public function getToolsForContextStack(
44 \ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts $called_contexts
45 ): array {
46 $iff = function (string $id): IdentificationInterface {
47 return $this->identification_provider->contextAwareIdentifier($id);
48 };
49 $l = function (string $content): Component {
50 return $this->dic->ui()->factory()->legacy($content);
51 };
52
53 $tools = [];
54
55 $additionalData = $called_contexts->getLast()->getAdditionalData();
56 if ($additionalData->exists(self::SHOW_FORUM_THREADS_TOOL) && $additionalData->get(self::SHOW_FORUM_THREADS_TOOL) === true) {
57 $thread = $additionalData->get(self::FORUM_THEAD);
58 $controller = $additionalData->get(self::FORUM_BASE_CONTROLLER);
59 $root = $additionalData->get(self::FORUM_THREAD_ROOT);
60
61 if ($root instanceof ilForumPost) {
62 $title = $this->dic->language()->txt('forums_articles');
63 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard('frm', $title);
64
65 $tools[] = $this->factory
66 ->tool($iff('Forum|Tree'))
67 ->withTitle($title)
68 ->withSymbol($icon)
69 ->withContentWrapper(static function () use ($l, $controller, $thread, $root): Component {
70 $exp = new ilForumExplorerGUI(
71 'frm_exp_' . $thread->getId(),
72 $controller,
73 'viewThread',
74 $thread,
75 $root
76 );
77
78 return $l($exp->getHTML(true));
79 });
80 }
81 }
82
83 return $tools;
84 }
85}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static return function(ContainerConfigurator $containerConfigurator)
Definition: basic_rector.php:9
Class ForumGlobalScreenToolsProvider.
getToolsForContextStack(\ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts $called_contexts)
Class ilForumExplorerGUI.
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
A component is the most general form of an entity in the UI.
Definition: Component.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.