ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMStShowUserCompetencesGUI Class Reference

Class ilMStShowUserCompetencesGUI. More...

+ Collaboration diagram for ilMStShowUserCompetencesGUI:

Public Member Functions

 __construct (Container $dic)
 
 executeCommand ()
 

Data Fields

const CMD_SHOW_SKILLS = 'showSkills'
 
const CMD_INDEX = self::CMD_SHOW_SKILLS
 
const SUB_TAB_SKILLS = 'skills'
 

Protected Member Functions

 checkAccessOrFail ()
 
 addSubTabs (string $active_sub_tab)
 
 showSkills ()
 

Protected Attributes

ilTable2GUI $table
 
ilMyStaffAccess $access
 

Private Attributes

int $usr_id
 
Container $dic
 
ilGlobalTemplateInterface $main_tpl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMStShowUserCompetencesGUI::__construct ( Container  $dic)

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

References $DIC, $dic, and ILIAS\Repository\access().

39  {
40  global $DIC;
41  $this->main_tpl = $DIC->ui()->mainTemplate();
42  $this->dic = $dic;
43  $this->access = ilMyStaffAccess::getInstance();
44 
45  $this->usr_id = $this->dic->http()->request()->getQueryParams()['usr_id'];
46  $this->dic->ctrl()->setParameter($this, 'usr_id', $this->usr_id);
47  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ addSubTabs()

ilMStShowUserCompetencesGUI::addSubTabs ( string  $active_sub_tab)
protected

Definition at line 86 of file class.ilMStShowUserCompetencesGUI.php.

Referenced by executeCommand().

86  : void
87  {
88  $this->dic->language()->loadLanguageModule('skmg');
89  $this->dic->tabs()->addSubTab(
90  self::SUB_TAB_SKILLS,
91  $this->dic->language()->txt('skmg_selected_skills'),
92  $this->dic->ctrl()->getLinkTarget($this, self::CMD_SHOW_SKILLS)
93  );
94 
95  $this->dic->tabs()->activateSubTab($active_sub_tab);
96  }
+ Here is the caller graph for this function:

◆ checkAccessOrFail()

ilMStShowUserCompetencesGUI::checkAccessOrFail ( )
protected

Definition at line 49 of file class.ilMStShowUserCompetencesGUI.php.

References ILIAS\Repository\access().

Referenced by executeCommand().

49  : void
50  {
51  if (!$this->usr_id) {
52  $this->main_tpl->setOnScreenMessage('failure', $this->dic->language()->txt("permission_denied"), true);
53  $this->dic->ctrl()->redirectByClass(ilDashboardGUI::class, "");
54  }
55 
56  if ($this->access->hasCurrentUserAccessToUser($this->usr_id)
57  && $this->access->hasCurrentUserAccessToCompetences()
58  ) {
59  return;
60  } else {
61  $this->main_tpl->setOnScreenMessage('failure', $this->dic->language()->txt("permission_denied"), true);
62  $this->dic->ctrl()->redirectByClass(ilDashboardGUI::class, "");
63  }
64  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilMStShowUserCompetencesGUI::executeCommand ( )
final

Definition at line 66 of file class.ilMStShowUserCompetencesGUI.php.

References addSubTabs(), checkAccessOrFail(), and showSkills().

66  : void
67  {
68  $this->checkAccessOrFail();
69 
70  $cmd = $this->dic->ctrl()->getCmd();
71  $next_class = $this->dic->ctrl()->getNextClass();
72 
73  switch ($next_class) {
74  default:
75  switch ($cmd) {
76  case self::CMD_INDEX:
77  case self::CMD_SHOW_SKILLS:
78  default:
79  $this->addSubTabs(self::SUB_TAB_SKILLS);
80  $this->showSkills();
81  break;
82  }
83  }
84  }
+ Here is the call graph for this function:

◆ showSkills()

ilMStShowUserCompetencesGUI::showSkills ( )
protected

Definition at line 98 of file class.ilMStShowUserCompetencesGUI.php.

References ilPersonalSkill\getSelectedUserSkills().

Referenced by executeCommand().

98  : void
99  {
100  $skills_gui = new ilPersonalSkillsGUI();
101  $skills = ilPersonalSkill::getSelectedUserSkills($this->usr_id);
102  $html = '';
103  foreach ($skills as $skill) {
104  $html .= $skills_gui->getSkillHTML($skill["skill_node_id"], $this->usr_id);
105  }
106  $this->dic->ui()->mainTemplate()->setContent($html);
107  }
Personal skills GUI class.
static getSelectedUserSkills(int $a_user_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilMyStaffAccess ilMStShowUserCompetencesGUI::$access
protected

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

◆ $dic

Container ilMStShowUserCompetencesGUI::$dic
private

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

Referenced by __construct().

◆ $main_tpl

ilGlobalTemplateInterface ilMStShowUserCompetencesGUI::$main_tpl
private

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

◆ $table

ilTable2GUI ilMStShowUserCompetencesGUI::$table
protected

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

◆ $usr_id

int ilMStShowUserCompetencesGUI::$usr_id
private

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

◆ CMD_INDEX

const ilMStShowUserCompetencesGUI::CMD_INDEX = self::CMD_SHOW_SKILLS

Definition at line 30 of file class.ilMStShowUserCompetencesGUI.php.

◆ CMD_SHOW_SKILLS

const ilMStShowUserCompetencesGUI::CMD_SHOW_SKILLS = 'showSkills'

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

◆ SUB_TAB_SKILLS

const ilMStShowUserCompetencesGUI::SUB_TAB_SKILLS = 'skills'

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


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