ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilSkillGSToolProvider Class Reference

Workspace GS tool provider. More...

+ Inheritance diagram for ilSkillGSToolProvider:
+ Collaboration diagram for ilSkillGSToolProvider:

Public Member Functions

 isInterestedInContexts ()
 
 getToolsForContextStack (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 ()
 

Data Fields

const SHOW_SKILL_TREE = 'show_skill_tree'
 
const SHOW_TEMPLATE_TREE = 'show_template_tree'
 
const SKILL_TREE_ID = 'skill_tree_id'
 

Private Member Functions

 getSkillTree (int $tree_id)
 
 getTemplateTree (int $tree_id)
 

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

Workspace GS tool provider.

Author
Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..com

Definition at line 32 of file class.ilSkillGSToolProvider.php.

Member Function Documentation

◆ getSkillTree()

ilSkillGSToolProvider::getSkillTree ( int  $tree_id)
private

Definition at line 89 of file class.ilSkillGSToolProvider.php.

Referenced by getToolsForContextStack().

89  : string
90  {
91  $exp = new ilSkillTreeExplorerGUI(["ilAdministrationGUI", "ilObjSkillManagementGUI",
92  "ilSkillTreeAdminGUI", "ilObjSkillTreeGUI"], "showTree", $tree_id);
93 
94  return $exp->getHTML();
95  }
Explorer class that works on tree objects (Services/Tree)
+ Here is the caller graph for this function:

◆ getTemplateTree()

ilSkillGSToolProvider::getTemplateTree ( int  $tree_id)
private

Definition at line 97 of file class.ilSkillGSToolProvider.php.

Referenced by getToolsForContextStack().

97  : string
98  {
99  $exp = new ilSkillTemplateTreeExplorerGUI(["ilAdministrationGUI", "ilObjSkillManagementGUI",
100  "ilSkillTreeAdminGUI", "ilObjSkillTreeGUI"], "showTree", $tree_id);
101 
102  return $exp->getHTML();
103  }
Explorer class that works on tree objects (Services/Tree)
+ Here is the caller graph for this function:

◆ getToolsForContextStack()

ilSkillGSToolProvider::getToolsForContextStack ( CalledContexts  $called_contexts)

Implements ILIAS\GlobalScreen\Scope\Tool\Provider\DynamicToolProvider.

Definition at line 51 of file class.ilSkillGSToolProvider.php.

References $lang, ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), ilUtil\getImagePath(), getSkillTree(), and getTemplateTree().

51  : array
52  {
53  $lang = $this->dic->language();
54 
55  $lang->loadLanguageModule("skill");
56 
57  $title = $lang->txt("skmg_skills");
58 
59  $tools = [];
60 
61  $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(\ilUtil::getImagePath("standard/icon_skmg.svg"), $title);
62 
63  $additional_data = $called_contexts->current()->getAdditionalData();
64  if ($additional_data->is(self::SHOW_SKILL_TREE, true)) {
65  $tree_id = $additional_data->get(self::SKILL_TREE_ID);
66  $tools[] = $this->factory->tool($this->identification_provider->contextAwareIdentifier("tree"))
67  ->withTitle($title)
68  ->withSymbol($icon)
69  ->withContentWrapper(function () use ($tree_id): Legacy {
70  return $this->dic->ui()->factory()->legacy($this->getSkillTree($tree_id));
71  });
72  }
73 
74  $title = $lang->txt("skmg_skill_templates");
75  $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(\ilUtil::getImagePath("standard/icon_skmg.svg"), $title);
76 
77  if ($additional_data->is(self::SHOW_TEMPLATE_TREE, true)) {
78  $tree_id = $additional_data->get(self::SKILL_TREE_ID);
79  $tools[] = $this->factory->tool($this->identification_provider->contextAwareIdentifier("tree"))
80  ->withTitle("Templates")
81  ->withSymbol($icon)
82  ->withContentWrapper(function () use ($tree_id): Legacy {
83  return $this->dic->ui()->factory()->legacy($this->getTemplateTree($tree_id));
84  });
85  }
86  return $tools;
87  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
$lang
Definition: xapiexit.php:26
+ Here is the call graph for this function:

◆ isInterestedInContexts()

ilSkillGSToolProvider::isInterestedInContexts ( )

Field Documentation

◆ SHOW_SKILL_TREE

const ilSkillGSToolProvider::SHOW_SKILL_TREE = 'show_skill_tree'

Definition at line 34 of file class.ilSkillGSToolProvider.php.

Referenced by ilObjSkillTreeGUI\showTree().

◆ SHOW_TEMPLATE_TREE

const ilSkillGSToolProvider::SHOW_TEMPLATE_TREE = 'show_template_tree'

Definition at line 35 of file class.ilSkillGSToolProvider.php.

Referenced by ilObjSkillTreeGUI\showTree().

◆ SKILL_TREE_ID

const ilSkillGSToolProvider::SKILL_TREE_ID = 'skill_tree_id'

Definition at line 36 of file class.ilSkillGSToolProvider.php.

Referenced by ilObjSkillTreeGUI\showTree().


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