ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
 ilBlockGUI ()
 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 $ilSetting, $ilUser, $lng, ilLoggerFactory\getLogger(), readToShowInfoMessage(), readUsersAssignments(), readVisibleOnPDMode(), ilBlockGUI\setTitle(), shouldShowThisList(), and userHasReadableStudyProgrammes().

54  {
55  global $lng, $ilUser, $ilAccess, $ilSetting;
56  $this->il_lng = $lng;
57  $this->il_user = $ilUser;
58  $this->il_access = $ilAccess;
59  $this->il_setting = $ilSetting;
60  $this->il_logger = ilLoggerFactory::getLogger('prg');
61 
62  // No need to load data, as we won't display this.
63  if (!$this->shouldShowThisList()) {
64  return;
65  }
66 
67  $this->readUsersAssignments();
68  //check which kind of option is selected in settings
69  $this->readVisibleOnPDMode();
70  //check to display info message if option "read" is selected
71  $this->readToShowInfoMessage();
72 
73  // As this won't be visible we don't have to initialize this.
74  if (!$this->userHasReadableStudyProgrammes()) {
75  return;
76  }
77 
78  $this->setTitle($this->il_lng->txt("objs_prg"));
79  }
setTitle($a_title)
Set Title.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
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 126 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References getDataSectionContent(), and userHasReadableStudyProgrammes().

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

◆ getBlockType()

static ilPDStudyProgrammeSimpleListGUI::getBlockType ( )
static

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

118  {
119  return self::BLOCK_TYPE;
120  }

◆ getDataSectionContent()

ilPDStudyProgrammeSimpleListGUI::getDataSectionContent ( )

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

References isReadable(), and new_ilStudyProgrammeAssignmentListGUI().

Referenced by fillDataSection().

95  {
96  $content = "";
97  foreach ($this->users_assignments as $assignment) {
98  if(!$this->isReadable($assignment)) {
99  continue;
100  }
101 
102  try {
103  $list_item = $this->new_ilStudyProgrammeAssignmentListGUI($assignment);
104  $list_item->setShowInfoMessage($this->show_info_message);
105  $list_item->setVisibleOnPDMode($this->visible_on_pd_mode);
106  $content .= $list_item->getHTML();
107  }
109  $this->il_logger->alert("$e");
110  }
112  $this->il_logger->alert("$e");
113  }
114  }
115  return $content;
116  }
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 81 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References shouldShowThisList(), and userHasReadableStudyProgrammes().

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

◆ hasPermission()

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

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

References ilStudyProgrammeUserAssignment\getStudyProgramme().

Referenced by isReadable(), and isVisible().

160  {
161  $prg = $assignment->getStudyProgramme();
162  return $this->il_access->checkAccess($permission, "", $prg->getRefId(), "prg", $prg->getId());
163  }
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 173 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References hasPermission(), and ilObjStudyProgrammeAdmin\SETTING_VISIBLE_ON_PD_ALLWAYS.

Referenced by getDataSectionContent(), and userHasReadableStudyProgrammes().

173  {
174  if($this->visible_on_pd_mode == ilObjStudyProgrammeAdmin::SETTING_VISIBLE_ON_PD_ALLWAYS){
175  return true;
176  }
177 
178  return $this->hasPermission($assignment,"read");
179  }
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 122 of file class.ilPDStudyProgrammeSimpleListGUI.php.

122  {
123  return false;
124  }

◆ isVisible()

ilPDStudyProgrammeSimpleListGUI::isVisible ( ilStudyProgrammeUserAssignment  $assignment)
protected

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

References hasPermission().

Referenced by userHasVisibleStudyProgrammes().

169  {
170  return $this->hasPermission($assignment,"visible");
171  }
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 190 of file class.ilPDStudyProgrammeSimpleListGUI.php.

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

Referenced by getDataSectionContent().

190  {
191  require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeProgressListGUI.php");
192  $progress = $a_assignment->getStudyProgramme()->getProgressForAssignment($a_assignment->getId());
193  $progress_gui = new ilStudyProgrammeProgressListGUI($progress);
194  $progress_gui->setOnlyRelevant(true);
195  return $progress_gui;
196  }
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 165 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References $_GET, and ilPDSelectedItemsBlockGUI\VIEW_MY_STUDYPROGRAMME.

Referenced by __construct().

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

◆ readUsersAssignments()

ilPDStudyProgrammeSimpleListGUI::readUsersAssignments ( )
protected

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

References ilStudyProgrammeUserAssignment\getInstancesOfUser().

Referenced by __construct().

185  {
186  require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeUserAssignment.php");
187  $this->users_assignments = ilStudyProgrammeUserAssignment::getInstancesOfUser($this->il_user->getId());
188  }
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 156 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References ilObjStudyProgrammeAdmin\SETTING_VISIBLE_ON_PD.

Referenced by __construct().

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

◆ shouldShowThisList()

ilPDStudyProgrammeSimpleListGUI::shouldShowThisList ( )
protected

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

References $_GET.

Referenced by __construct(), and getHTML().

181  {
182  return $_GET["cmd"] == "jumpToSelectedItems" && !$_GET["expand"];
183  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ userHasReadableStudyProgrammes()

ilPDStudyProgrammeSimpleListGUI::userHasReadableStudyProgrammes ( )
protected

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

References isReadable().

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

144  {
145  if (count($this->users_assignments) == 0) {
146  return false;
147  }
148  foreach ($this->users_assignments as $assignment) {
149  if ($this->isReadable($assignment)) {
150  return true;
151  }
152  }
153  return false;
154  }
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 132 of file class.ilPDStudyProgrammeSimpleListGUI.php.

References isVisible().

132  {
133  if (count($this->users_assignments) == 0) {
134  return false;
135  }
136  foreach ($this->users_assignments as $assignment) {
137  if ($this->isVisible($assignment)) {
138  return true;
139  }
140  }
141  return false;
142  }
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: