ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
 $identification_provider
 
 $context_collection
 
 $factory
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 $dic
 

Detailed Description

Member Function Documentation

◆ getToolsForContextStack()

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

Definition at line 31 of file ForumGlobalScreenToolsProvider.php.

References ilForumExplorerGUI\setCurrentPage().

31  : array
32  {
33  $iff = function ($id) {
34  return $this->identification_provider->contextAwareIdentifier($id);
35  };
36  $l = function (string $content) {
37  return $this->dic->ui()->factory()->legacy($content);
38  };
39 
40  $tools = [];
41 
42  $additionalData = $called_contexts->getLast()->getAdditionalData();
43  if ($additionalData->exists(self::SHOW_FORUM_THREADS_TOOL) && $additionalData->get(self::SHOW_FORUM_THREADS_TOOL) === true) {
44  $thread = $additionalData->get(self::FORUM_THEAD);
45  $controller = $additionalData->get(self::FORUM_BASE_CONTROLLER);
46  $root = $additionalData->get(self::FORUM_THREAD_ROOT);
47 
48  if ($root instanceof ilForumPost) {
49  $title = $this->dic->language()->txt('tree');
50  $icon = $this->dic->ui()->factory()->symbol()->icon()->standard('frm', $title)->withIsOutlined(true);
51 
52  $tools[] = $this->factory
53  ->tool($iff('Forum|Tree'))
54  ->withTitle($title)
55  ->withSymbol($icon)
56  ->withContentWrapper(static function () use ($l, $controller, $thread, $root, $additionalData) {
57  $exp = new ilForumExplorerGUI(
58  'frm_exp_' . $thread->getId(),
59  $controller,
60  'viewThread',
61  $thread,
62  $root
63  );
64 
65  $exp->setCurrentPage((int) $additionalData->get(self::PAGE));
66 
67  return $l($exp->getHTML(true));
68  });
69  }
70  }
71 
72  return $tools;
73  }
setCurrentPage(int $currentPage)
Class ilForumExplorerGUI.
+ 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 16 of file ForumGlobalScreenToolsProvider.php.

Referenced by ilObjForumGUI\checkUsersViewMode().

◆ FORUM_THEAD

const ForumGlobalScreenToolsProvider::FORUM_THEAD = 'frm_thread'

Definition at line 14 of file ForumGlobalScreenToolsProvider.php.

Referenced by ilObjForumGUI\checkUsersViewMode().

◆ FORUM_THREAD_ROOT

const ForumGlobalScreenToolsProvider::FORUM_THREAD_ROOT = 'frm_thread_root'

Definition at line 15 of file ForumGlobalScreenToolsProvider.php.

Referenced by ilObjForumGUI\checkUsersViewMode().

◆ PAGE

const ForumGlobalScreenToolsProvider::PAGE = 'frm_thread_page'

Definition at line 17 of file ForumGlobalScreenToolsProvider.php.

Referenced by ilObjForumGUI\checkUsersViewMode().

◆ REF_ID

const ForumGlobalScreenToolsProvider::REF_ID = 'ref_id'

Definition at line 13 of file ForumGlobalScreenToolsProvider.php.

Referenced by ilObjForumGUI\checkUsersViewMode().

◆ SHOW_FORUM_THREADS_TOOL

const ForumGlobalScreenToolsProvider::SHOW_FORUM_THREADS_TOOL = 'show_forum_threads_tool'

Definition at line 12 of file ForumGlobalScreenToolsProvider.php.

Referenced by ilObjForumGUI\checkUsersViewMode().


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