ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilPDStudyProgrammeSimpleListGUI Class Reference

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

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

Public Member Functions

 __construct ()
 Constructor. More...
 
 getHTML ()
 Handle config status. More...
 
 getDataSectionContent ()
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
- 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
 
 $tpl
 
 $main_tpl
 
 $user
 
 $ctrl
 
 $access
 
 $lng
 
 $obj_def
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilPDStudyProgrammeSimpleListGUI::__construct ( )

Constructor.

Parameters

Reimplemented from ilBlockGUI.

Reimplemented in ilPDStudyProgrammeExpandableListGUI.

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

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ fillDataSection()

ilPDStudyProgrammeSimpleListGUI::fillDataSection ( )

Standard implementation for row based data.

Overwrite this and call setContent for other data.

Reimplemented from ilBlockGUI.

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

138 {
139 assert($this->userHasReadableStudyProgrammes()); // We should not get here.
140 $this->tpl->setVariable("BLOCK_ROW", $this->getDataSectionContent());
141 }

References getDataSectionContent(), and userHasReadableStudyProgrammes().

+ Here is the call graph for this function:

◆ getBlockType()

static ilPDStudyProgrammeSimpleListGUI::getBlockType ( )
static

Reimplemented from ilBlockGUI.

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

References BLOCK_TYPE.

◆ getDataSectionContent()

ilPDStudyProgrammeSimpleListGUI::getDataSectionContent ( )

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

106 {
107 $content = "";
108 foreach ($this->users_assignments as $assignment) {
109 if (!$this->isReadable($assignment)) {
110 continue;
111 }
112
113 try {
114 $list_item = $this->new_ilStudyProgrammeAssignmentListGUI($assignment);
115 $list_item->setShowInfoMessage($this->show_info_message);
116 $list_item->setVisibleOnPDMode($this->visible_on_pd_mode);
117 $content .= $list_item->getHTML();
119 $this->il_logger->alert("$e");
120 } catch (ilStudyProgrammeTreeException $e) {
121 $this->il_logger->alert("$e");
122 }
123 }
124 return $content;
125 }
isReadable(ilStudyProgrammeUserAssignment $assignment)
new_ilStudyProgrammeAssignmentListGUI(ilStudyProgrammeUserAssignment $a_assignment)
Exception is thrown when a progress for some programme node and assignment is missing.
Exception is thrown when invariants on the program tree would be violated by manipulation of tree.

References isReadable(), and new_ilStudyProgrammeAssignmentListGUI().

Referenced by fillDataSection().

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

◆ getHTML()

ilPDStudyProgrammeSimpleListGUI::getHTML ( )

Handle config status.

Get HTML.

Reimplemented from ilBlockGUI.

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

91 {
92 // TODO: This should be determined from somewhere up in the hierarchy, as
93 // this will lead to problems, when e.g. a command changes. But i don't see
94 // how atm...
95 if (!$this->shouldShowThisList()) {
96 return "";
97 }
98
99 if (!$this->userHasReadableStudyProgrammes()) {
100 return "";
101 }
102 return parent::getHTML();
103 }

References shouldShowThisList(), and userHasReadableStudyProgrammes().

+ Here is the call graph for this function:

◆ hasPermission()

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

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

176 {
177 $prg = $assignment->getStudyProgramme();
178 return $this->il_access->checkAccess($permission, "", $prg->getRefId(), "prg", $prg->getId());
179 }
getStudyProgramme()
Get the program node where this assignment was made.

References ilStudyProgrammeUserAssignment\getStudyProgramme().

Referenced by isReadable(), and isVisible().

+ 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 193 of file class.ilPDStudyProgrammeSimpleListGUI.php.

194 {
195 if ($this->visible_on_pd_mode == ilObjStudyProgrammeAdmin::SETTING_VISIBLE_ON_PD_ALLWAYS) {
196 return true;
197 }
198
199 return $this->hasPermission($assignment, "read");
200 }
hasPermission(ilStudyProgrammeUserAssignment $assignment, $permission)

References hasPermission(), and ilObjStudyProgrammeAdmin\SETTING_VISIBLE_ON_PD_ALLWAYS.

Referenced by getDataSectionContent(), and userHasReadableStudyProgrammes().

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

◆ isRepositoryObject()

static ilPDStudyProgrammeSimpleListGUI::isRepositoryObject ( )
static

Reimplemented from ilBlockGUI.

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

133 {
134 return false;
135 }

◆ isVisible()

ilPDStudyProgrammeSimpleListGUI::isVisible ( ilStudyProgrammeUserAssignment  $assignment)
protected

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

189 {
190 return $this->hasPermission($assignment, "visible");
191 }

References hasPermission().

Referenced by userHasVisibleStudyProgrammes().

+ 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

Reimplemented in ilPDStudyProgrammeExpandableListGUI.

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

218 {
219 require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeProgressListGUI.php");
220 $progress = $a_assignment->getStudyProgramme()->getProgressForAssignment($a_assignment->getId());
221 $progress_gui = new ilStudyProgrammeProgressListGUI($progress);
222 $progress_gui->setOnlyRelevant(true);
223 return $progress_gui;
224 }
Class ilStudyProgrammeProgressListGUI.

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

Referenced by getDataSectionContent().

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

◆ readToShowInfoMessage()

ilPDStudyProgrammeSimpleListGUI::readToShowInfoMessage ( )
protected

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

182 {
183 require_once 'Services/PersonalDesktop/ItemsBlock/classes/class.ilPDSelectedItemsBlockViewSettings.php';
184 $viewSettings = new ilPDSelectedItemsBlockViewSettings($GLOBALS['DIC']->user(), (int) $_GET['view']);
185 $this->show_info_message = $viewSettings->isStudyProgrammeViewActive();
186 }
user()
Definition: user.php:4
$_GET["client_id"]
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $_GET, $GLOBALS, and user().

Referenced by __construct().

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

◆ readUsersAssignments()

ilPDStudyProgrammeSimpleListGUI::readUsersAssignments ( )
protected

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

212 {
213 require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeUserAssignment.php");
214 $this->users_assignments = ilStudyProgrammeUserAssignment::getInstancesOfUser($this->il_user->getId());
215 }
static getInstancesOfUser($a_user_id)
Get all instances for a given user.

References ilStudyProgrammeUserAssignment\getInstancesOfUser().

Referenced by __construct().

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

◆ readVisibleOnPDMode()

ilPDStudyProgrammeSimpleListGUI::readVisibleOnPDMode ( )
protected

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

171 {
172 $this->visible_on_pd_mode = $this->il_setting->get(ilObjStudyProgrammeAdmin::SETTING_VISIBLE_ON_PD);
173 }

References ilObjStudyProgrammeAdmin\SETTING_VISIBLE_ON_PD.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ shouldShowThisList()

ilPDStudyProgrammeSimpleListGUI::shouldShowThisList ( )
protected

Reimplemented in ilPDStudyProgrammeExpandableListGUI.

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

203 {
204 global $DIC;
205 $ctrl = $DIC->ctrl();
206 return ($_GET["cmd"] == "jumpToSelectedItems" ||
207 ($ctrl->getCmdClass() == "ilpersonaldesktopgui" && $ctrl->getCmd() == "show")
208 ) && !$_GET["expand"];
209 }

References $_GET, ilBlockGUI\$ctrl, and $DIC.

Referenced by __construct(), and getHTML().

+ Here is the caller graph for this function:

◆ userHasReadableStudyProgrammes()

ilPDStudyProgrammeSimpleListGUI::userHasReadableStudyProgrammes ( )
protected

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

158 {
159 if (count($this->users_assignments) == 0) {
160 return false;
161 }
162 foreach ($this->users_assignments as $assignment) {
163 if ($this->isReadable($assignment)) {
164 return true;
165 }
166 }
167 return false;
168 }

References isReadable().

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

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

◆ userHasVisibleStudyProgrammes()

ilPDStudyProgrammeSimpleListGUI::userHasVisibleStudyProgrammes ( )
protected

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

145 {
146 if (count($this->users_assignments) == 0) {
147 return false;
148 }
149 foreach ($this->users_assignments as $assignment) {
150 if ($this->isVisible($assignment)) {
151 return true;
152 }
153 }
154 return false;
155 }
isVisible(ilStudyProgrammeUserAssignment $assignment)

References isVisible().

+ Here is the call graph for this function:

Field Documentation

◆ $il_access

ilPDStudyProgrammeSimpleListGUI::$il_access
protected

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

◆ $il_lng

ilPDStudyProgrammeSimpleListGUI::$il_lng
protected

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

◆ $il_setting

ilPDStudyProgrammeSimpleListGUI::$il_setting
protected

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

◆ $il_user

ilPDStudyProgrammeSimpleListGUI::$il_user
protected

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

◆ $show_info_message

ilPDStudyProgrammeSimpleListGUI::$show_info_message
protected

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

◆ $users_assignments

ilPDStudyProgrammeSimpleListGUI::$users_assignments
protected

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

◆ $visible_on_pd_mode

ilPDStudyProgrammeSimpleListGUI::$visible_on_pd_mode
protected

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

◆ BLOCK_TYPE

const ilPDStudyProgrammeSimpleListGUI::BLOCK_TYPE = "prgsimplelist"

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

Referenced by getBlockType().


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