ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 
- 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 ()
 
 checkOffset (int $offset)
 
 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="", ?RoundTrip $modal=null)
 
 getBlockCommands ()
 
 getHTML ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getViewControlsForPanel ()
 
 sortObject ()
 
 addSortOption (string $option, string $label, bool $active)
 
 setSortTarget (string $target)
 
 addPresentation (string $label, string $target, bool $active)
 
 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 ()
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. 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...
 
 getActionsForPanel ()
 
 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
ILIAS UI Renderer $renderer
 
Factory $factory
 
object $gui_object
 
ILIAS Container Block StandardGUIRequest $request
 
ILIAS Container 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
 

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.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

◆ 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)
Exception is thrown when 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(), ILIAS\Repository\logger(), and new_ilStudyProgrammeAssignmentListGUI().

+ Here is the call 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 200 of file class.ilPDStudyProgrammeSimpleListGUI.php.

200 : void
201 {
202 $this->users_assignments = $this->sp_user_assignment_db->getInstancesOfUser($this->user->getId());
203 }

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

164 : void
165 {
166 $this->visible_on_pd_mode = $this->setting->get(ilObjStudyProgrammeAdmin::SETTING_VISIBLE_ON_PD);
167 }

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

169 : bool
170 {
171 $prg = ilObjStudyProgramme::getInstanceByObjId($assignment->getRootId());
172 return $this->access->checkAccess($permission, "", $prg->getRefId(), "prg", $prg->getId());
173 }
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 180 of file class.ilPDStudyProgrammeSimpleListGUI.php.

180 : bool
181 {
182 if ($this->visible_on_pd_mode === ilObjStudyProgrammeAdmin::SETTING_VISIBLE_ON_PD_ALLWAYS) {
183 return true;
184 }
185
186 return $this->hasPermission($assignment, "read");
187 }
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 175 of file class.ilPDStudyProgrammeSimpleListGUI.php.

175 : bool
176 {
177 return $this->hasPermission($assignment, "visible");
178 }

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

208 $progress = $assignment->getProgressTree();
209 $progress_gui = new ilStudyProgrammeProgressListGUI($progress);
210 $progress_gui->setOnlyRelevant(true);
211 return $progress_gui;
212 }
Class ilStudyProgrammeProgressListGUI.

Referenced by getDataSectionContent().

+ Here is the caller graph for this function:

◆ shouldShowThisList()

ilPDStudyProgrammeSimpleListGUI::shouldShowThisList ( )
protected

Reimplemented in ilPDStudyProgrammeExpandableListGUI.

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

189 : bool
190 {
191 $cmd = $this->request_wrapper->retrieve("cmd", $this->refinery->kindlyTo()->string());
192 $expand = $this->request_wrapper->retrieve("expand", $this->refinery->kindlyTo()->bool());
193 $jump_to_selected_list = $cmd === "jumpToSelectedItems";
194 $is_ilDashboardGUI = $this->ctrl->getCmdClass() === "ildashboardgui";
195 $is_cmd_show = $this->ctrl->getCmd() === "show";
196
197 return ($jump_to_selected_list || ($is_ilDashboardGUI && $is_cmd_show)) && !$expand;
198 }

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

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

References isReadable().

Referenced by __construct(), 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 138 of file class.ilPDStudyProgrammeSimpleListGUI.php.

138 : bool
139 {
140 if (count($this->users_assignments) === 0) {
141 return false;
142 }
143 foreach ($this->users_assignments as $assignment) {
144 if ($this->isVisible($assignment)) {
145 return true;
146 }
147 }
148 return false;
149 }
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: