ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilStudyProgrammeExpandableProgressListGUI Class Reference
+ Inheritance diagram for ilStudyProgrammeExpandableProgressListGUI:
+ Collaboration diagram for ilStudyProgrammeExpandableProgressListGUI:

Public Member Functions

 __construct (ilPRGProgress $progress)
 
 setIndent (int $indent)
 
 getHTML ()
 
- Public Member Functions inherited from ilStudyProgrammeProgressListGUI
 __construct (ilPRGProgress $a_progress)
 
 getHTML ()
 
 setShowInfoMessage (bool $show_info_message)
 
 setVisibleOnPDMode (string $visible_on_pd_mode)
 
 setOnlyRelevant (bool $only_relevant)
 

Protected Member Functions

 getIndent ()
 
 fillTemplate (ilTemplate $tpl)
 
 getAccordionContentHTML ()
 
 getAccordionContentProgressesHTML ()
 
 shouldShowSubProgress (ilPRGProgress $progress)
 
 newSubItem (ilPRGProgress $progress)
 
 getAccordionContentCoursesHTML ()
 
 configureItemGUI (ilStudyProgrammeCourseListGUI $item_gui)
 
 getAccordionOptions ()
 
 getAccordionId ()
 
 getExpandedImageURL ()
 
 getNotExpandedImageURL ()
 
 getTitleAndIconTarget (ilPRGProgress $progress)
 
 showMyProgress ()
 
 addJavaScript ()
 
 addCSS ()
 
- Protected Member Functions inherited from ilStudyProgrammeProgressListGUI
 fillTemplate (ilTemplate $tpl)
 
 getTitleForItem (ilObjStudyProgramme $programme)
 
 getTemplate (string $component, string $file, bool $remove_unknown_vars, bool $remove_empty_blocks)
 
 getIconPath (int $obj_id)
 
 getAltIcon ()
 
 getTitleAndIconTarget (ilPRGProgress $progress)
 
 buildProgressBar (ilPRGProgress $progress)
 
 buildToolTip (ilPRGProgress $progress)
 
 buildProgressStatus (ilPRGProgress $progress)
 
 showMoreObjectsInfo (ilObjStudyProgramme $programme)
 

Protected Attributes

ilRbacSystem $rbacsystem
 
ilSetting $setting
 
ilAccess $access
 
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
 
ILIAS Refinery Factory $refinery
 
int $indent = 0
 
bool $js_added = false
 
bool $css_added = false
 
string $alert_icon
 
- Protected Attributes inherited from ilStudyProgrammeProgressListGUI
ilLanguage $lng
 
ilCtrl $ctrl
 
ilAccess $access
 
ilPRGProgress $progress
 
ilGlobalTemplateInterface $tpl
 
string $html
 
bool $show_info_message
 
string $visible_on_pd_mode
 
bool $only_relevant = false
 

Additional Inherited Members

- Static Protected Attributes inherited from ilStudyProgrammeProgressListGUI
static string $tpl_file = "tpl.progress_list_item.html"
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeExpandableProgressListGUI::__construct ( ilPRGProgress  $progress)

Reimplemented from ilStudyProgrammeProgressListGUI.

Definition at line 34 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

35 {
37
38 global $DIC;
39 $this->tpl = $DIC['tpl'];
40 $this->rbacsystem = $DIC['rbacsystem'];
41 $this->setting = $DIC['ilSetting'];
42 $this->access = $DIC['ilAccess'];
43 $this->request_wrapper = $DIC->http()->wrapper()->query();
44 $this->refinery = $DIC->refinery();
45
46 $ui_factory = $DIC['ui.factory'];
47 $ui_renderer = $DIC['ui.renderer'];
48 $this->alert_icon = $ui_renderer->render(
49 $ui_factory->symbol()->icon()
50 ->custom(ilUtil::getImagePath("standard/icon_alert.svg"), $this->lng->txt("warning"))
51 ->withSize('medium')
52 );
53 }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilStudyProgrammeProgressListGUI\$progress, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ilUtil\getImagePath(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ addCSS()

ilStudyProgrammeExpandableProgressListGUI::addCSS ( )
protected
Returns
false|void

Definition at line 278 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

279 {
280 if ($this->css_added) {
281 return false;
282 }
283
284 $this->tpl->addCSS("assets/css/ilStudyProgramme.css");
285 $this->css_added = true;
286 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ addJavaScript()

ilStudyProgrammeExpandableProgressListGUI::addJavaScript ( )
protected
Returns
false|void

Definition at line 264 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

265 {
266 if ($this->js_added) {
267 return false;
268 }
269
271 $this->tpl->addJavaScript("assets/js/accordion.js", true, 3);
272 $this->js_added = true;
273 }
static initjQueryUI(?ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components....

References iljQueryUtil\initjQueryUI().

Referenced by getHTML().

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

◆ configureItemGUI()

ilStudyProgrammeExpandableProgressListGUI::configureItemGUI ( ilStudyProgrammeCourseListGUI  $item_gui)
protected

Reimplemented in ilStudyProgrammeIndividualPlanProgressListGUI.

Definition at line 192 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

192 : void
193 {
194 $item_gui->enableComments(false);
195 $item_gui->enableTags(false);
196 $item_gui->enableIcon(true);
197 $item_gui->enableDelete(false);
198 $item_gui->enableCut(false);
199 $item_gui->enableCopy(false);
200 $item_gui->enableLink(false);
201 $item_gui->enableInfoScreen(true);
202 $item_gui->enableSubscribe(true);
203 $item_gui->enableCheckbox(false);
204 $item_gui->enableDescription(true);
205 $item_gui->enableProperties(true);
206 $item_gui->enablePreconditions(true);
207 $item_gui->enableNoticeProperties(true);
208 $item_gui->enableCommands(true, true);
209 $item_gui->enableProgressInfo(true);
210 $item_gui->setIndent($this->getIndent() + 2);
211 }
enableDelete(bool $status)
enableDescription(bool $status)
enableProgressInfo(bool $status)
enablePreconditions(bool $status)
enableComments(bool $value, bool $enable_comments_settings=true)
enableInfoScreen(bool $info_screen)
enableCommands(bool $status, bool $std_only=false)
enableCheckbox(bool $status)
enableNoticeProperties(bool $status)
enableProperties(bool $status)
enableSubscribe(bool $status)

References ilObjectListGUI\enableCheckbox(), ilObjectListGUI\enableCommands(), ilObjectListGUI\enableComments(), ilObjectListGUI\enableCopy(), ilObjectListGUI\enableCut(), ilObjectListGUI\enableDelete(), ilObjectListGUI\enableDescription(), ilObjectListGUI\enableIcon(), ilObjectListGUI\enableInfoScreen(), ilObjectListGUI\enableLink(), ilObjectListGUI\enableNoticeProperties(), ilObjectListGUI\enablePreconditions(), ilObjectListGUI\enableProgressInfo(), ilObjectListGUI\enableProperties(), ilObjectListGUI\enableSubscribe(), ilObjectListGUI\enableTags(), getIndent(), and ilStudyProgrammeCourseListGUI\setIndent().

Referenced by getAccordionContentCoursesHTML().

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

◆ fillTemplate()

ilStudyProgrammeExpandableProgressListGUI::fillTemplate ( ilTemplate  $tpl)
protected

Reimplemented from ilStudyProgrammeProgressListGUI.

Definition at line 73 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

73 : void
74 {
75 parent::fillTemplate($tpl);
76
77 if ($this->showMyProgress()) {
78 $tpl->setVariable("ACTIVE_HEAD", "il_PrgAccordionHeadActive");
79 }
80
81 $tpl->setVariable("ACCORDION_ID", 'id="' . $this->getAccordionId() . '"');
82 $tpl->setVariable("HREF_TITLE");
83
84 $content = $this->getAccordionContentHTML();
85
86 if (trim($content)) {
87 $tpl->setCurrentBlock("expand");
88 $tpl->setVariable("EXP_ALT", $this->lng->txt("expand"));
89 $tpl->setVariable("EXP_IMG", $this->getExpandedImageURL());
90 $tpl->setVariable("NOT_EXP_ALT", $this->lng->txt("expanded"));
91 $tpl->setVariable("NOT_EXP_IMG", $this->getNotExpandedImageURL());
92 $tpl->parseCurrentBlock();
93 } else {
94 $tpl->touchBlock("indent");
95 }
96
97 for ($i = 0; $i < $this->getIndent(); $i++) {
98 $tpl->touchBlock("indent");
99 }
100
101 $tpl->setCurrentBlock("accordion");
102 if ($this->showMyProgress()) {
103 $tpl->setVariable("ACCORDION_HIDE_CONTENT");
104 } else {
105 $tpl->setVariable("ACCORDION_HIDE_CONTENT", "ilAccHideContent");
106 }
107 $tpl->setVariable("ACCORDION_CONTENT", $content);
108 $this->tpl->addOnloadCode("il.Accordion.add(" . json_encode($this->getAccordionOptions(), JSON_THROW_ON_ERROR) . ");");
110 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
touchBlock(string $block)
overwrites ITX::touchBlock.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.

References ilStudyProgrammeProgressListGUI\$tpl, getAccordionContentHTML(), getAccordionId(), getAccordionOptions(), getExpandedImageURL(), getIndent(), getNotExpandedImageURL(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\parseCurrentBlock(), ilTemplate\parseCurrentBlock(), ILIAS\UICore\GlobalTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), ILIAS\UICore\GlobalTemplate\setVariable(), showMyProgress(), and ILIAS\UICore\GlobalTemplate\touchBlock().

+ Here is the call graph for this function:

◆ getAccordionContentCoursesHTML()

ilStudyProgrammeExpandableProgressListGUI::getAccordionContentCoursesHTML ( )
protected

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

160 : string
161 {
163
164 $crs = array();
165 $prg = ilObjStudyProgramme::getInstanceByObjId($this->progress->getNodeId());
166 foreach ($prg->getLPChildren() as $il_obj_crs_ref) {
167 if (ilObject::_exists($il_obj_crs_ref->getRefId(), true) &&
168 is_null(ilObject::_lookupDeletedDate($il_obj_crs_ref->getRefId()))
169 ) {
170 continue;
171 }
172
173 $course = ilObjectFactory::getInstanceByRefId($il_obj_crs_ref->getTargetRefId());
174 $preloader->addItem($course->getId(), $course->getType(), $course->getRefId());
175 $crs[] = $course;
176 }
177 $preloader->preload();
178
179 return implode("\n", array_map(function (ilObjCourse $course) {
180 $item_gui = new ilStudyProgrammeCourseListGUI();
181 $this->configureItemGUI($item_gui);
182 $item_gui->setContainerObject(new ilStudyProgrammeContainerObjectMock($course));
183 return $item_gui->getListItemHTML(
184 $course->getRefId(),
185 $course->getId(),
186 $course->getTitle(),
187 $course->getDescription()
188 );
189 }, $crs));
190 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByObjId(int $obj_id)
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
Preloader for object list GUIs.
static _lookupDeletedDate(int $ref_id)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
Class ilStudyProgrammeCourseListGUI.

References ilObject\_exists(), ilObject\_lookupDeletedDate(), configureItemGUI(), ilObjectListGUI\CONTEXT_PERSONAL_DESKTOP, ilObject\getDescription(), ilObject\getId(), ilObjStudyProgramme\getInstanceByObjId(), ilObjectFactory\getInstanceByRefId(), ilObject\getRefId(), and ilObject\getTitle().

Referenced by getAccordionContentHTML().

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

◆ getAccordionContentHTML()

ilStudyProgrammeExpandableProgressListGUI::getAccordionContentHTML ( )
protected

Definition at line 112 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

112 : string
113 {
114 $programme = ilObjStudyProgramme::getInstanceByObjId($this->progress->getNodeId());
115
116 if (!$programme->hasLPChildren()) {
117 return $this->getAccordionContentProgressesHTML();
118 }
119
120 return $this->getAccordionContentCoursesHTML();
121 }

References getAccordionContentCoursesHTML(), getAccordionContentProgressesHTML(), and ilObjStudyProgramme\getInstanceByObjId().

Referenced by fillTemplate().

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

◆ getAccordionContentProgressesHTML()

ilStudyProgrammeExpandableProgressListGUI::getAccordionContentProgressesHTML ( )
protected

Definition at line 123 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

123 : string
124 {
125 // Make shouldShowSubProgress and newSubItem protected again afterwards, do
126 // the same in the derived class ilStudyProgrammeIndividualPlanProgressListGUI.
127 $child_progresses = $this->progress->getSubnodes();
128
129 return implode("\n", array_map(function (ilPRGProgress $progress) {
130 if (!$this->shouldShowSubProgress($progress)) {
131 return "";
132 }
133 $gui = $this->newSubItem($progress);
134 $gui->setIndent($this->getIndent() + 1);
135 return $gui->getHTML();
136 }, $child_progresses));
137 }
A Progress is the status of a user on a single node of an assignment; it is unique by assignment_id:u...

References ilStudyProgrammeProgressListGUI\$progress, getIndent(), newSubItem(), and shouldShowSubProgress().

Referenced by getAccordionContentHTML().

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

◆ getAccordionId()

ilStudyProgrammeExpandableProgressListGUI::getAccordionId ( )
protected

Definition at line 235 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

235 : string
236 {
237 return "prg_progress_" . $this->progress->getId() . "_" . $this->getIndent();
238 }

References getIndent().

Referenced by fillTemplate(), and getAccordionOptions().

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

◆ getAccordionOptions()

ilStudyProgrammeExpandableProgressListGUI::getAccordionOptions ( )
protected

Definition at line 213 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

213 : array
214 {
215 return [
216 "orientation" => "horizontal",
217 // Most propably we don't need this. Or do we want to call ilAccordion.initById?
218 "int_id" => "prg_progress_" . $this->progress->getId(),
219 "initial_opened" => null,
220 "behaviour" => "AllClosed", // or "FirstOpen"
221 "toggle_class" => 'il_PrgAccordionToggle',
222 "toggle_act_class" => 'foo',
223 "content_class" => 'il_PrgAccordionContent',
224 "width" => "auto",
225 "active_head_class" => "il_PrgAccordionHeadActive",
226 "height" => "auto",
227 "id" => $this->getAccordionId(),
228 "multi" => true,
229 "show_all_element" => null,
230 "hide_all_element" => null,
231 "reset_width" => true,
232 ];
233 }

References getAccordionId().

Referenced by fillTemplate().

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

◆ getExpandedImageURL()

ilStudyProgrammeExpandableProgressListGUI::getExpandedImageURL ( )
protected

Definition at line 240 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

240 : string
241 {
242 return ilUtil::getImagePath("nav/tree_exp.svg");
243 }

References ilUtil\getImagePath().

Referenced by fillTemplate().

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

◆ getHTML()

ilStudyProgrammeExpandableProgressListGUI::getHTML ( )

Reimplemented from ilStudyProgrammeProgressListGUI.

Definition at line 66 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

References addCSS(), and addJavaScript().

+ Here is the call graph for this function:

◆ getIndent()

ilStudyProgrammeExpandableProgressListGUI::getIndent ( )
protected

◆ getNotExpandedImageURL()

ilStudyProgrammeExpandableProgressListGUI::getNotExpandedImageURL ( )
protected

Definition at line 245 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

245 : string
246 {
247 return ilUtil::getImagePath("nav/tree_col.svg");
248 }

References ilUtil\getImagePath().

Referenced by fillTemplate().

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

◆ getTitleAndIconTarget()

ilStudyProgrammeExpandableProgressListGUI::getTitleAndIconTarget ( ilPRGProgress  $progress)
protected

Reimplemented from ilStudyProgrammeProgressListGUI.

Definition at line 250 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

250 : ?string
251 {
252 return null;
253 }

◆ newSubItem()

ilStudyProgrammeExpandableProgressListGUI::newSubItem ( ilPRGProgress  $progress)
protected

◆ setIndent()

ilStudyProgrammeExpandableProgressListGUI::setIndent ( int  $indent)

Definition at line 60 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

60 : void
61 {
62 assert($indent >= 0);
63 $this->indent = $indent;
64 }

References $indent.

◆ shouldShowSubProgress()

ilStudyProgrammeExpandableProgressListGUI::shouldShowSubProgress ( ilPRGProgress  $progress)
protected

Reimplemented in ilStudyProgrammeIndividualPlanProgressListGUI.

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

139 : bool
140 {
141 if ($progress->isRelevant()) {
143
144 $can_read = $this->access->checkAccess("read", "", $prg->getRefId(), "prg", $prg->getId());
145 if ($this->visible_on_pd_mode === ilObjStudyProgrammeAdmin::SETTING_VISIBLE_ON_PD_READ && !$can_read) {
146 return false;
147 }
148
149 return true;
150 }
151
152 return false;
153 }

References ilStudyProgrammeProgressListGUI\$progress, ILIAS\Repository\access(), ilObjStudyProgramme\getInstanceByObjId(), ilPRGProgress\getNodeId(), ilPRGProgress\isRelevant(), and ilObjStudyProgrammeAdmin\SETTING_VISIBLE_ON_PD_READ.

Referenced by getAccordionContentProgressesHTML().

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

◆ showMyProgress()

ilStudyProgrammeExpandableProgressListGUI::showMyProgress ( )
protected

Reimplemented in ilStudyProgrammeIndividualPlanProgressListGUI.

Definition at line 255 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

255 : bool
256 {
257 $prg_progress_id = $this->request_wrapper->retrieve("prg_progress_id", $this->refinery->kindlyTo()->int());
258 return $prg_progress_id === $this->progress->getId();
259 }

References ILIAS\Repository\refinery().

Referenced by fillTemplate().

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

Field Documentation

◆ $access

ilAccess ilStudyProgrammeExpandableProgressListGUI::$access
protected

◆ $alert_icon

string ilStudyProgrammeExpandableProgressListGUI::$alert_icon
protected

◆ $css_added

bool ilStudyProgrammeExpandableProgressListGUI::$css_added = false
protected

◆ $indent

int ilStudyProgrammeExpandableProgressListGUI::$indent = 0
protected

Definition at line 29 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

Referenced by getIndent(), and setIndent().

◆ $js_added

bool ilStudyProgrammeExpandableProgressListGUI::$js_added = false
protected

◆ $rbacsystem

ilRbacSystem ilStudyProgrammeExpandableProgressListGUI::$rbacsystem
protected

◆ $refinery

ILIAS Refinery Factory ilStudyProgrammeExpandableProgressListGUI::$refinery
protected

◆ $request_wrapper

ILIAS HTTP Wrapper RequestWrapper ilStudyProgrammeExpandableProgressListGUI::$request_wrapper
protected

◆ $setting

ilSetting ilStudyProgrammeExpandableProgressListGUI::$setting
protected

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