ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilStudyProgrammeExpandableProgressListGUI Class Reference

Class ilStudyProgrammeExpandableProgressListGUI. More...

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

Public Member Functions

 __construct (ilStudyProgrammeUserProgress $a_progress)
 
 getIndent ()
 
 setIndent ($a_indent)
 
 getHTML ()
 
 shouldShowSubProgress (ilStudyProgrammeUserProgress $a_progress)
 
 newSubItem (ilStudyProgrammeUserProgress $a_progress)
 
 configureItemGUI (ilStudyProgrammeCourseListGUI $a_item_gui)
 
- 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

 fillTemplate ($tpl)
 
 getAccordionContentHTML ()
 
 getAccordionContentProgressesHTML ()
 
 getAccordionContentCoursesHTML ()
 
 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 41 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

References $ilSetting, and $tpl.

41  {
42  parent::__construct($a_progress);
43 
44  global $tpl, $rbacsystem, $ilSetting, $ilAccess;
45  $this->il_tpl = $tpl;
46  $this->il_rbacsystem = $rbacsystem;
47  $this->il_setting = $ilSetting;
48  $this->il_access = $ilAccess;
49  }
global $tpl
Definition: ilias.php:8
global $ilSetting
Definition: privfeed.php:40

Member Function Documentation

◆ addCSS()

ilStudyProgrammeExpandableProgressListGUI::addCSS ( )
protected

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

Referenced by getHTML().

258  {
259  if ($this->css_added) {
260  return false;
261  }
262 
263  $this->il_tpl->addCSS("Modules/StudyProgramme/templates/css/ilStudyProgramme.css");
264  $this->css_added = true;
265  }
+ Here is the caller graph for this function:

◆ addJavaScript()

ilStudyProgrammeExpandableProgressListGUI::addJavaScript ( )
protected

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

References iljQueryUtil\initjQueryUI().

Referenced by getHTML().

247  {
248  if ($this->js_added) {
249  return false;
250  }
251 
252  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
254  $this->il_tpl->addJavaScript("./Services/Accordion/js/accordion.js", true, 3);
255  $this->js_added = true;
256  }
static initjQueryUI()
Init jQuery UI (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)

Definition at line 182 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\enablePayment(), ilObjectListGUI\enablePreconditions(), ilObjectListGUI\enableProgressInfo(), ilObjectListGUI\enableProperties(), ilObjectListGUI\enableSubscribe(), ilObjectListGUI\enableTags(), getIndent(), and ilStudyProgrammeCourseListGUI\setIndent().

182  {
183  $a_item_gui->enableComments(false);
184  $a_item_gui->enableTags(false);
185  $a_item_gui->enableIcon(true);
186  $a_item_gui->enableDelete(false);
187  $a_item_gui->enableCut(false);
188  $a_item_gui->enableCopy(false);
189  $a_item_gui->enablePayment(false);
190  $a_item_gui->enableLink(false);
191  $a_item_gui->enableInfoScreen(true);
192  $a_item_gui->enableSubscribe(true);
193  $a_item_gui->enableCheckbox(false);
194  $a_item_gui->enableDescription(true);
195  $a_item_gui->enableProperties(true);
196  $a_item_gui->enablePreconditions(true);
197  $a_item_gui->enableNoticeProperties(true);
198  $a_item_gui->enableCommands(true, true);
199  $a_item_gui->enableProgressInfo(true);
200  $a_item_gui->setIndent($this->getIndent() + 2);
201  }
enableInfoScreen($a_info_screen)
En/disable path.
enablePayment($a_status)
En/disable payment.
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:

◆ fillTemplate()

ilStudyProgrammeExpandableProgressListGUI::fillTemplate (   $tpl)
protected

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

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

67  {
68  require_once("./Services/JSON/classes/class.ilJsonUtil.php");
69 
70  parent::fillTemplate($tpl);
71 
72  if ($this->showMyProgress()) {
73  $tpl->setVariable("ACTIVE_HEAD", "il_PrgAccordionHeadActive");
74  }
75 
76  $tpl->setVariable("ACCORDION_ID", 'id="'.$this->getAccordionId().'"');
77  $tpl->setVariable("HREF_TITLE", "");
78 
79  $content = $this->getAccordionContentHTML();
80 
81  if (trim($content)) {
82  $tpl->setCurrentBlock("expand");
83  $tpl->setVariable("EXP_ALT", $this->il_lng->txt("expand"));
84  $tpl->setVariable("EXP_IMG", $this->getExpandedImageURL());
85  $tpl->setVariable("NOT_EXP_ALT", $this->il_lng->txt("expanded"));
86  $tpl->setVariable("NOT_EXP_IMG", $this->getNotExpandedImageURL());
87  $tpl->parseCurrentBlock();
88  }
89  else {
90  $tpl->touchBlock("indent");
91  }
92 
93  for($i = 0; $i < $this->getIndent(); $i++) {
94  $tpl->touchBlock("indent");
95  }
96 
97  $tpl->setCurrentBlock("accordion");
98  if ($this->showMyProgress()) {
99  $tpl->setVariable("ACCORDION_HIDE_CONTENT", "");
100  }
101  else {
102  $tpl->setVariable("ACCORDION_HIDE_CONTENT", "ilAccHideContent");
103  }
104  $tpl->setVariable("ACCORDION_CONTENT", $content);
105  $tpl->setVariable("ACCORDION_OPTIONS", ilJsonUtil::encode($this->getAccordionOptions()));
106  $tpl->parseCurrentBlock();
107  }
global $tpl
Definition: ilias.php:8
static encode($mixed, $suppress_native=false)
+ Here is the call graph for this function:

◆ getAccordionContentCoursesHTML()

ilStudyProgrammeExpandableProgressListGUI::getAccordionContentCoursesHTML ( )
protected

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

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

Referenced by getAccordionContentHTML().

151  {
152  include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
154 
155  $crs = array();
156  foreach ($this->progress->getStudyProgramme()->getLPChildren() as $il_obj_crs_ref) {
157  $course = ilObjectFactory::getInstanceByRefId($il_obj_crs_ref->getTargetRefId());
158  $preloader->addItem($course->getId(), $course->getType(), $course->getRefId());
159  $crs[] = $course;
160  }
161  $preloader->preload();
162 
163  //TODO: remove when PHP5.3 support is canceld
164  $self = $this;
165  return implode("\n", array_map(function(ilObjCourse $course) use ($self) {
166  require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeCourseListGUI.php");
167  require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeContainerObjectMock.php");
168 
169  $item_gui = new ilStudyProgrammeCourseListGUI();
170  $self->configureItemGUI($item_gui);
171  $item_gui->setContainerObject(new ilStudyProgrammeContainerObjectMock($course));
172  return $item_gui->getListItemHTML
173  ( $course->getRefId()
174  , $course->getId()
175  , $course->getTitle()
176  , $course->getDescription()
177  );
178  }, $crs));
179  }
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Preloader for object list GUIs.
Class ilObjCourse.
getId()
get object id public
getTitle()
get object title public
getDescription()
get object description
getRefId()
get reference id public
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 109 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

References getAccordionContentCoursesHTML(), and getAccordionContentProgressesHTML().

Referenced by fillTemplate().

109  {
110  if (!$this->progress->getStudyProgramme()->hasLPChildren()) {
111  return $this->getAccordionContentProgressesHTML();
112  }
113  else {
114  return $this->getAccordionContentCoursesHTML();
115  }
116  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAccordionContentProgressesHTML()

ilStudyProgrammeExpandableProgressListGUI::getAccordionContentProgressesHTML ( )
protected

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

References ilStudyProgrammeProgressListGUI\$progress.

Referenced by getAccordionContentHTML().

118  {
119  // TODO: $this could be removed as soon as support for PHP 5.3 is dropped:
120  $self = $this;
121  // Make shouldShowSubProgress and newSubItem protected again afterwards, do
122  // the same in the derived class ilStudyProgrammeIndividualPlanProgressListGUI.
123  return implode("\n", array_map(function(ilStudyProgrammeUserProgress $progress) use ($self) {
124  if (!$self->shouldShowSubProgress($progress)) {
125  return "";
126  }
127  $gui = $self->newSubItem($progress);
128  $gui->setIndent($self->getIndent() + 1);
129  return $gui->getHTML();
130  }, $this->progress->getChildrenProgress()));
131  }
Represents the progress of a user at one node of a study programme.
+ Here is the caller graph for this function:

◆ getAccordionId()

ilStudyProgrammeExpandableProgressListGUI::getAccordionId ( )
protected

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

References getIndent().

Referenced by fillTemplate(), and getAccordionOptions().

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

◆ getAccordionOptions()

ilStudyProgrammeExpandableProgressListGUI::getAccordionOptions ( )
protected

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

References getAccordionId().

Referenced by fillTemplate().

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

◆ getExpandedImageURL()

ilStudyProgrammeExpandableProgressListGUI::getExpandedImageURL ( )
protected

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

References ilUtil\getImagePath().

Referenced by fillTemplate().

229  {
230  require_once("Services/Utilities/classes/class.ilUtil.php");
231  return ilUtil::getImagePath("tree_exp.svg");
232  }
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 61 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

References addCSS(), and addJavaScript().

+ Here is the call graph for this function:

◆ getIndent()

ilStudyProgrammeExpandableProgressListGUI::getIndent ( )

◆ getNotExpandedImageURL()

ilStudyProgrammeExpandableProgressListGUI::getNotExpandedImageURL ( )
protected

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

References ilUtil\getImagePath().

Referenced by fillTemplate().

234  {
235  require_once("Services/Utilities/classes/class.ilUtil.php");
236  return ilUtil::getImagePath("tree_col.svg");
237  }
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 239 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

239  {
240  return null;
241  }

◆ newSubItem()

ilStudyProgrammeExpandableProgressListGUI::newSubItem ( ilStudyProgrammeUserProgress  $a_progress)

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

147  {
148  return new ilStudyProgrammeExpandableProgressListGUI($a_progress);
149  }

◆ setIndent()

ilStudyProgrammeExpandableProgressListGUI::setIndent (   $a_indent)

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

55  {
56  assert(is_int($a_indent));
57  assert($a_indent >= 0);
58  $this->indent = $a_indent;
59  }

◆ shouldShowSubProgress()

ilStudyProgrammeExpandableProgressListGUI::shouldShowSubProgress ( ilStudyProgrammeUserProgress  $a_progress)

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

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

133  {
134  if($a_progress->isRelevant()) {
135  $prg = $a_progress->getStudyProgramme();
136  $can_read = $this->il_access->checkAccess("read", "", $prg->getRefId(), "prg", $prg->getId());
137  if($this->visible_on_pd_mode == ilObjStudyProgrammeAdmin::SETTING_VISIBLE_ON_PD_READ && !$can_read) {
138  return false;
139  }
140 
141  return true;
142  }
143 
144  return false;
145  }
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:

◆ showMyProgress()

ilStudyProgrammeExpandableProgressListGUI::showMyProgress ( )
protected

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

References $_GET.

Referenced by fillTemplate().

243  {
244  return $_GET["prg_progress_id"] == $this->progress->getId();
245  }
$_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 19 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: