ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilStudyProgrammeExpandableProgressListGUI Class Reference

Class ilStudyProgrammeExpandableProgressListGUI. More...

+ Inheritance diagram for ilStudyProgrammeExpandableProgressListGUI:
+ Collaboration diagram for ilStudyProgrammeExpandableProgressListGUI:

Public Member Functions

 __construct (ilStudyProgrammeUserProgress $a_progress)
 
 setIndent ($a_indent)
 
 getHTML ()
 
- Public Member Functions inherited from ilStudyProgrammeProgressListGUI
 __construct (ilStudyProgrammeUserProgress $a_progress)
 
 getHTML ()
 
 setShowInfoMessage ($show_info_mesage)
 
 setVisibleOnPDMode ($visible_on_pd_mode)
 
 setOnlyRelevant ($only_relevant)
 

Protected Member Functions

 getIndent ()
 
 fillTemplate ($tpl)
 
 getAccordionContentHTML ()
 
 getAccordionContentProgressesHTML ()
 
 shouldShowSubProgress (ilStudyProgrammeUserProgress $a_progress)
 
 newSubItem (ilStudyProgrammeUserProgress $a_progress)
 
 getAccordionContentCoursesHTML ()
 
 configureItemGUI (ilStudyProgrammeCourseListGUI $a_item_gui)
 
 getAccordionOptions ()
 
 getAccordionId ()
 
 getExpandedImageURL ()
 
 getNotExpandedImageURL ()
 
 getTitleAndIconTarget (ilStudyProgrammeUserProgress $a_progress)
 
 showMyProgress ()
 
 addJavaScript ()
 
 addCSS ()
 
- Protected Member Functions inherited from ilStudyProgrammeProgressListGUI
 fillTemplate ($tpl)
 
 getTitleForItem (ilObjStudyProgramme $a_programme)
 
 getTemplate ($a_component, $a_file, $a_remove_unknown_vars, $a_remove_empty_blocks)
 
 getIconPath ($a_obj_id)
 
 getAltIcon ($a_obj_id)
 
 getTitleAndIconTarget (ilStudyProgrammeUserProgress $a_progress)
 
 buildProgressBar (ilStudyProgrammeUserProgress $a_progress)
 
 buildToolTip (ilStudyProgrammeUserProgress $a_progress)
 
 buildProgressStatus (ilStudyProgrammeUserProgress $a_progress)
 
 showMoreObjectsInfo ($programme)
 

Protected Attributes

 $indent = 0
 
 $js_added = false
 
 $css_added = false
 
 $il_tpl
 
 $il_rbacsystem
 
- Protected Attributes inherited from ilStudyProgrammeProgressListGUI
 $il_lng
 
 $il_ctrl
 
 $progress
 
 $html
 
 $show_info_mesage
 
 $visible_on_pd_mode
 
 $only_relevant = false
 

Additional Inherited Members

- Data Fields inherited from ilStudyProgrammeProgressListGUI
const SUCCESSFUL_PROGRESS_CSS_CLASS = "ilCourseObjectiveProgressBarCompleted"
 
const NON_SUCCESSFUL_PROGRESS_CSS_CLASS = "ilCourseObjectiveProgressBarNeutral"
 
- Static Protected Attributes inherited from ilStudyProgrammeProgressListGUI
static $tpl_file = "tpl.progress_list_item.html"
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeExpandableProgressListGUI::__construct ( ilStudyProgrammeUserProgress  $a_progress)

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

References $DIC, $ilSetting, and $tpl.

43  {
44  parent::__construct($a_progress);
45 
46  global $DIC;
47  $tpl = $DIC['tpl'];
48  $rbacsystem = $DIC['rbacsystem'];
49  $ilSetting = $DIC['ilSetting'];
50  $ilAccess = $DIC['ilAccess'];
51  $this->il_tpl = $tpl;
52  $this->il_rbacsystem = $rbacsystem;
53  $this->il_setting = $ilSetting;
54  $this->il_access = $ilAccess;
55  }
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
global $ilSetting
Definition: privfeed.php:17

Member Function Documentation

◆ addCSS()

ilStudyProgrammeExpandableProgressListGUI::addCSS ( )
protected

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

Referenced by getHTML().

272  {
273  if ($this->css_added) {
274  return false;
275  }
276 
277  $this->il_tpl->addCSS("Modules/StudyProgramme/templates/css/ilStudyProgramme.css");
278  $this->css_added = true;
279  }
+ Here is the caller graph for this function:

◆ addJavaScript()

ilStudyProgrammeExpandableProgressListGUI::addJavaScript ( )
protected

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

References iljQueryUtil\initjQueryUI().

Referenced by getHTML().

260  {
261  if ($this->js_added) {
262  return false;
263  }
264 
265  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
267  $this->il_tpl->addJavaScript("./Services/Accordion/js/accordion.js", true, 3);
268  $this->js_added = true;
269  }
static initjQueryUI($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  $a_item_gui)
protected

Definition at line 189 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().

190  {
191  $a_item_gui->enableComments(false);
192  $a_item_gui->enableTags(false);
193  $a_item_gui->enableIcon(true);
194  $a_item_gui->enableDelete(false);
195  $a_item_gui->enableCut(false);
196  $a_item_gui->enableCopy(false);
197  $a_item_gui->enableLink(false);
198  $a_item_gui->enableInfoScreen(true);
199  $a_item_gui->enableSubscribe(true);
200  $a_item_gui->enableCheckbox(false);
201  $a_item_gui->enableDescription(true);
202  $a_item_gui->enableProperties(true);
203  $a_item_gui->enablePreconditions(true);
204  $a_item_gui->enableNoticeProperties(true);
205  $a_item_gui->enableCommands(true, true);
206  $a_item_gui->enableProgressInfo(true);
207  $a_item_gui->setIndent($this->getIndent() + 2);
208  }
enableInfoScreen($a_info_screen)
En/disable path.
enableDelete($a_status)
En/disable delete.
enableProperties($a_status)
En/disable properties.
enableCut($a_status)
En/disable cut.
enableSubscribe($a_status)
En/disable subscribe.
enablePreconditions($a_status)
En/disable preconditions.
enableDescription($a_status)
En/disable description.
enableProgressInfo($a_status)
enable progress info
enableNoticeProperties($a_status)
En/disable notices.
enableCommands($a_status, $a_std_only=false)
En/disable commands.
enableCopy($a_status)
En/disable copy.
enableComments($a_value, $a_enable_comments_settings=true)
Toogle comments action status.
enableIcon($a_status)
En/Dis-able icons.
enableCheckbox($a_status)
En/Dis-able checkboxes.
enableTags($a_value)
Toogle tags action status.
enableLink($a_status)
En/disable link.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillTemplate()

ilStudyProgrammeExpandableProgressListGUI::fillTemplate (   $tpl)
protected

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

References $i, $tpl, ilJsonUtil\encode(), getAccordionContentHTML(), getAccordionId(), getAccordionOptions(), getExpandedImageURL(), getIndent(), getNotExpandedImageURL(), and showMyProgress().

77  {
78  require_once("./Services/JSON/classes/class.ilJsonUtil.php");
79 
80  parent::fillTemplate($tpl);
81 
82  if ($this->showMyProgress()) {
83  $tpl->setVariable("ACTIVE_HEAD", "il_PrgAccordionHeadActive");
84  }
85 
86  $tpl->setVariable("ACCORDION_ID", 'id="' . $this->getAccordionId() . '"');
87  $tpl->setVariable("HREF_TITLE", "");
88 
89  $content = $this->getAccordionContentHTML();
90 
91  if (trim($content)) {
92  $tpl->setCurrentBlock("expand");
93  $tpl->setVariable("EXP_ALT", $this->il_lng->txt("expand"));
94  $tpl->setVariable("EXP_IMG", $this->getExpandedImageURL());
95  $tpl->setVariable("NOT_EXP_ALT", $this->il_lng->txt("expanded"));
96  $tpl->setVariable("NOT_EXP_IMG", $this->getNotExpandedImageURL());
97  $tpl->parseCurrentBlock();
98  } else {
99  $tpl->touchBlock("indent");
100  }
101 
102  for ($i = 0; $i < $this->getIndent(); $i++) {
103  $tpl->touchBlock("indent");
104  }
105 
106  $tpl->setCurrentBlock("accordion");
107  if ($this->showMyProgress()) {
108  $tpl->setVariable("ACCORDION_HIDE_CONTENT", "");
109  } else {
110  $tpl->setVariable("ACCORDION_HIDE_CONTENT", "ilAccHideContent");
111  }
112  $tpl->setVariable("ACCORDION_CONTENT", $content);
113  $this->il_tpl->addOnloadCode("il.Accordion.add(" . ilJsonUtil::encode($this->getAccordionOptions()) . ");");
114  $tpl->parseCurrentBlock();
115  }
$tpl
Definition: ilias.php:10
static encode($mixed, $suppress_native=false)
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:

◆ getAccordionContentCoursesHTML()

ilStudyProgrammeExpandableProgressListGUI::getAccordionContentCoursesHTML ( )
protected

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

References array, configureItemGUI(), ilObjectListGUI\CONTEXT_PERSONAL_DESKTOP, ilObject\getDescription(), ilObject\getId(), ilObjectFactory\getInstanceByRefId(), ilObject\getRefId(), and ilObject\getTitle().

Referenced by getAccordionContentHTML().

161  {
162  include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
164 
165  $crs = array();
166  foreach ($this->progress->getStudyProgramme()->getLPChildren() as $il_obj_crs_ref) {
167  $course = ilObjectFactory::getInstanceByRefId($il_obj_crs_ref->getTargetRefId());
168  $preloader->addItem($course->getId(), $course->getType(), $course->getRefId());
169  $crs[] = $course;
170  }
171  $preloader->preload();
172 
173  return implode("\n", array_map(function (ilObjCourse $course) {
174  require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeCourseListGUI.php");
175  require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeContainerObjectMock.php");
176 
177  $item_gui = new ilStudyProgrammeCourseListGUI();
178  $this->configureItemGUI($item_gui);
179  $item_gui->setContainerObject(new ilStudyProgrammeContainerObjectMock($course));
180  return $item_gui->getListItemHTML(
181  $course->getRefId(),
182  $course->getId(),
183  $course->getTitle(),
184  $course->getDescription()
185  );
186  }, $crs));
187  }
Preloader for object list GUIs.
Class ilObjCourse.
getId()
get object id public
getTitle()
get object title public
getDescription()
get object description
Create styles array
The data for the language used.
getRefId()
get reference id public
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilStudyProgrammeCourseListGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAccordionContentHTML()

ilStudyProgrammeExpandableProgressListGUI::getAccordionContentHTML ( )
protected

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

References getAccordionContentCoursesHTML(), and getAccordionContentProgressesHTML().

Referenced by fillTemplate().

118  {
119  if (!$this->progress->getStudyProgramme()->hasLPChildren()) {
120  return $this->getAccordionContentProgressesHTML();
121  } else {
122  return $this->getAccordionContentCoursesHTML();
123  }
124  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAccordionContentProgressesHTML()

ilStudyProgrammeExpandableProgressListGUI::getAccordionContentProgressesHTML ( )
protected

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

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

Referenced by getAccordionContentHTML().

127  {
128  // Make shouldShowSubProgress and newSubItem protected again afterwards, do
129  // the same in the derived class ilStudyProgrammeIndividualPlanProgressListGUI.
130  return implode("\n", array_map(function (ilStudyProgrammeUserProgress $progress) {
131  if (!$this->shouldShowSubProgress($progress)) {
132  return "";
133  }
134  $gui = $this->newSubItem($progress);
135  $gui->setIndent($this->getIndent() + 1);
136  return $gui->getHTML();
137  }, $this->progress->getChildrenProgress()));
138  }
Represents the progress of a user at one node of a study programme.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAccordionId()

ilStudyProgrammeExpandableProgressListGUI::getAccordionId ( )
protected

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

References getIndent().

Referenced by fillTemplate(), and getAccordionOptions().

233  {
234  return "prg_progress_" . $this->progress->getId() . "_" . $this->getIndent();
235  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAccordionOptions()

ilStudyProgrammeExpandableProgressListGUI::getAccordionOptions ( )
protected

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

References array, and getAccordionId().

Referenced by fillTemplate().

211  {
212  return array( "orientation" => "horizontal"
213  // Most propably we don't need this. Or do we want to call ilAccordion.initById?
214  , "int_id" => "prg_progress_" . $this->progress->getId()
215  , "initial_opened" => null
216  //, "save_url" => "./ilias.php?baseClass=ilaccordionpropertiesstorage&cmd=setOpenedTab&accordion_id=".$this->getId()."&user_id=".$ilUser->getId();
217  , "behaviour" => "AllClosed" // or "FirstOpen"
218  , "toggle_class" => 'il_PrgAccordionToggle'
219  , "toggle_act_class" => 'foo'
220  , "content_class" => 'il_PrgAccordionContent'
221  , "width" => "auto"
222  , "active_head_class" => "il_PrgAccordionHeadActive"
223  , "height" => "auto"
224  , "id" => $this->getAccordionId()
225  , "multi" => true
226  , "show_all_element" => null
227  , "hide_all_element" => null
228  , "reset_width" => true
229  );
230  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExpandedImageURL()

ilStudyProgrammeExpandableProgressListGUI::getExpandedImageURL ( )
protected

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

References ilUtil\getImagePath().

Referenced by fillTemplate().

238  {
239  require_once("Services/Utilities/classes/class.ilUtil.php");
240  return ilUtil::getImagePath("tree_exp.svg");
241  }
static getImagePath($img, $module_path="", $mode="output", $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 69 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 243 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

References ilUtil\getImagePath().

Referenced by fillTemplate().

244  {
245  require_once("Services/Utilities/classes/class.ilUtil.php");
246  return ilUtil::getImagePath("tree_col.svg");
247  }
static getImagePath($img, $module_path="", $mode="output", $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 ( ilStudyProgrammeUserProgress  $a_progress)
protected

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

250  {
251  return null;
252  }

◆ newSubItem()

ilStudyProgrammeExpandableProgressListGUI::newSubItem ( ilStudyProgrammeUserProgress  $a_progress)
protected

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

Referenced by getAccordionContentProgressesHTML().

156  {
157  return new ilStudyProgrammeExpandableProgressListGUI($a_progress);
158  }
+ Here is the caller graph for this function:

◆ setIndent()

ilStudyProgrammeExpandableProgressListGUI::setIndent (   $a_indent)

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

63  {
64  assert(is_int($a_indent));
65  assert($a_indent >= 0);
66  $this->indent = $a_indent;
67  }

◆ shouldShowSubProgress()

ilStudyProgrammeExpandableProgressListGUI::shouldShowSubProgress ( ilStudyProgrammeUserProgress  $a_progress)
protected

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

References ilStudyProgrammeUserProgress\getStudyProgramme(), ilStudyProgrammeUserProgress\isRelevant(), and ilObjStudyProgrammeAdmin\SETTING_VISIBLE_ON_PD_READ.

Referenced by getAccordionContentProgressesHTML().

141  {
142  if ($a_progress->isRelevant()) {
143  $prg = $a_progress->getStudyProgramme();
144  $can_read = $this->il_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  }
isRelevant()
Check whether this node is relevant for the user.
getStudyProgramme()
Get the program node where this progress belongs to was made.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showMyProgress()

ilStudyProgrammeExpandableProgressListGUI::showMyProgress ( )
protected

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

References $_GET.

Referenced by fillTemplate().

255  {
256  return $_GET["prg_progress_id"] == $this->progress->getId();
257  }
$_GET["client_id"]
+ Here is the caller graph for this function:

Field Documentation

◆ $css_added

ilStudyProgrammeExpandableProgressListGUI::$css_added = false
protected

◆ $il_rbacsystem

ilStudyProgrammeExpandableProgressListGUI::$il_rbacsystem
protected

◆ $il_tpl

ilStudyProgrammeExpandableProgressListGUI::$il_tpl
protected

◆ $indent

ilStudyProgrammeExpandableProgressListGUI::$indent = 0
protected

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

Referenced by getIndent().

◆ $js_added

ilStudyProgrammeExpandableProgressListGUI::$js_added = false
protected

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