ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilStudyProgrammeExpandableProgressListGUI Class Reference

Class ilStudyProgrammeExpandableProgressListGUI. More...

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

Public Member Functions

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

Protected Member Functions

 getIndent ()
 
 fillTemplate ($tpl)
 
 getAccordionContentHTML ()
 
 getAccordionContentProgressesHTML ()
 
 shouldShowSubProgress (ilStudyProgrammeProgress $a_progress)
 
 newSubItem (ilStudyProgrammeProgress $a_progress)
 
 getAccordionContentCoursesHTML ()
 
 configureItemGUI (ilStudyProgrammeCourseListGUI $a_item_gui)
 
 getAccordionOptions ()
 
 getAccordionId ()
 
 getExpandedImageURL ()
 
 getNotExpandedImageURL ()
 
 getTitleAndIconTarget (ilStudyProgrammeProgress $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 (ilStudyProgrammeProgress $a_progress)
 
 buildProgressBar (ilStudyProgrammeProgress $a_progress)
 
 buildToolTip (ilStudyProgrammeProgress $a_progress)
 
 buildProgressStatus (ilStudyProgrammeProgress $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 ( ilStudyProgrammeProgress  $a_progress)

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

References $DIC, $ilSetting, $tpl, and ILIAS\GlobalScreen\Provider\__construct().

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: goto.php:24
global $ilSetting
Definition: privfeed.php:17
__construct(Container $dic, ilPlugin $plugin)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
+ Here is the call graph for this function:

Member Function Documentation

◆ addCSS()

ilStudyProgrammeExpandableProgressListGUI::addCSS ( )
protected

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

Referenced by getHTML().

285  {
286  if ($this->css_added) {
287  return false;
288  }
289 
290  $this->il_tpl->addCSS("Modules/StudyProgramme/templates/css/ilStudyProgramme.css");
291  $this->css_added = true;
292  }
+ Here is the caller graph for this function:

◆ addJavaScript()

ilStudyProgrammeExpandableProgressListGUI::addJavaScript ( )
protected

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

References iljQueryUtil\initjQueryUI().

Referenced by getHTML().

273  {
274  if ($this->js_added) {
275  return false;
276  }
277 
278  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
280  $this->il_tpl->addJavaScript("./Services/Accordion/js/accordion.js", true, 3);
281  $this->js_added = true;
282  }
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 202 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().

203  {
204  $a_item_gui->enableComments(false);
205  $a_item_gui->enableTags(false);
206  $a_item_gui->enableIcon(true);
207  $a_item_gui->enableDelete(false);
208  $a_item_gui->enableCut(false);
209  $a_item_gui->enableCopy(false);
210  $a_item_gui->enableLink(false);
211  $a_item_gui->enableInfoScreen(true);
212  $a_item_gui->enableSubscribe(true);
213  $a_item_gui->enableCheckbox(false);
214  $a_item_gui->enableDescription(true);
215  $a_item_gui->enableProperties(true);
216  $a_item_gui->enablePreconditions(true);
217  $a_item_gui->enableNoticeProperties(true);
218  $a_item_gui->enableCommands(true, true);
219  $a_item_gui->enableProgressInfo(true);
220  $a_item_gui->setIndent($this->getIndent() + 2);
221  }
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  }
static encode($mixed, $suppress_native=false)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
$i
Definition: metadata.php:24
+ Here is the call graph for this function:

◆ getAccordionContentCoursesHTML()

ilStudyProgrammeExpandableProgressListGUI::getAccordionContentCoursesHTML ( )
protected

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

167  {
168  include_once("./Services/Object/classes/class.ilObjectListGUIPreloader.php");
170 
171  $crs = array();
172  $prg = ilObjStudyProgramme::getInstanceByObjId($this->progress->getNodeId());
173  foreach ($prg->getLPChildren() as $il_obj_crs_ref) {
174  if (ilObject::_exists($il_obj_crs_ref, true) &&
175  is_null(ilObject::_lookupDeletedDate($il_obj_crs_ref))
176  ) {
177  continue;
178  }
179 
180  $course = ilObjectFactory::getInstanceByRefId($il_obj_crs_ref->getTargetRefId());
181  $preloader->addItem($course->getId(), $course->getType(), $course->getRefId());
182  $crs[] = $course;
183  }
184  $preloader->preload();
185 
186  return implode("\n", array_map(function (ilObjCourse $course) {
187  require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeCourseListGUI.php");
188  require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeContainerObjectMock.php");
189 
190  $item_gui = new ilStudyProgrammeCourseListGUI();
191  $this->configureItemGUI($item_gui);
192  $item_gui->setContainerObject(new ilStudyProgrammeContainerObjectMock($course));
193  return $item_gui->getListItemHTML(
194  $course->getRefId(),
195  $course->getId(),
196  $course->getTitle(),
197  $course->getDescription()
198  );
199  }, $crs));
200  }
static _lookupDeletedDate($a_ref_id)
only called in ilObjectGUI::insertSavedNodes
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
Preloader for object list GUIs.
getId()
get object id public
getTitle()
get object title public
getDescription()
get object description
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(), getAccordionContentProgressesHTML(), and ilObjStudyProgramme\getInstanceByObjId().

Referenced by fillTemplate().

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

◆ getAccordionContentProgressesHTML()

ilStudyProgrammeExpandableProgressListGUI::getAccordionContentProgressesHTML ( )
protected

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

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

Referenced by getAccordionContentHTML().

129  {
130  // Make shouldShowSubProgress and newSubItem protected again afterwards, do
131  // the same in the derived class ilStudyProgrammeIndividualPlanProgressListGUI.
132  $programme = ilObjStudyProgramme::getInstanceByObjId($this->progress->getNodeId());
133  $child_progresses = $programme->getChildrenProgress($this->progress);
134 
135  return implode("\n", array_map(function (ilStudyProgrammeProgress $progress) {
136  if (!$this->shouldShowSubProgress($progress)) {
137  return "";
138  }
139  $gui = $this->newSubItem($progress);
140  $gui->setIndent($this->getIndent() + 1);
141  return $gui->getHTML();
142  }, $child_progresses));
143  }
Class ilStudyProgrammeProgress.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAccordionId()

ilStudyProgrammeExpandableProgressListGUI::getAccordionId ( )
protected

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

References getIndent().

Referenced by fillTemplate(), and getAccordionOptions().

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

◆ getAccordionOptions()

ilStudyProgrammeExpandableProgressListGUI::getAccordionOptions ( )
protected

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

References getAccordionId().

Referenced by fillTemplate().

224  {
225  return array( "orientation" => "horizontal"
226  // Most propably we don't need this. Or do we want to call ilAccordion.initById?
227  , "int_id" => "prg_progress_" . $this->progress->getId()
228  , "initial_opened" => null
229  //, "save_url" => "./ilias.php?baseClass=ilaccordionpropertiesstorage&cmd=setOpenedTab&accordion_id=".$this->getId()."&user_id=".$ilUser->getId();
230  , "behaviour" => "AllClosed" // or "FirstOpen"
231  , "toggle_class" => 'il_PrgAccordionToggle'
232  , "toggle_act_class" => 'foo'
233  , "content_class" => 'il_PrgAccordionContent'
234  , "width" => "auto"
235  , "active_head_class" => "il_PrgAccordionHeadActive"
236  , "height" => "auto"
237  , "id" => $this->getAccordionId()
238  , "multi" => true
239  , "show_all_element" => null
240  , "hide_all_element" => null
241  , "reset_width" => true
242  );
243  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExpandedImageURL()

ilStudyProgrammeExpandableProgressListGUI::getExpandedImageURL ( )
protected

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

References ilUtil\getImagePath().

Referenced by fillTemplate().

251  {
252  require_once("Services/Utilities/classes/class.ilUtil.php");
253  return ilUtil::getImagePath("tree_exp.svg");
254  }
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 256 of file class.ilStudyProgrammeExpandableProgressListGUI.php.

References ilUtil\getImagePath().

Referenced by fillTemplate().

257  {
258  require_once("Services/Utilities/classes/class.ilUtil.php");
259  return ilUtil::getImagePath("tree_col.svg");
260  }
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 ( ilStudyProgrammeProgress  $a_progress)
protected

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

263  {
264  return null;
265  }

◆ newSubItem()

ilStudyProgrammeExpandableProgressListGUI::newSubItem ( ilStudyProgrammeProgress  $a_progress)
protected

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

Referenced by getAccordionContentProgressesHTML().

162  {
163  return new ilStudyProgrammeExpandableProgressListGUI($a_progress);
164  }
+ 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 ( ilStudyProgrammeProgress  $a_progress)
protected

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

References ilObjStudyProgramme\getInstanceByObjId(), ilStudyProgrammeProgress\getNodeId(), ilStudyProgrammeProgress\isRelevant(), and ilObjStudyProgrammeAdmin\SETTING_VISIBLE_ON_PD_READ.

Referenced by getAccordionContentProgressesHTML().

146  {
147  if ($a_progress->isRelevant()) {
148  $prg = ilObjStudyProgramme::getInstanceByObjId($a_progress->getNodeId());
149 
150  $can_read = $this->il_access->checkAccess("read", "", $prg->getRefId(), "prg", $prg->getId());
151  if ($this->visible_on_pd_mode == ilObjStudyProgrammeAdmin::SETTING_VISIBLE_ON_PD_READ && !$can_read) {
152  return false;
153  }
154 
155  return true;
156  }
157 
158  return false;
159  }
getNodeId()
Get the obj_id of the program node this progress belongs to.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showMyProgress()

ilStudyProgrammeExpandableProgressListGUI::showMyProgress ( )
protected

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

References $_GET.

Referenced by fillTemplate().

268  {
269  return $_GET["prg_progress_id"] == $this->progress->getId();
270  }
$_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: