ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\Skill\Usage\UsagesUI Class Reference
+ Collaboration diagram for ILIAS\Skill\Usage\UsagesUI:

Public Member Functions

 __construct (string $cskill_id, array $usage, string $mode="")
 
 render ()
 

Protected Member Functions

 getUsagesListing ()
 

Protected Attributes

ilLanguage $lng
 
UI Factory $ui_fac
 
UI Renderer $ui_ren
 
Tree SkillTreeManager $tree_manager
 
SkillUsageManager $usage_manager
 
ilSkillTreeRepository $tree_repo
 
int $skill_id = 0
 
int $tref_id = 0
 
array $usage = []
 
string $mode = ""
 

Detailed Description

Author
Thomas Famula famul.nosp@m.a@le.nosp@m.ifos..nosp@m.de

Definition at line 29 of file class.UsagesUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Skill\Usage\UsagesUI::__construct ( string  $cskill_id,
array  $usage,
string  $mode = "" 
)

Definition at line 42 of file class.UsagesUI.php.

References $DIC, ILIAS\Skill\Usage\UsagesUI\$mode, ILIAS\Skill\Usage\UsagesUI\$usage, ILIAS\Repository\int(), and ILIAS\Repository\lng().

46  {
47  global $DIC;
48 
49  $this->lng = $DIC->language();
50  $this->ui_fac = $DIC->ui()->factory();
51  $this->ui_ren = $DIC->ui()->renderer();
52  $this->tree_manager = $DIC->skills()->internal()->manager()->getTreeManager();
53  $this->usage_manager = $DIC->skills()->internal()->manager()->getUsageManager();
54  $this->tree_repo = $DIC->skills()->internal()->repo()->getTreeRepo();
55 
56  $id_parts = explode(":", $cskill_id);
57  $this->skill_id = (int) $id_parts[0];
58  $this->tref_id = (int) $id_parts[1];
59  $this->usage = $usage;
60  $this->mode = $mode;
61  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ getUsagesListing()

ILIAS\Skill\Usage\UsagesUI::getUsagesListing ( )
protected

Definition at line 82 of file class.UsagesUI.php.

Referenced by ILIAS\Skill\Usage\UsagesUI\render().

82  : UI\Component\Listing\CharacteristicValue\Text
83  {
84  $types = [];
85  foreach ($this->usage as $type => $type_usages) {
86  $types[$this->usage_manager->getTypeInfoString($type)] = count($type_usages) . " " .
87  $this->usage_manager->getObjTypeString($type);
88  }
89 
90  $listing = $this->ui_fac->listing()->characteristicValue()->text($types);
91 
92  return $listing;
93  }
+ Here is the caller graph for this function:

◆ render()

ILIAS\Skill\Usage\UsagesUI::render ( )

Definition at line 63 of file class.UsagesUI.php.

References ilSkillTreeNode\_lookupTitle(), and ILIAS\Skill\Usage\UsagesUI\getUsagesListing().

63  : string
64  {
65  $tree = $this->tree_repo->getTreeForNodeId($this->skill_id);
66  if ($this->mode === "tree") {
67  $tree_obj = $this->tree_manager->getTree($tree->getTreeId());
68  $title = $tree_obj->getTitle() . " > " . \ilSkillTreeNode::_lookupTitle($this->skill_id, $this->tref_id);
69  } else {
70  $title = \ilSkillTreeNode::_lookupTitle($this->skill_id, $this->tref_id);
71  }
72 
73  //$description = $tree->getSkillTreePathAsString($skill_id, $tref_id);
74 
75  $listing = $this->getUsagesListing();
76 
77  $panel = $this->ui_fac->panel()->standard($title, $listing);
78 
79  return $this->ui_ren->render($panel);
80  }
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ILIAS\Skill\Usage\UsagesUI::$lng
protected

Definition at line 31 of file class.UsagesUI.php.

◆ $mode

string ILIAS\Skill\Usage\UsagesUI::$mode = ""
protected

Definition at line 40 of file class.UsagesUI.php.

Referenced by ILIAS\Skill\Usage\UsagesUI\__construct().

◆ $skill_id

int ILIAS\Skill\Usage\UsagesUI::$skill_id = 0
protected

Definition at line 37 of file class.UsagesUI.php.

◆ $tree_manager

Tree SkillTreeManager ILIAS\Skill\Usage\UsagesUI::$tree_manager
protected

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

◆ $tree_repo

ilSkillTreeRepository ILIAS\Skill\Usage\UsagesUI::$tree_repo
protected

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

◆ $tref_id

int ILIAS\Skill\Usage\UsagesUI::$tref_id = 0
protected

Definition at line 38 of file class.UsagesUI.php.

◆ $ui_fac

UI Factory ILIAS\Skill\Usage\UsagesUI::$ui_fac
protected

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

◆ $ui_ren

UI Renderer ILIAS\Skill\Usage\UsagesUI::$ui_ren
protected

Definition at line 33 of file class.UsagesUI.php.

◆ $usage

array ILIAS\Skill\Usage\UsagesUI::$usage = []
protected

Definition at line 39 of file class.UsagesUI.php.

Referenced by ILIAS\Skill\Usage\UsagesUI\__construct().

◆ $usage_manager

SkillUsageManager ILIAS\Skill\Usage\UsagesUI::$usage_manager
protected

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


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