ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 (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
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
Container $dic
 

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.

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  }
Class ilForumExplorerGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ 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: