ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)

Reimplemented from ilStudyProgrammeProgressListGUI.

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

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

References $DIC, $ilSetting, and $tpl.

Member Function Documentation

◆ addCSS()

ilStudyProgrammeExpandableProgressListGUI::addCSS ( )
protected

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

256 {
257 if ($this->css_added) {
258 return false;
259 }
260
261 $this->il_tpl->addCSS("Modules/StudyProgramme/templates/css/ilStudyProgramme.css");
262 $this->css_added = true;
263 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ addJavaScript()

ilStudyProgrammeExpandableProgressListGUI::addJavaScript ( )
protected

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

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

Reimplemented in ilStudyProgrammeIndividualPlanProgressListGUI.

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

181 {
182 $a_item_gui->enableComments(false);
183 $a_item_gui->enableTags(false);
184 $a_item_gui->enableIcon(true);
185 $a_item_gui->enableDelete(false);
186 $a_item_gui->enableCut(false);
187 $a_item_gui->enableCopy(false);
188 $a_item_gui->enableLink(false);
189 $a_item_gui->enableInfoScreen(true);
190 $a_item_gui->enableSubscribe(true);
191 $a_item_gui->enableCheckbox(false);
192 $a_item_gui->enableDescription(true);
193 $a_item_gui->enableProperties(true);
194 $a_item_gui->enablePreconditions(true);
195 $a_item_gui->enableNoticeProperties(true);
196 $a_item_gui->enableCommands(true, true);
197 $a_item_gui->enableProgressInfo(true);
198 $a_item_gui->setIndent($this->getIndent() + 2);
199 }
enableDescription($a_status)
En/disable description.
enableCommands($a_status, $a_std_only=false)
En/disable commands.
enableProperties($a_status)
En/disable properties.
enableLink($a_status)
En/disable link.
enableCheckbox($a_status)
En/Dis-able checkboxes.
enableNoticeProperties($a_status)
En/disable notices.
enableIcon($a_status)
En/Dis-able icons.
enableCopy($a_status)
En/disable copy.
enablePreconditions($a_status)
En/disable preconditions.
enableTags($a_value)
Toogle tags action status.
enableCut($a_status)
En/disable cut.
enableProgressInfo($a_status)
enable progress info
enableSubscribe($a_status)
En/disable subscribe.
enableComments($a_value, $a_enable_comments_settings=true)
Toogle comments action status.
enableInfoScreen($a_info_screen)
En/disable path.
enableDelete($a_status)
En/disable delete.

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 (   $tpl)
protected

Reimplemented from ilStudyProgrammeProgressListGUI.

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

71 {
72 require_once("./Services/JSON/classes/class.ilJsonUtil.php");
73
74 parent::fillTemplate($tpl);
75
76 if ($this->showMyProgress()) {
77 $tpl->setVariable("ACTIVE_HEAD", "il_PrgAccordionHeadActive");
78 }
79
80 $tpl->setVariable("ACCORDION_ID", 'id="'.$this->getAccordionId().'"');
81 $tpl->setVariable("HREF_TITLE", "");
82
83 $content = $this->getAccordionContentHTML();
84
85 if (trim($content)) {
86 $tpl->setCurrentBlock("expand");
87 $tpl->setVariable("EXP_ALT", $this->il_lng->txt("expand"));
88 $tpl->setVariable("EXP_IMG", $this->getExpandedImageURL());
89 $tpl->setVariable("NOT_EXP_ALT", $this->il_lng->txt("expanded"));
90 $tpl->setVariable("NOT_EXP_IMG", $this->getNotExpandedImageURL());
91 $tpl->parseCurrentBlock();
92 }
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 }
105 else {
106 $tpl->setVariable("ACCORDION_HIDE_CONTENT", "ilAccHideContent");
107 }
108 $tpl->setVariable("ACCORDION_CONTENT", $content);
109 $this->il_tpl->addOnloadCode("il.Accordion.add(" .ilJsonUtil::encode($this->getAccordionOptions()) .");");
110 $tpl->parseCurrentBlock();
111 }
static encode($mixed, $suppress_native=false)

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

+ Here is the call graph for this function:

◆ getAccordionContentCoursesHTML()

ilStudyProgrammeExpandableProgressListGUI::getAccordionContentCoursesHTML ( )
protected

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

153 {
154 include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
156
157 $crs = array();
158 foreach ($this->progress->getStudyProgramme()->getLPChildren() as $il_obj_crs_ref) {
159 $course = ilObjectFactory::getInstanceByRefId($il_obj_crs_ref->getTargetRefId());
160 $preloader->addItem($course->getId(), $course->getType(), $course->getRefId());
161 $crs[] = $course;
162 }
163 $preloader->preload();
164
165 return implode("\n", array_map(function(ilObjCourse $course) {
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 $this->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 }
Class ilObjCourse.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Preloader for object list GUIs.
getRefId()
get reference id @access public
getDescription()
get object description
getId()
get object id @access public
getTitle()
get object title @access public
Class ilStudyProgrammeCourseListGUI.

References configureItemGUI(), ilObjectListGUI\CONTEXT_PERSONAL_DESKTOP, ilObject\getDescription(), ilObject\getId(), 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 113 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

113 {
114 if (!$this->progress->getStudyProgramme()->hasLPChildren()) {
115 return $this->getAccordionContentProgressesHTML();
116 }
117 else {
118 return $this->getAccordionContentCoursesHTML();
119 }
120 }

References getAccordionContentCoursesHTML(), and getAccordionContentProgressesHTML().

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 122 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

122 {
123 // Make shouldShowSubProgress and newSubItem protected again afterwards, do
124 // the same in the derived class ilStudyProgrammeIndividualPlanProgressListGUI.
125 return implode("\n", array_map(function(ilStudyProgrammeUserProgress $progress) {
126 if (!$this->shouldShowSubProgress($progress)) {
127 return "";
128 }
129 $gui = $this->newSubItem($progress);
130 $gui->setIndent($this->getIndent() + 1);
131 return $gui->getHTML();
132 }, $this->progress->getChildrenProgress()));
133 }
Represents the progress of a user at one node of a study programme.

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 223 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

223 {
224 return "prg_progress_".$this->progress->getId()."_".$this->getIndent();
225 }

References getIndent().

Referenced by fillTemplate().

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

◆ getAccordionOptions()

ilStudyProgrammeExpandableProgressListGUI::getAccordionOptions ( )
protected

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

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

Referenced by fillTemplate().

+ Here is the caller graph for this function:

◆ getExpandedImageURL()

ilStudyProgrammeExpandableProgressListGUI::getExpandedImageURL ( )
protected

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

227 {
228 require_once("Services/Utilities/classes/class.ilUtil.php");
229 return ilUtil::getImagePath("tree_exp.svg");
230 }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

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 65 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 232 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

232 {
233 require_once("Services/Utilities/classes/class.ilUtil.php");
234 return ilUtil::getImagePath("tree_col.svg");
235 }

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 ( ilStudyProgrammeUserProgress  $a_progress)
protected

Reimplemented from ilStudyProgrammeProgressListGUI.

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

237 {
238 return null;
239 }

◆ newSubItem()

ilStudyProgrammeExpandableProgressListGUI::newSubItem ( ilStudyProgrammeUserProgress  $a_progress)
protected

Reimplemented in ilStudyProgrammeIndividualPlanProgressListGUI.

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

149 {
150 return new ilStudyProgrammeExpandableProgressListGUI($a_progress);
151 }

Referenced by getAccordionContentProgressesHTML().

+ Here is the caller graph for this function:

◆ setIndent()

ilStudyProgrammeExpandableProgressListGUI::setIndent (   $a_indent)

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

59 {
60 assert(is_int($a_indent));
61 assert($a_indent >= 0);
62 $this->indent = $a_indent;
63 }

◆ shouldShowSubProgress()

ilStudyProgrammeExpandableProgressListGUI::shouldShowSubProgress ( ilStudyProgrammeUserProgress  $a_progress)
protected

Reimplemented in ilStudyProgrammeIndividualPlanProgressListGUI.

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

135 {
136 if($a_progress->isRelevant()) {
137 $prg = $a_progress->getStudyProgramme();
138 $can_read = $this->il_access->checkAccess("read", "", $prg->getRefId(), "prg", $prg->getId());
139 if($this->visible_on_pd_mode == ilObjStudyProgrammeAdmin::SETTING_VISIBLE_ON_PD_READ && !$can_read) {
140 return false;
141 }
142
143 return true;
144 }
145
146 return false;
147 }
getStudyProgramme()
Get the program node where this progress belongs to was made.
isRelevant()
Check whether this node is relevant for the user.

References ilStudyProgrammeUserProgress\getStudyProgramme(), ilStudyProgrammeUserProgress\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 241 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

241 {
242 return $_GET["prg_progress_id"] == $this->progress->getId();
243 }
$_GET["client_id"]

References $_GET.

Referenced by fillTemplate().

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