ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilStudyProgrammeExpandableProgressListGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

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

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeExpandableProgressListGUI::__construct ( ilPRGProgress  $progress)

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

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

35  {
36  parent::__construct($progress);
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("icon_alert.svg"), $this->lng->txt("warning"))
51  ->withSize('medium')
52  );
53  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ 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.

Referenced by getHTML().

279  {
280  if ($this->css_added) {
281  return false;
282  }
283 
284  $this->tpl->addCSS("Modules/StudyProgramme/templates/css/ilStudyProgramme.css");
285  $this->css_added = true;
286  }
+ Here is the caller graph for this function:

◆ addJavaScript()

ilStudyProgrammeExpandableProgressListGUI::addJavaScript ( )
protected
Returns
false|void

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

References iljQueryUtil\initjQueryUI().

Referenced by getHTML().

265  {
266  if ($this->js_added) {
267  return false;
268  }
269 
271  $this->tpl->addJavaScript("./Services/Accordion/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.txt for included components)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ configureItemGUI()

ilStudyProgrammeExpandableProgressListGUI::configureItemGUI ( ilStudyProgrammeCourseListGUI  $item_gui)
protected

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

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().

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  }
enableCommands(bool $status, bool $std_only=false)
enableDelete(bool $status)
enableSubscribe(bool $status)
enableInfoScreen(bool $info_screen)
enablePreconditions(bool $status)
enableProperties(bool $status)
enableNoticeProperties(bool $status)
enableComments(bool $value, bool $enable_comments_settings=true)
enableProgressInfo(bool $status)
enableCheckbox(bool $status)
enableDescription(bool $status)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillTemplate()

ilStudyProgrammeExpandableProgressListGUI::fillTemplate ( ilTemplate  $tpl)
protected

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

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

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) . ");");
109  $tpl->parseCurrentBlock();
110  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
touchBlock(string $block)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ getAccordionContentCoursesHTML()

ilStudyProgrammeExpandableProgressListGUI::getAccordionContentCoursesHTML ( )
protected

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

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().

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 _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByObjId(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupDeletedDate(int $ref_id)
+ 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.

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

Referenced by fillTemplate().

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  }
static getInstanceByObjId(int $obj_id)
+ 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.

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

Referenced by getAccordionContentHTML().

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

References getIndent().

Referenced by fillTemplate(), and getAccordionOptions().

235  : string
236  {
237  return "prg_progress_" . $this->progress->getId() . "_" . $this->getIndent();
238  }
+ 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.

References getAccordionId().

Referenced by fillTemplate().

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

References ilUtil\getImagePath().

Referenced by fillTemplate().

240  : string
241  {
242  return ilUtil::getImagePath("tree_exp.svg");
243  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilStudyProgrammeExpandableProgressListGUI::getHTML ( )

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.

References ilUtil\getImagePath().

Referenced by fillTemplate().

245  : string
246  {
247  return ilUtil::getImagePath("tree_col.svg");
248  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTitleAndIconTarget()

ilStudyProgrammeExpandableProgressListGUI::getTitleAndIconTarget ( ilPRGProgress  $progress)
protected

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

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

◆ newSubItem()

ilStudyProgrammeExpandableProgressListGUI::newSubItem ( ilPRGProgress  $progress)
protected

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

Referenced by getAccordionContentProgressesHTML().

156  {
157  return new ilStudyProgrammeExpandableProgressListGUI($progress);
158  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ setIndent()

ilStudyProgrammeExpandableProgressListGUI::setIndent ( int  $indent)

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

References $indent.

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

◆ shouldShowSubProgress()

ilStudyProgrammeExpandableProgressListGUI::shouldShowSubProgress ( ilPRGProgress  $progress)
protected

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

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

Referenced by getAccordionContentProgressesHTML().

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  }
static getInstanceByObjId(int $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showMyProgress()

ilStudyProgrammeExpandableProgressListGUI::showMyProgress ( )
protected

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

References ILIAS\Repository\refinery().

Referenced by fillTemplate().

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  }
+ 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: