ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMStShowUserCompetencesGUI Class Reference

Class ilMStShowUserCompetencesGUI. More...

+ Collaboration diagram for ilMStShowUserCompetencesGUI:

Public Member Functions

 __construct (Container $dic)
 
 executeCommand ()
 

Data Fields

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

Protected Member Functions

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

Protected Attributes

ilTable2GUI $table
 
ilMyStaffAccess $access
 
ILIAS Skill Service SkillPersonalService $skill_personal_service
 

Private Attributes

int $usr_id
 
Container $dic
 
ilGlobalTemplateInterface $main_tpl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMStShowUserCompetencesGUI::__construct ( Container  $dic)

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

40 {
41 global $DIC;
42 $this->main_tpl = $DIC->ui()->mainTemplate();
43 $this->dic = $dic;
44 $this->access = ilMyStaffAccess::getInstance();
45 $this->skill_personal_service = $DIC->skills()->personal();
46
47 $this->usr_id = $this->dic->http()->request()->getQueryParams()['usr_id'];
48 $this->dic->ctrl()->setParameter($this, 'usr_id', $this->usr_id);
49 }
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ addSubTabs()

ilMStShowUserCompetencesGUI::addSubTabs ( string  $active_sub_tab)
protected

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

88 : void
89 {
90 $this->dic->language()->loadLanguageModule('skmg');
91 $this->dic->tabs()->addSubTab(
92 self::SUB_TAB_SKILLS,
93 $this->dic->language()->txt('skmg_selected_skills'),
94 $this->dic->ctrl()->getLinkTarget($this, self::CMD_SHOW_SKILLS)
95 );
96
97 $this->dic->tabs()->activateSubTab($active_sub_tab);
98 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ checkAccessOrFail()

ilMStShowUserCompetencesGUI::checkAccessOrFail ( )
protected

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

51 : void
52 {
53 if (!$this->usr_id) {
54 $this->main_tpl->setOnScreenMessage('failure', $this->dic->language()->txt("permission_denied"), true);
55 $this->dic->ctrl()->redirectByClass(ilDashboardGUI::class, "");
56 }
57
58 if ($this->access->hasCurrentUserAccessToUser($this->usr_id)
59 && $this->access->hasCurrentUserAccessToCompetences()
60 ) {
61 return;
62 } else {
63 $this->main_tpl->setOnScreenMessage('failure', $this->dic->language()->txt("permission_denied"), true);
64 $this->dic->ctrl()->redirectByClass(ilDashboardGUI::class, "");
65 }
66 }

References ILIAS\Repository\access().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilMStShowUserCompetencesGUI::executeCommand ( )
final

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

68 : void
69 {
70 $this->checkAccessOrFail();
71
72 $cmd = $this->dic->ctrl()->getCmd();
73 $next_class = $this->dic->ctrl()->getNextClass();
74
75 switch ($next_class) {
76 default:
77 switch ($cmd) {
78 case self::CMD_INDEX:
80 default:
81 $this->addSubTabs(self::SUB_TAB_SKILLS);
82 $this->showSkills();
83 break;
84 }
85 }
86 }

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

+ Here is the call graph for this function:

◆ showSkills()

ilMStShowUserCompetencesGUI::showSkills ( )
protected

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

100 : void
101 {
102 $skills_gui = new ilPersonalSkillsGUI();
103 $skills = $this->skill_personal_service->getSelectedUserSkills($this->usr_id);
104 $html = '';
105 foreach ($skills as $skill) {
106 $html .= $skills_gui->getSkillHTML($skill->getSkillNodeId(), $this->usr_id);
107 }
108 $this->dic->ui()->mainTemplate()->setContent($html);
109 }
Personal skills GUI class.

Referenced by executeCommand().

+ 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.

◆ $skill_personal_service

ILIAS Skill Service SkillPersonalService ilMStShowUserCompetencesGUI::$skill_personal_service
protected

Definition at line 37 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 string ilMStShowUserCompetencesGUI::CMD_INDEX = self::CMD_SHOW_SKILLS

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

Referenced by executeCommand().

◆ CMD_SHOW_SKILLS

const string ilMStShowUserCompetencesGUI::CMD_SHOW_SKILLS = 'showSkills'

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

Referenced by executeCommand().

◆ SUB_TAB_SKILLS

const string 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: