ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 CMD_INDEX = 'index'
 
const TAB_LIST_USERS = 'list_users'
 
const TAB_LIST_COURSES = 'list_courses'
 

Protected Member Functions

 addTabs ($active_tab_id)
 

Detailed Description

Class ilMyStaffGUI.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilMyStaffGUI::__construct ( )

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

References $DIC.

19  {
20  global $DIC;
21 
22  $DIC->language()->loadLanguageModule('mst');
23  $DIC->language()->loadLanguageModule('trac');
24 
25  // get the standard template
26  $DIC->ui()->mainTemplate()->getStandardTemplate();
27  $DIC->ui()->mainTemplate()->setTitle($DIC->language()->txt('mst_my_staff'));
28  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ addTabs()

ilMyStaffGUI::addTabs (   $active_tab_id)
protected
Parameters
string$active_tab_id

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

References $action, $DIC, ilAdvancedSelectionListGUI\addItem(), and ilUserActionCollector\getInstance().

Referenced by executeCommand().

66  {
67  global $DIC;
68 
69  $DIC->tabs()->addTab(self::TAB_LIST_USERS, $DIC->language()->txt('mst_list_users'), $DIC->ctrl()->getLinkTargetByClass(array(
70  self::class,
71  ilMStListUsersGUI::class,
72  ), self::CMD_INDEX));
73  $DIC->tabs()->addTab(self::TAB_LIST_COURSES, $DIC->language()->txt('mst_list_courses'), $DIC->ctrl()->getLinkTargetByClass(array(
74  self::class,
75  ilMStListCoursesGUI::class,
76  ), self::CMD_INDEX));
77 
78  if ($active_tab_id) {
79  $DIC->tabs()->activateTab($active_tab_id);
80  }
81  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilMyStaffGUI::executeCommand ( )

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

References $DIC, and addTabs().

35  {
36  global $DIC;
37 
38  // determine next class in the call structure
39  $next_class = $DIC->ctrl()->getNextClass($this);
40 
41  switch ($next_class) {
42  case strtolower(ilMStListCoursesGUI::class):
43  $this->addTabs(self::TAB_LIST_COURSES);
44  $list_course_gui = new ilMStListCoursesGUI();
45  $DIC->ctrl()->forwardCommand($list_course_gui);
46  break;
47  case strtolower(ilMStShowUserGUI::class):
48  $list_course_gui = new ilMStShowUserGUI();
49  $DIC->ctrl()->forwardCommand($list_course_gui);
50  break;
51  default:
52  $this->addTabs(self::TAB_LIST_USERS);
53  $list_user_gui = new ilMStListUsersGUI();
54  $DIC->ctrl()->forwardCommand($list_user_gui);
55  break;
56  }
57 
58  $DIC->ui()->mainTemplate()->show();
59  }
global $DIC
Definition: saml.php:7
Class ilMStShowUserGUI.
addTabs($active_tab_id)
Class ilMStListCoursesGUI.
Class ilMStListUsersGUI.
+ Here is the call graph for this function:

◆ getUserLpStatusAsHtml()

static ilMyStaffGUI::getUserLpStatusAsHtml ( ilMStListCourse  $my_staff_course)
static
Parameters
ilMStListCourse$my_staff_course
Returns
string

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

References $DIC, ilLearningProgressBaseGUI\_getImagePathForStatus(), ilLearningProgressBaseGUI\_getStatusText(), ilMStListCourse\getCrsRefId(), ilMyStaffAccess\getInstance(), and ilMStListCourse\getUsrLpStatus().

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

131  {
132  global $DIC;
133 
134  if (ilMyStaffAccess::getInstance()->hasCurrentUserAccessToLearningProgressInObject($my_staff_course->getCrsRefId())) {
135  $lp_icon = $DIC->ui()->factory()->image()
137 
138  return $DIC->ui()->renderer()->render($lp_icon) . ' '
139  . ilLearningProgressBaseGUI::_getStatusText(intval($my_staff_course->getUsrLpStatus()));
140  }
141 
142  return '&nbsp';
143  }
static _getImagePathForStatus($a_status)
Get image path for status.
global $DIC
Definition: saml.php:7
static _getStatusText($a_status, $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)
static
Parameters
ilMStListCourse$my_staff_course
Returns
string

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

References ilLearningProgressBaseGUI\_getStatusText(), ilMStListCourse\getCrsRefId(), ilMyStaffAccess\getInstance(), and ilMStListCourse\getUsrLpStatus().

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

152  {
153  if (ilMyStaffAccess::getInstance()->hasCurrentUserAccessToLearningProgressInObject($my_staff_course->getCrsRefId())) {
154  return ilLearningProgressBaseGUI::_getStatusText(intval($my_staff_course->getUsrLpStatus()));
155  }
156 
157  return '';
158  }
static _getStatusText($a_status, $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 ilMyStaffGUI::CMD_INDEX = 'index'

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

Referenced by ilMStListUsersTableGUI\getProfileBackUrl().

◆ TAB_LIST_COURSES

const ilMyStaffGUI::TAB_LIST_COURSES = 'list_courses'

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

◆ TAB_LIST_USERS

const ilMyStaffGUI::TAB_LIST_USERS = 'list_users'

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


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