ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ()
 Get HTML. More...
 
 getDataSectionContent ()
 
 getBlockType ()
 
Returns
string
More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
- Public Member Functions inherited from ilBlockGUI
 getBlockType ()
 
 __construct ()
 Constructor. More...
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setPresentation (int $type)
 Set presentation. More...
 
 getPresentation ()
 Get presentation type. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. 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...
 
 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 (bool $a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. 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 ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 getHTML ()
 Get HTML. 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...
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 Get HTML. More...
 

Data Fields

const BLOCK_TYPE = "prgsimplelist"
 
- Data Fields inherited from ilBlockGUI
const PRES_MAIN_LEG = 0
 
const PRES_SEC_LEG = 1
 
const PRES_SEC_LIST = 2
 
const PRES_MAIN_LIST = 3
 

Protected Member Functions

 isRepositoryObject ()
 Returns whether block has a corresponding repository object.
Returns
bool
More...
 
 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
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 initCommands ()
 Init commands. More...
 
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getViewControls ()
 Get view controls. More...
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 handleNavigation ()
 Handle navigation. More...
 
 loadData ()
 Load data for current page. More...
 
 getListItemGroups ()
 Get items. More...
 
 addRepoCommands ()
 Add repo commands. More...
 
 getNoItemFoundContent ()
 No item entry. 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
 $ui
 
 $data = array()
 
 $enablenuminfo = true
 
 $footer_links = array()
 
 $block_id = 0
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $title = ""
 
 $admincommands = false
 
 $dropdown
 
 $tpl
 
 $main_tpl
 
 $user
 
 $ctrl
 
 $access
 
 $lng
 
 $obj_def
 
 $presentation
 
 $new_rendering = false
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilPDStudyProgrammeSimpleListGUI::__construct ( )

Constructor.

Parameters

Reimplemented from ilBlockGUI.

Reimplemented in ilPDStudyProgrammeExpandableListGUI.

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

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

References $DIC, $ilSetting, $ilUser, ilBlockGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ilStudyProgrammeDIC\dic(), 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 144 of file class.ilPDStudyProgrammeSimpleListGUI.php.

145 {
146 assert($this->userHasReadableStudyProgrammes()); // We should not get here.
147 $this->tpl->setVariable("BLOCK_ROW", $this->getDataSectionContent());
148 }

References getDataSectionContent(), and userHasReadableStudyProgrammes().

+ Here is the call graph for this function:

◆ getBlockType()

ilPDStudyProgrammeSimpleListGUI::getBlockType ( )

Returns
string

Reimplemented from ilBlockGUI.

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

131 : string
132 {
133 return self::BLOCK_TYPE;
134 }

References BLOCK_TYPE.

◆ getDataSectionContent()

ilPDStudyProgrammeSimpleListGUI::getDataSectionContent ( )

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

107 {
108 $content = "";
109 foreach ($this->users_assignments as $assignment) {
110 if (!$this->isReadable($assignment)) {
111 continue;
112 }
113
114 try {
115 $list_item = $this->new_ilStudyProgrammeAssignmentListGUI($assignment);
116 $list_item->setShowInfoMessage($this->show_info_message);
117 $list_item->setVisibleOnPDMode($this->visible_on_pd_mode);
118 $content .= $list_item->getHTML();
120 $this->il_logger->alert("$e");
122 $this->il_logger->alert("$e");
123 }
124 }
125 return $content;
126 }
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 Vendor\Package\$e, 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 ( )

Get HTML.

Reimplemented from ilBlockGUI.

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

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

References shouldShowThisList(), and userHasReadableStudyProgrammes().

+ Here is the call graph for this function:

◆ hasPermission()

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

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

183 {
184 $prg = $assignment->getStudyProgramme();
185 return $this->il_access->checkAccess($permission, "", $prg->getRefId(), "prg", $prg->getId());
186 }
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 199 of file class.ilPDStudyProgrammeSimpleListGUI.php.

200 {
201 if ($this->visible_on_pd_mode == ilObjStudyProgrammeAdmin::SETTING_VISIBLE_ON_PD_ALLWAYS) {
202 return true;
203 }
204
205 return $this->hasPermission($assignment, "read");
206 }
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()

ilPDStudyProgrammeSimpleListGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Returns
bool

Reimplemented from ilBlockGUI.

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

139 : bool
140 {
141 return false;
142 }

◆ isVisible()

ilPDStudyProgrammeSimpleListGUI::isVisible ( ilStudyProgrammeUserAssignment  $assignment)
protected

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

195 {
196 return $this->hasPermission($assignment, "visible");
197 }

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

223 {
224 $progress = $a_assignment->getStudyProgramme()->getProgressForAssignment($a_assignment->getId());
225 $progress_gui = new ilStudyProgrammeProgressListGUI($progress);
226 $progress_gui->setOnlyRelevant(true);
227 return $progress_gui;
228 }
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 188 of file class.ilPDStudyProgrammeSimpleListGUI.php.

189 {
190 $viewSettings = new ilPDSelectedItemsBlockViewSettings($GLOBALS['DIC']->user(), (int) $_GET['view']);
191 $this->show_info_message = $viewSettings->isStudyProgrammeViewActive();
192 }
user()
Definition: user.php:4
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$_GET["client_id"]

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

218 {
219 $this->users_assignments = $this->sp_user_assignment_db->getInstancesOfUser($this->il_user->getId());
220 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ readVisibleOnPDMode()

ilPDStudyProgrammeSimpleListGUI::readVisibleOnPDMode ( )
protected

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

178 {
179 $this->visible_on_pd_mode = $this->il_setting->get(ilObjStudyProgrammeAdmin::SETTING_VISIBLE_ON_PD);
180 }

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

209 {
210 global $DIC;
211 $ctrl = $DIC->ctrl();
212 return ($_GET["cmd"] == "jumpToSelectedItems" ||
213 ($ctrl->getCmdClass() == "ildashboardgui" && $ctrl->getCmd() == "show")
214 ) && !$_GET["expand"];
215 }

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

165 {
166 if (count($this->users_assignments) == 0) {
167 return false;
168 }
169 foreach ($this->users_assignments as $assignment) {
170 if ($this->isReadable($assignment)) {
171 return true;
172 }
173 }
174 return false;
175 }

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

152 {
153 if (count($this->users_assignments) == 0) {
154 return false;
155 }
156 foreach ($this->users_assignments as $assignment) {
157 if ($this->isVisible($assignment)) {
158 return true;
159 }
160 }
161 return false;
162 }
isVisible(ilStudyProgrammeUserAssignment $assignment)

References isVisible().

+ 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.

Referenced by getBlockType().


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