ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ForumGlobalScreenToolsProvider Class Reference

Class ForumGlobalScreenToolsProvider. More...

+ Inheritance diagram for ForumGlobalScreenToolsProvider:
+ Collaboration diagram for ForumGlobalScreenToolsProvider:

Public Member Functions

 isInterestedInContexts ()
 
 getToolsForContextStack (\ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts $called_contexts)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\Tool\Provider\AbstractDynamicToolProvider
 __construct (Container $dic)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (protected Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\Tool\Provider\DynamicToolProvider
 getToolsForContextStack (CalledContexts $called_contexts)
 

Data Fields

const SHOW_FORUM_THREADS_TOOL = 'show_forum_threads_tool'
 
const REF_ID = 'ref_id'
 
const FORUM_THEAD = 'frm_thread'
 
const FORUM_THREAD_ROOT = 'frm_thread_root'
 
const FORUM_BASE_CONTROLLER = 'frm_base_controller'
 
const PAGE = 'frm_thread_page'
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\Tool\Provider\AbstractDynamicToolProvider
ToolIdentificationProviderInterface $identification_provider
 
ContextCollection $context_collection
 
ToolFactory $factory
 

Detailed Description

Member Function Documentation

◆ getToolsForContextStack()

ForumGlobalScreenToolsProvider::getToolsForContextStack ( \ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts  $called_contexts)

Definition at line 43 of file ForumGlobalScreenToolsProvider.php.

References $id, and factory().

45  : array {
46  $iff = (fn(string $id): IdentificationInterface => $this->identification_provider->contextAwareIdentifier($id));
47  $l = (fn(string $content): Component => $this->dic->ui()->factory()->legacy()->content($content));
48 
49  $tools = [];
50 
51  $additionalData = $called_contexts->getLast()->getAdditionalData();
52  if ($additionalData->exists(self::SHOW_FORUM_THREADS_TOOL) && $additionalData->get(self::SHOW_FORUM_THREADS_TOOL) === true) {
53  $thread = $additionalData->get(self::FORUM_THEAD);
54  $controller = $additionalData->get(self::FORUM_BASE_CONTROLLER);
55  $root = $additionalData->get(self::FORUM_THREAD_ROOT);
56 
57  if ($root instanceof ilForumPost) {
58  $title = $this->dic->language()->txt('forums_articles');
59  $icon = $this->dic->ui()->factory()->symbol()->icon()->standard('frm', $title);
60 
61  $tools[] = $this->factory
62  ->tool($iff('Forum|Tree'))
63  ->withTitle($title)
64  ->withSymbol($icon)
65  ->withContentWrapper(static function () use ($l, $controller, $thread, $root): Component {
66  $exp = new ilForumExplorerGUI(
67  'frm_exp_' . $thread->getId(),
68  $controller,
69  'viewThread',
70  $thread,
71  $root
72  );
73 
74  return $l($exp->getHTML(true));
75  });
76  }
77  }
78 
79  return $tools;
80  }
Class ilForumExplorerGUI.
factory()
legacy()
expected output: > ILIAS shows the rendered Component.
Definition: legacy.php:29
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ isInterestedInContexts()

ForumGlobalScreenToolsProvider::isInterestedInContexts ( )

Field Documentation

◆ FORUM_BASE_CONTROLLER

const ForumGlobalScreenToolsProvider::FORUM_BASE_CONTROLLER = 'frm_base_controller'

Definition at line 35 of file ForumGlobalScreenToolsProvider.php.

Referenced by ilObjForumGUI\viewThreadObject().

◆ FORUM_THEAD

const ForumGlobalScreenToolsProvider::FORUM_THEAD = 'frm_thread'

Definition at line 33 of file ForumGlobalScreenToolsProvider.php.

Referenced by ilObjForumGUI\viewThreadObject().

◆ FORUM_THREAD_ROOT

const ForumGlobalScreenToolsProvider::FORUM_THREAD_ROOT = 'frm_thread_root'

Definition at line 34 of file ForumGlobalScreenToolsProvider.php.

Referenced by ilObjForumGUI\viewThreadObject().

◆ PAGE

const ForumGlobalScreenToolsProvider::PAGE = 'frm_thread_page'

Definition at line 36 of file ForumGlobalScreenToolsProvider.php.

Referenced by ilObjForumGUI\viewThreadObject().

◆ REF_ID

const ForumGlobalScreenToolsProvider::REF_ID = 'ref_id'

Definition at line 32 of file ForumGlobalScreenToolsProvider.php.

Referenced by ilObjForumGUI\viewThreadObject().

◆ SHOW_FORUM_THREADS_TOOL

const ForumGlobalScreenToolsProvider::SHOW_FORUM_THREADS_TOOL = 'show_forum_threads_tool'

Definition at line 31 of file ForumGlobalScreenToolsProvider.php.

Referenced by ilObjForumGUI\viewThreadObject().


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