ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilPDStudyProgrammeSimpleListGUI Class Reference

Personal Desktop-Presentation for the Study Programme. More...

+ Inheritance diagram for ilPDStudyProgrammeSimpleListGUI:
+ Collaboration diagram for ilPDStudyProgrammeSimpleListGUI:

Public Member Functions

 __construct ()
 
 getHTML ()
 
 getDataSectionContent ()
 
 fillDataSection ()
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 Constructor. More...
 
 addHeaderLink ($a_href, $a_text, $status=true)
 
 getHeaderLinks ()
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setBigMode ($a_bigmode)
 Set Big Mode. More...
 
 getBigMode ()
 Get Big Mode. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels. More...
 
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 getCurrentDetailLevel ()
 Get Current Detail Level. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setImage ($a_image)
 Set Image. More...
 
 getImage ()
 Get Image. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info. More...
 
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands ($a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setColSpan ($a_colspan)
 Set Columns Span. More...
 
 getColSpan ()
 Get Columns Span. More...
 
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow. More...
 
 getEnableDetailRow ()
 Get EnableDetailRow. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getDetailParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand ($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command. More...
 
 getHeaderCommands ()
 Get Header Block commands. More...
 
 addFooterLink ($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
 Add a footer text/link. More...
 
 getFooterLinks ()
 Get footer links. More...
 
 clearFooterLinks ()
 Clear footer links. More...
 
 handleDetailLevel ()
 Handle read/write current detail level. More...
 
 getHTML ()
 Handle config status. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links. More...
 
 fillDetailRow ()
 Fill Detail Setting Row. More...
 

Static Public Member Functions

static getBlockType ()
 
static isRepositoryObject ()
 
- Static Public Member Functions inherited from ilBlockGUI
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Data Fields

const BLOCK_TYPE = "prgsimplelist"
 

Protected Member Functions

 userHasVisibleStudyProgrammes ()
 
 userHasReadableStudyProgrammes ()
 
 readVisibleOnPDMode ()
 
 hasPermission (ilStudyProgrammeUserAssignment $assignment, $permission)
 
 readToShowInfoMessage ()
 
 isVisible (ilStudyProgrammeUserAssignment $assignment)
 
 isReadable (ilStudyProgrammeUserAssignment $assignment)
 
 shouldShowThisList ()
 
 readUsersAssignments ()
 
 new_ilStudyProgrammeAssignmentListGUI (ilStudyProgrammeUserAssignment $a_assignment)
 
- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

Protected Attributes

 $il_lng
 
 $il_user
 
 $il_access
 
 $il_setting
 
 $users_assignments
 
 $visible_on_pd_mode
 
 $show_info_message
 
- Protected Attributes inherited from ilBlockGUI
 $data = array()
 
 $colspan = 1
 
 $enablenuminfo = true
 
 $detail_min = 0
 
 $detail_max = 0
 
 $bigmode = false
 
 $footer_links = array()
 
 $block_id = 0
 
 $header_commands = array()
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $enabledetailrow = true
 
 $header_links = array()
 
 $footerinfo = false
 
 $footerinfo_icon = false
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $dropdown
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilPDStudyProgrammeSimpleListGUI::__construct ( )

Definition at line 54 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References $DIC, $ilSetting, $ilUser, $lng, ilLoggerFactory\getLogger(), readToShowInfoMessage(), readUsersAssignments(), readVisibleOnPDMode(), ilBlockGUI\setTitle(), shouldShowThisList(), and userHasReadableStudyProgrammes().

54  {
55  global $DIC;
56  $lng = $DIC['lng'];
57  $ilUser = $DIC['ilUser'];
58  $ilAccess = $DIC['ilAccess'];
59  $ilSetting = $DIC['ilSetting'];
60  $this->il_lng = $lng;
61  $this->il_user = $ilUser;
62  $this->il_access = $ilAccess;
63  $this->il_setting = $ilSetting;
64  $this->il_logger = ilLoggerFactory::getLogger('prg');
65 
66  // No need to load data, as we won't display this.
67  if (!$this->shouldShowThisList()) {
68  return;
69  }
70 
71  $this->readUsersAssignments();
72  //check which kind of option is selected in settings
73  $this->readVisibleOnPDMode();
74  //check to display info message if option "read" is selected
75  $this->readToShowInfoMessage();
76 
77  // As this won't be visible we don't have to initialize this.
78  if (!$this->userHasReadableStudyProgrammes()) {
79  return;
80  }
81 
82  $this->setTitle($this->il_lng->txt("objs_prg"));
83  }
setTitle($a_title)
Set Title.
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
global $lng
Definition: privfeed.php:17
global $DIC
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

Member Function Documentation

◆ fillDataSection()

ilPDStudyProgrammeSimpleListGUI::fillDataSection ( )

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

References getDataSectionContent(), and userHasReadableStudyProgrammes().

130  {
131  assert($this->userHasReadableStudyProgrammes()); // We should not get here.
132  $this->tpl->setVariable("BLOCK_ROW", $this->getDataSectionContent());
133  }
+ Here is the call graph for this function:

◆ getBlockType()

static ilPDStudyProgrammeSimpleListGUI::getBlockType ( )
static

Definition at line 122 of file class.ilPDStudyProgrammeSimpleListGUI.php.

122  {
123  return self::BLOCK_TYPE;
124  }

◆ getDataSectionContent()

ilPDStudyProgrammeSimpleListGUI::getDataSectionContent ( )

Definition at line 99 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References isReadable(), and new_ilStudyProgrammeAssignmentListGUI().

Referenced by fillDataSection().

99  {
100  $content = "";
101  foreach ($this->users_assignments as $assignment) {
102  if(!$this->isReadable($assignment)) {
103  continue;
104  }
105 
106  try {
107  $list_item = $this->new_ilStudyProgrammeAssignmentListGUI($assignment);
108  $list_item->setShowInfoMessage($this->show_info_message);
109  $list_item->setVisibleOnPDMode($this->visible_on_pd_mode);
110  $content .= $list_item->getHTML();
111  }
113  $this->il_logger->alert("$e");
114  }
116  $this->il_logger->alert("$e");
117  }
118  }
119  return $content;
120  }
isReadable(ilStudyProgrammeUserAssignment $assignment)
Exception is thrown when a progress for some programme node and assignment is missing.
new_ilStudyProgrammeAssignmentListGUI(ilStudyProgrammeUserAssignment $a_assignment)
Exception is thrown when invariants on the program tree would be violated by manipulation of tree...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilPDStudyProgrammeSimpleListGUI::getHTML ( )

Definition at line 85 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References shouldShowThisList(), and userHasReadableStudyProgrammes().

85  {
86  // TODO: This should be determined from somewhere up in the hierarchy, as
87  // this will lead to problems, when e.g. a command changes. But i don't see
88  // how atm...
89  if (!$this->shouldShowThisList()) {
90  return "";
91  }
92 
93  if (!$this->userHasReadableStudyProgrammes()) {
94  return "";
95  }
96  return parent::getHTML();
97  }
+ Here is the call graph for this function:

◆ hasPermission()

ilPDStudyProgrammeSimpleListGUI::hasPermission ( ilStudyProgrammeUserAssignment  $assignment,
  $permission 
)
protected

Definition at line 164 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References ilStudyProgrammeUserAssignment\getStudyProgramme().

Referenced by isReadable(), and isVisible().

164  {
165  $prg = $assignment->getStudyProgramme();
166  return $this->il_access->checkAccess($permission, "", $prg->getRefId(), "prg", $prg->getId());
167  }
getStudyProgramme()
Get the program node where this assignment was made.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isReadable()

ilPDStudyProgrammeSimpleListGUI::isReadable ( ilStudyProgrammeUserAssignment  $assignment)
protected

Definition at line 177 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References hasPermission(), and ilObjStudyProgrammeAdmin\SETTING_VISIBLE_ON_PD_ALLWAYS.

Referenced by getDataSectionContent(), and userHasReadableStudyProgrammes().

177  {
178  if($this->visible_on_pd_mode == ilObjStudyProgrammeAdmin::SETTING_VISIBLE_ON_PD_ALLWAYS){
179  return true;
180  }
181 
182  return $this->hasPermission($assignment,"read");
183  }
hasPermission(ilStudyProgrammeUserAssignment $assignment, $permission)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRepositoryObject()

static ilPDStudyProgrammeSimpleListGUI::isRepositoryObject ( )
static

Definition at line 126 of file class.ilPDStudyProgrammeSimpleListGUI.php.

126  {
127  return false;
128  }

◆ isVisible()

ilPDStudyProgrammeSimpleListGUI::isVisible ( ilStudyProgrammeUserAssignment  $assignment)
protected

Definition at line 173 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References hasPermission().

Referenced by userHasVisibleStudyProgrammes().

173  {
174  return $this->hasPermission($assignment,"visible");
175  }
hasPermission(ilStudyProgrammeUserAssignment $assignment, $permission)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ new_ilStudyProgrammeAssignmentListGUI()

ilPDStudyProgrammeSimpleListGUI::new_ilStudyProgrammeAssignmentListGUI ( ilStudyProgrammeUserAssignment  $a_assignment)
protected

Definition at line 198 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References ilStudyProgrammeUserAssignment\getId(), and ilStudyProgrammeUserAssignment\getStudyProgramme().

Referenced by getDataSectionContent().

198  {
199  require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeProgressListGUI.php");
200  $progress = $a_assignment->getStudyProgramme()->getProgressForAssignment($a_assignment->getId());
201  $progress_gui = new ilStudyProgrammeProgressListGUI($progress);
202  $progress_gui->setOnlyRelevant(true);
203  return $progress_gui;
204  }
getStudyProgramme()
Get the program node where this assignment was made.
Class ilStudyProgrammeProgressListGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readToShowInfoMessage()

ilPDStudyProgrammeSimpleListGUI::readToShowInfoMessage ( )
protected

Definition at line 169 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References $_GET, and ilPDSelectedItemsBlockGUI\VIEW_MY_STUDYPROGRAMME.

Referenced by __construct().

169  {
170  $this->show_info_message = ($_GET['view'] == ilPDSelectedItemsBlockGUI::VIEW_MY_STUDYPROGRAMME);
171  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ readUsersAssignments()

ilPDStudyProgrammeSimpleListGUI::readUsersAssignments ( )
protected

Definition at line 193 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References ilStudyProgrammeUserAssignment\getInstancesOfUser().

Referenced by __construct().

193  {
194  require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeUserAssignment.php");
195  $this->users_assignments = ilStudyProgrammeUserAssignment::getInstancesOfUser($this->il_user->getId());
196  }
static getInstancesOfUser($a_user_id)
Get all instances for a given user.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readVisibleOnPDMode()

ilPDStudyProgrammeSimpleListGUI::readVisibleOnPDMode ( )
protected

Definition at line 160 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References ilObjStudyProgrammeAdmin\SETTING_VISIBLE_ON_PD.

Referenced by __construct().

160  {
161  $this->visible_on_pd_mode = $this->il_setting->get(ilObjStudyProgrammeAdmin::SETTING_VISIBLE_ON_PD);
162  }
+ Here is the caller graph for this function:

◆ shouldShowThisList()

ilPDStudyProgrammeSimpleListGUI::shouldShowThisList ( )
protected

Definition at line 185 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References $_GET, and $DIC.

Referenced by __construct(), and getHTML().

185  {
186  global $DIC;
187  $ctrl = $DIC->ctrl();
188  return ($_GET["cmd"] == "jumpToSelectedItems" ||
189  ($ctrl->getCmdClass() == "ilpersonaldesktopgui" && $ctrl->getCmd() == "show")
190  ) && !$_GET["expand"];
191  }
$_GET["client_id"]
global $DIC
+ Here is the caller graph for this function:

◆ userHasReadableStudyProgrammes()

ilPDStudyProgrammeSimpleListGUI::userHasReadableStudyProgrammes ( )
protected

Definition at line 148 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References isReadable().

Referenced by __construct(), fillDataSection(), and getHTML().

148  {
149  if (count($this->users_assignments) == 0) {
150  return false;
151  }
152  foreach ($this->users_assignments as $assignment) {
153  if ($this->isReadable($assignment)) {
154  return true;
155  }
156  }
157  return false;
158  }
isReadable(ilStudyProgrammeUserAssignment $assignment)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userHasVisibleStudyProgrammes()

ilPDStudyProgrammeSimpleListGUI::userHasVisibleStudyProgrammes ( )
protected

Definition at line 136 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References isVisible().

136  {
137  if (count($this->users_assignments) == 0) {
138  return false;
139  }
140  foreach ($this->users_assignments as $assignment) {
141  if ($this->isVisible($assignment)) {
142  return true;
143  }
144  }
145  return false;
146  }
isVisible(ilStudyProgrammeUserAssignment $assignment)
+ Here is the call graph for this function:

Field Documentation

◆ $il_access

ilPDStudyProgrammeSimpleListGUI::$il_access
protected

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

◆ $il_lng

ilPDStudyProgrammeSimpleListGUI::$il_lng
protected

Definition at line 22 of file class.ilPDStudyProgrammeSimpleListGUI.php.

◆ $il_setting

ilPDStudyProgrammeSimpleListGUI::$il_setting
protected

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

◆ $il_user

ilPDStudyProgrammeSimpleListGUI::$il_user
protected

Definition at line 27 of file class.ilPDStudyProgrammeSimpleListGUI.php.

◆ $show_info_message

ilPDStudyProgrammeSimpleListGUI::$show_info_message
protected

Definition at line 52 of file class.ilPDStudyProgrammeSimpleListGUI.php.

◆ $users_assignments

ilPDStudyProgrammeSimpleListGUI::$users_assignments
protected

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

◆ $visible_on_pd_mode

ilPDStudyProgrammeSimpleListGUI::$visible_on_pd_mode
protected

Definition at line 47 of file class.ilPDStudyProgrammeSimpleListGUI.php.

◆ BLOCK_TYPE

const ilPDStudyProgrammeSimpleListGUI::BLOCK_TYPE = "prgsimplelist"

Definition at line 17 of file class.ilPDStudyProgrammeSimpleListGUI.php.


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