ILIAS  release_8 Revision v8.24
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 ()
 
 getBlockType ()
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 
 getBlockType ()
 
 setData (array $a_data)
 
 getData ()
 
 setPresentation (int $type)
 
 getPresentation ()
 
 setBlockId (string $a_block_id="0")
 
 getBlockId ()
 
 setGuiObject (object $a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setOffset (int $a_offset)
 
 getOffset ()
 
 correctOffset ()
 
 setLimit (int $a_limit)
 
 getLimit ()
 
 setEnableEdit (bool $a_enableedit)
 
 getEnableEdit ()
 
 setRepositoryMode (bool $a_repositorymode)
 
 getRepositoryMode ()
 
 setSubtitle (string $a_subtitle)
 
 getSubtitle ()
 
 setRefId (int $a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 
 setAdminCommands (bool $a_admincommands)
 
 getAdminCommands ()
 
 setEnableNumInfo (bool $a_enablenuminfo)
 
 getEnableNumInfo ()
 
 setProperties (array $a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty (string $a_property)
 
 setProperty (string $a_property, string $a_value)
 
 setRowTemplate (string $a_rowtemplatename, string $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 
 getRowTemplateDir ()
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="")
 
 getBlockCommands ()
 
 getHTML ()
 
 fillHeaderCommands ()
 
 fillHeaderTitleBlock ()
 
 setDataSection (string $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 (array $a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 
 setPreviousNextLinks ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 
 getNoItemFoundContent ()
 

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
 
const PRES_MAIN_TILE = 4
 

Protected Member Functions

 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 userHasVisibleStudyProgrammes ()
 
 userHasReadableStudyProgrammes ()
 
 getVisibleOnPDMode ()
 
 hasPermission (ilStudyProgrammeAssignment $assignment, string $permission)
 
 isVisible (ilStudyProgrammeAssignment $assignment)
 
 isReadable (ilStudyProgrammeAssignment $assignment)
 
 shouldShowThisList ()
 
 getUsersAssignments ()
 
 new_ilStudyProgrammeAssignmentListGUI (ilStudyProgrammeAssignment $assignment)
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 specialCharsAsEntities (string $string)
 
 initCommands ()
 
 fillRowColor (string $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...
 
 send (string $output)
 Send. More...
 

Protected Attributes

ilSetting $setting
 
 $logger
 
ilStudyProgrammeAssignmentDBRepository $sp_user_assignment_db
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
array $users_assignments
 
string $visible_on_pd_mode
 
bool $show_info_message
 
- Protected Attributes inherited from ilBlockGUI
object $gui_object
 
ILIAS Block StandardGUIRequest $request
 
ILIAS Block BlockManager $block_manager
 
bool $repositorymode = false
 
ILIAS DI UIServices $ui
 
array $data = array()
 
bool $enablenuminfo = true
 
array $footer_links = array()
 
string $block_id = "0"
 
bool $allow_moving = true
 
array $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
array $block_commands = array()
 
int $max_count = 0
 
bool $close_command = false
 
bool $image = false
 
array $property = []
 
string $nav_value = ""
 
string $css_row = ""
 
string $title = ""
 
bool $admincommands = false
 
array $dropdown
 
ilTemplate $tpl
 
ilGlobalTemplateInterface $main_tpl
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilAccessHandler $access
 
ilLanguage $lng
 
ilObjectDefinition $obj_def
 
int $presentation
 
int $requested_ref_id
 
bool $new_rendering = false
 

Additional Inherited Members

- Static Public Member Functions inherited from ilBlockGUI
static getScreenMode ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilPDStudyProgrammeSimpleListGUI::__construct ( )

Reimplemented from ilBlockGUI.

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

52 {
53 global $DIC;
54
56
57 $this->setting = $DIC['ilSetting'];
58 $this->logger = ilLoggerFactory::getLogger('prg');
59 $this->sp_user_assignment_db = ilStudyProgrammeDIC::dic()['ilStudyProgrammeUserAssignmentDB'];
60 $this->request_wrapper = $DIC->http()->wrapper()->query();
61 $this->refinery = $DIC->refinery();
62
63 // No need to load data, as we won't display this.
64 if (!$this->shouldShowThisList()) {
65 return;
66 }
67
68 $this->getUsersAssignments();
69 //check which kind of option is selected in settings
70 $this->getVisibleOnPDMode();
71 //check to display info message if option "read" is selected
72 $viewSettings = new ilPDSelectedItemsBlockViewSettings(
73 $DIC->user(),
74 $this->request_wrapper->retrieve("view", $this->refinery->kindlyTo()->int())
75 );
76 $this->show_info_message = $viewSettings->isStudyProgrammeViewActive();
77
78 // As this won't be visible we don't have to initialize this.
79 if (!$this->userHasReadableStudyProgrammes()) {
80 return;
81 }
82
83 $this->setTitle($this->lng->txt("objs_prg"));
84 }
setTitle(string $a_title)
static getLogger(string $a_component_id)
Get component logger.
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilStudyProgrammeDIC\dic(), ilLoggerFactory\getLogger(), getUsersAssignments(), getVisibleOnPDMode(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\refinery(), 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 139 of file class.ilPDStudyProgrammeSimpleListGUI.php.

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

References getDataSectionContent(), and userHasReadableStudyProgrammes().

+ Here is the call graph for this function:

◆ getBlockType()

ilPDStudyProgrammeSimpleListGUI::getBlockType ( )

Reimplemented from ilBlockGUI.

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

126 : string
127 {
128 return self::BLOCK_TYPE;
129 }

References BLOCK_TYPE.

◆ getDataSectionContent()

ilPDStudyProgrammeSimpleListGUI::getDataSectionContent ( )

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

101 : string
102 {
103 $content = "";
104 foreach ($this->users_assignments as $assignment) {
105 if (!$this->isReadable($assignment)) {
106 continue;
107 }
108
109 try {
110 $list_item = $this->new_ilStudyProgrammeAssignmentListGUI($assignment);
111 $list_item->setShowInfoMessage($this->show_info_message);
112 $list_item->setVisibleOnPDMode($this->visible_on_pd_mode);
113 $content .= $list_item->getHTML();
115 $this->logger->alert((string) $e);
117 $this->logger->alert((string) $e);
118 }
119 }
120 return $content;
121 }
isReadable(ilStudyProgrammeAssignment $assignment)
new_ilStudyProgrammeAssignmentListGUI(ilStudyProgrammeAssignment $assignment)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References Vendor\Package\$e, isReadable(), ILIAS\Repository\logger(), 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 ( )

Reimplemented from ilBlockGUI.

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

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

References shouldShowThisList(), and userHasReadableStudyProgrammes().

+ Here is the call graph for this function:

◆ getUsersAssignments()

ilPDStudyProgrammeSimpleListGUI::getUsersAssignments ( )
protected

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

207 : void
208 {
209 $this->users_assignments = $this->sp_user_assignment_db->getInstancesOfUser($this->user->getId());
210 }

References ILIAS\Repository\user().

Referenced by __construct().

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

◆ getVisibleOnPDMode()

ilPDStudyProgrammeSimpleListGUI::getVisibleOnPDMode ( )
protected

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

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

References ilObjStudyProgrammeAdmin\SETTING_VISIBLE_ON_PD.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ hasPermission()

ilPDStudyProgrammeSimpleListGUI::hasPermission ( ilStudyProgrammeAssignment  $assignment,
string  $permission 
)
protected

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

176 : bool
177 {
178 $prg = ilObjStudyProgramme::getInstanceByObjId($assignment->getRootId());
179 return $this->access->checkAccess($permission, "", $prg->getRefId(), "prg", $prg->getId());
180 }
static getInstanceByObjId(int $obj_id)

References ILIAS\Repository\access(), and ilObjStudyProgramme\getInstanceByObjId().

Referenced by isReadable(), and isVisible().

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

◆ isReadable()

ilPDStudyProgrammeSimpleListGUI::isReadable ( ilStudyProgrammeAssignment  $assignment)
protected

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

187 : bool
188 {
189 if ($this->visible_on_pd_mode === ilObjStudyProgrammeAdmin::SETTING_VISIBLE_ON_PD_ALLWAYS) {
190 return true;
191 }
192
193 return $this->hasPermission($assignment, "read");
194 }
hasPermission(ilStudyProgrammeAssignment $assignment, string $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.

Reimplemented from ilBlockGUI.

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

134 : bool
135 {
136 return false;
137 }

◆ isVisible()

ilPDStudyProgrammeSimpleListGUI::isVisible ( ilStudyProgrammeAssignment  $assignment)
protected

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

182 : bool
183 {
184 return $this->hasPermission($assignment, "visible");
185 }

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 ( ilStudyProgrammeAssignment  $assignment)
protected

Reimplemented in ilPDStudyProgrammeExpandableListGUI.

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

215 $progress = $assignment->getProgressTree();
216 $progress_gui = new ilStudyProgrammeProgressListGUI($progress);
217 $progress_gui->setOnlyRelevant(true);
218 return $progress_gui;
219 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by getDataSectionContent().

+ Here is the caller graph for this function:

◆ shouldShowThisList()

ilPDStudyProgrammeSimpleListGUI::shouldShowThisList ( )
protected

Reimplemented in ilPDStudyProgrammeExpandableListGUI.

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

196 : bool
197 {
198 $cmd = $this->request_wrapper->retrieve("cmd", $this->refinery->kindlyTo()->string());
199 $expand = $this->request_wrapper->retrieve("expand", $this->refinery->kindlyTo()->bool());
200 $jump_to_selected_list = $cmd === "jumpToSelectedItems";
201 $is_ilDashboardGUI = $this->ctrl->getCmdClass() === "ildashboardgui";
202 $is_cmd_show = $this->ctrl->getCmd() === "show";
203
204 return ($jump_to_selected_list || ($is_ilDashboardGUI && $is_cmd_show)) && !$expand;
205 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\refinery().

Referenced by __construct(), and getHTML().

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

◆ userHasReadableStudyProgrammes()

ilPDStudyProgrammeSimpleListGUI::userHasReadableStudyProgrammes ( )
protected

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

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

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

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

References isVisible().

+ Here is the call graph for this function:

Field Documentation

◆ $logger

ilPDStudyProgrammeSimpleListGUI::$logger
protected

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

◆ $refinery

Factory ilPDStudyProgrammeSimpleListGUI::$refinery
protected

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

◆ $request_wrapper

RequestWrapper ilPDStudyProgrammeSimpleListGUI::$request_wrapper
protected

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

◆ $setting

ilSetting ilPDStudyProgrammeSimpleListGUI::$setting
protected

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

◆ $show_info_message

bool ilPDStudyProgrammeSimpleListGUI::$show_info_message
protected

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

◆ $sp_user_assignment_db

ilStudyProgrammeAssignmentDBRepository ilPDStudyProgrammeSimpleListGUI::$sp_user_assignment_db
protected

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

◆ $users_assignments

array ilPDStudyProgrammeSimpleListGUI::$users_assignments
protected

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

◆ $visible_on_pd_mode

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

Referenced by getBlockType().


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