ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMyStaffGUI Class Reference

Class ilMyStaffGUI. More...

+ Collaboration diagram for ilMyStaffGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 

Static Public Member Functions

static getUserLpStatusAsHtml (ilMStListCourse $my_staff_course)
 
static getUserLpStatusAsText (ilMStListCourse $my_staff_course)
 

Data Fields

const string CMD_INDEX = 'index'
 
const string TAB_LIST_USERS = 'list_users'
 
const string TAB_LIST_COURSES = 'list_courses'
 
const string TAB_LIST_CERTIFICATES = 'list_certificates'
 
const string TAB_LIST_COMPETENCES = 'list_competences'
 
const string TAB_LIST_STUDY_PROGRAMME = 'list_study_programme'
 

Static Protected Member Functions

static addLinkWithActionData (ilUserAction $action)
 

Detailed Description

Class ilMyStaffGUI.

Author
Martin Studer ms@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 26 of file class.ilMyStaffGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMyStaffGUI::__construct ( )

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

References $DIC.

36  {
37  global $DIC;
38 
39  $DIC->language()->loadLanguageModule('mst');
40  $DIC->language()->loadLanguageModule('trac');
41 
42  // get the standard template
43  $DIC->ui()->mainTemplate()->loadStandardTemplate();
44  }
global $DIC
Definition: shib_login.php:22

Member Function Documentation

◆ addLinkWithActionData()

static ilMyStaffGUI::addLinkWithActionData ( ilUserAction  $action)
staticprotected

Definition at line 134 of file class.ilMyStaffGUI.php.

References $DIC, $id, $r, ilUserAction\getData(), ilUserAction\getHref(), ilUserAction\getText(), and ILIAS\UI\Implementation\Component\withAdditionalOnLoadCode().

134  : \ILIAS\UI\Component\Link\Standard
135  {
136  global $DIC;
137 
138  $ui_fac = $DIC->ui()->factory();
139 
140  $action_data = $action->getData();
141  $link = $ui_fac->link()->standard(
142  $action->getText(),
143  $action->getHref()
144  )->withAdditionalOnLoadCode(function ($id) use ($action_data) {
145  $r = "var button = document.getElementById('$id');";
146  foreach ($action_data as $k => $v) {
147  $r .= "button.setAttribute('data-" . $k . "', '" . $v . "');";
148  }
149  return $r;
150  });
151 
152  return $link;
153  }
global $DIC
Definition: shib_login.php:22
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$r
+ Here is the call graph for this function:

◆ executeCommand()

ilMyStaffGUI::executeCommand ( )
final

Definition at line 46 of file class.ilMyStaffGUI.php.

References $DIC, and ilUserActionCollector\getActionsForTargetUser().

46  : void
47  {
48  global $DIC;
49 
50  // determine next class in the call structure
51  $next_class = $DIC->ctrl()->getNextClass($this);
52  switch ($next_class) {
53  case "ilmstlistcoursesgui":
54  $list_gui = new \ilMStListCoursesGUI();
55  $DIC->ctrl()->forwardCommand($list_gui);
56  break;
57  case strtolower(ilMStListCertificatesGUI::class):
58  $list_gui = new ilMStListCertificatesGUI();
59  $DIC->ctrl()->forwardCommand($list_gui);
60  break;
61  case strtolower(ilMStListCompetencesGUI::class):
62  $list_gui = new ilMStListCompetencesGUI($DIC);
63  $DIC->ctrl()->forwardCommand($list_gui);
64  break;
65  // case strtolower(ilMStListStudyProgrammesGUI::class):
66  // $list_gui = new ilMStListStudyProgrammesGUI();
67  // $DIC->ctrl()->forwardCommand($list_gui);
68  // break;
69  case strtolower(ilMStShowUserGUI::class):
70  $user_gui = new ilMStShowUserGUI();
71  $DIC->ctrl()->forwardCommand($user_gui);
72  break;
73  case strtolower(ilEmployeeTalkMyStaffListGUI::class):
74  $user_gui = new ilEmployeeTalkMyStaffListGUI();
75  $DIC->ctrl()->forwardCommand($user_gui);
76  break;
77  default:
78  $list_gui = new ilMStListUsersGUI();
79  $DIC->ctrl()->forwardCommand($list_gui);
80  break;
81  }
82 
83  $DIC->ui()->mainTemplate()->printToStdout();
84  }
Class ilMStShowUserGUI.
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ getUserLpStatusAsHtml()

static ilMyStaffGUI::getUserLpStatusAsHtml ( ilMStListCourse  $my_staff_course)
staticfinal

Definition at line 155 of file class.ilMyStaffGUI.php.

References $DIC, ilLearningProgressBaseGUI\_getStatusText(), ILIAS\MyStaff\ListCourses\ilMStListCourse\getCrsRefId(), ilLPStatusIcons\getInstance(), ILIAS\MyStaff\ListCourses\ilMStListCourse\getUsrLpStatus(), and ilLPStatusIcons\ICON_VARIANT_LONG.

Referenced by ilMStShowUserCoursesTableGUI\fillRow(), and ilMStListCoursesTableGUI\fillRow().

155  : string
156  {
157  global $DIC;
158 
159  if (ilMyStaffAccess::getInstance()->hasCurrentUserAccessToLearningProgressInObject($my_staff_course->getCrsRefId())) {
161  $lp_icon = $DIC->ui()->factory()->symbol()->icon()
162  ->custom(
163  $lp_icons->getImagePathForStatus($my_staff_course->getUsrLpStatus()),
164  ilLearningProgressBaseGUI::_getStatusText(intval($my_staff_course->getUsrLpStatus()))
165  );
166 
167  return $DIC->ui()->renderer()->render($lp_icon) . ' '
168  . ilLearningProgressBaseGUI::_getStatusText(intval($my_staff_course->getUsrLpStatus()));
169  }
170 
171  return '&nbsp';
172  }
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
global $DIC
Definition: shib_login.php:22
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUserLpStatusAsText()

static ilMyStaffGUI::getUserLpStatusAsText ( ilMStListCourse  $my_staff_course)
staticfinal

Definition at line 174 of file class.ilMyStaffGUI.php.

References ilLearningProgressBaseGUI\_getStatusText(), ILIAS\MyStaff\ListCourses\ilMStListCourse\getCrsRefId(), and ILIAS\MyStaff\ListCourses\ilMStListCourse\getUsrLpStatus().

Referenced by ilMStShowUserCoursesTableGUI\getFieldValuesForExport(), and ilMStListCoursesTableGUI\getFieldValuesForExport().

174  : string
175  {
176  if (ilMyStaffAccess::getInstance()->hasCurrentUserAccessToLearningProgressInObject($my_staff_course->getCrsRefId())) {
177  return ilLearningProgressBaseGUI::_getStatusText(intval($my_staff_course->getUsrLpStatus()));
178  }
179 
180  return '';
181  }
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ CMD_INDEX

const string ilMyStaffGUI::CMD_INDEX = 'index'

◆ TAB_LIST_CERTIFICATES

const string ilMyStaffGUI::TAB_LIST_CERTIFICATES = 'list_certificates'

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

◆ TAB_LIST_COMPETENCES

const string ilMyStaffGUI::TAB_LIST_COMPETENCES = 'list_competences'

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

◆ TAB_LIST_COURSES

const string ilMyStaffGUI::TAB_LIST_COURSES = 'list_courses'

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

◆ TAB_LIST_STUDY_PROGRAMME

const string ilMyStaffGUI::TAB_LIST_STUDY_PROGRAMME = 'list_study_programme'

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

◆ TAB_LIST_USERS

const string ilMyStaffGUI::TAB_LIST_USERS = 'list_users'

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


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