ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.ilPortfolioPageGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
5
19{
20 const EMBEDDED_NO_OUTPUT = -99;
21
22 protected $js_onload_code = array();
23 protected $additional = array();
24 protected $export_material = array("js"=>array(), "images"=>array(), "files"=>array());
25
26
30 function __construct($a_portfolio_id, $a_id = 0, $a_old_nr = 0, $a_enable_comments = true)
31 {
32 global $tpl;
33
34 $this->portfolio_id = (int)$a_portfolio_id;
35 $this->enable_comments = (bool)$a_enable_comments;
36
37 parent::__construct($this->getParentType(), $a_id, $a_old_nr);
38 $this->getPageObject()->setPortfolioId($this->portfolio_id);
39
40 // content style
41 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
42
43 $tpl->setCurrentBlock("SyntaxStyle");
44 $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
46 $tpl->parseCurrentBlock();
47
48 $tpl->setCurrentBlock("ContentStyle");
49 $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
51 $tpl->parseCurrentBlock();
52 }
53
54 function getParentType()
55 {
56 return "prtf";
57 }
58
59 protected function getPageContentUserId($a_user_id)
60 {
61 // user id from content-xml
62 return $a_user_id;
63 }
64
68 function &executeCommand()
69 {
70 global $ilCtrl, $ilUser;
71
72 $next_class = $this->ctrl->getNextClass($this);
73 $cmd = $this->ctrl->getCmd();
74
75 switch($next_class)
76 {
77 case "ilobjbloggui":
78 // #12879 - we need the wsp-id for the keywords
79 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
80 $wsp_tree = new ilWorkspaceTree($ilUser->getId());
81 $blog_obj_id = (int)$this->getPageObject()->getTitle();
82 $blog_node_id = $wsp_tree->lookupNodeId($blog_obj_id);
83
84 include_once "Modules/Blog/classes/class.ilObjBlogGUI.php";
85 $blog_gui = new ilObjBlogGUI($blog_node_id, ilObjBlogGUI::WORKSPACE_NODE_ID);
86 $blog_gui->disableNotes(!$this->enable_comments);
87 return $ilCtrl->forwardCommand($blog_gui);
88
89 case "ilcalendarmonthgui":
90 // booking action
91 if($cmd && $cmd != "preview")
92 {
93 include_once('./Services/Calendar/classes/class.ilCalendarMonthGUI.php');
94 $month_gui = new ilCalendarMonthGUI(new ilDate());
95 return $ilCtrl->forwardCommand($month_gui);
96 }
97 // calendar month navigation
98 else
99 {
100 $ilCtrl->setParameter($this, "cmd", "preview");
102 }
103
104 case "ilpageobjectgui":
105 die("Deprecated. ilPortfolioPage gui forwarding to ilpageobject");
106 return;
107
108 default:
109 $this->setPresentationTitle($this->getPageObject()->getTitle());
110 return parent::executeCommand();
111 }
112 }
113
119 function showPage()
120 {
121 global $ilUser;
122
123 if(!$this->getPageObject())
124 {
125 return;
126 }
127
128 switch($this->getPageObject()->getType())
129 {
131 return $this->renderBlog($ilUser->getId(), (int)$this->getPageObject()->getTitle());
132
133 default:
134 $this->setTemplateOutput(false);
135 // $this->setPresentationTitle($this->getPageObject()->getTitle());
136 $output = parent::showPage();
137
138 return $output;
139 }
140 }
141
148 function getTabs($a_activate = "")
149 {
150 if(!$this->embedded)
151 {
152 parent::getTabs($a_activate);
153 }
154 }
155
161 function setEmbedded($a_value)
162 {
163 $this->embedded = (bool)$a_value;
164 }
165
171 function setAdditional($a_additional)
172 {
173 $this->additional = $a_additional;
174 }
175
181 function getAdditional()
182 {
183 return $this->additional;
184 }
185
187 {
189 }
190
191 function postOutputProcessing($a_output)
192 {
193 $parts = array(
194 "Profile" => array("0-9", "a-z", "0-9a-z_;\W"), // user, mode, fields
195 "Verification" => array("0-9", "a-z", "0-9"), // user, type, id
196 "Blog" => array("0-9", "0-9", "0-9;\W"), // user, blog id, posting ids
197 "BlogTeaser" => array("0-9", "0-9", "0-9;\W"), // user, blog id, posting ids
198 "Skills" => array("0-9", "0-9"), // user, skill id
199 "SkillsTeaser" => array("0-9", "0-9"), // user, skill id
200 "ConsultationHours" => array("0-9", "a-z", "0-9;\W"), // user, mode, group ids
201 "ConsultationHoursTeaser" => array("0-9", "a-z", "0-9;\W"), // user, mode, group ids
202 "MyCourses" => array("0-9"), // user
203 "MyCoursesTeaser" => array("0-9") // user
204 );
205
206 foreach($parts as $type => $def)
207 {
208 $def = implode("]+)#([", $def);
209 if(preg_match_all("/".$this->pl_start.$type."#([".$def.
210 "]+)".$this->pl_end."/", $a_output, $blocks))
211 {
212 foreach($blocks[0] as $idx => $block)
213 {
214 switch($type)
215 {
216 case "Profile":
217 case "Blog":
218 case "BlogTeaser":
219 case "Skills":
220 case "SkillsTeaser":
221 case "ConsultationHours":
222 case "ConsultationHoursTeaser":
223 case "MyCourses":
224 case "MyCoursesTeaser":
225 $subs = null;
226 if(trim($blocks[3][$idx]))
227 {
228 foreach(explode(";", $blocks[3][$idx]) as $sub)
229 {
230 if(trim($sub))
231 {
232 $subs[] = trim($sub);
233 }
234 }
235 }
236 $snippet = $this->{"render".$type}($blocks[1][$idx],
237 $blocks[2][$idx], $subs);
238 break;
239
240 default:
241 $snippet = $this->{"render".$type}($blocks[1][$idx],
242 $blocks[2][$idx], $blocks[3][$idx]);
243 break;
244 }
245
246 $snippet = $this->renderPageElement($type, $snippet);
247 $a_output = str_replace($block, $snippet, $a_output);
248 }
249 }
250 }
251
252 return $a_output;
253 }
254
255 protected function renderPageElement($a_type, $a_html)
256 {
257 return trim($a_html);
258 }
259
260 protected function renderTeaser($a_type, $a_title, $a_options = null)
261 {
262 $options = "";
263 if($a_options)
264 {
265 $options = '<div class="il_Footer">'.$this->lng->txt("prtf_page_element_teaser_settings").
266 ": ".$a_options.'</div>';
267 }
268
269 return '<div style="margin:5px" class="ilBox"><h3>'.$a_title.'</h3>'.
270 '<div class="il_Description_no_margin">'.$this->lng->txt("prtf_page_element_teaser_".$a_type).'</div>'.
271 $options.'</div>';
272 }
273
274 protected function renderProfile($a_user_id, $a_type, array $a_fields = null)
275 {
276 global $ilCtrl;
277
278 $user_id = $this->getPageContentUserId($a_user_id);
279
280 if($this->getOutputMode() == "offline")
281 {
282 // profile picture is done in ilPortfolioHTMLExport
283
284 $this->export_material["js"][] = "http://maps.google.com/maps/api/js?sensor=false";
285 $this->export_material["js"][] = "./Services/Maps/js/ServiceGoogleMaps.js";
286 $this->export_material["js"][] = "./Services/Maps/js/OpenLayers.js";
287 $this->export_material["js"][] = "./Services/Maps/js/ServiceOpenLayers.js";
288 }
289
290 include_once("./Services/User/classes/class.ilPublicUserProfileGUI.php");
291 $pub_profile = new ilPublicUserProfileGUI($user_id);
292 $pub_profile->setEmbedded(true, ($this->getOutputMode() == "offline"));
293
294 // full circle: additional was set in the original public user profile call
295 $pub_profile->setAdditional($this->getAdditional());
296
297 if($a_type == "manual" && sizeof($a_fields))
298 {
299 $prefs = array();
300 foreach($a_fields as $field)
301 {
302 $field = trim($field);
303 if($field)
304 {
305 $prefs["public_".$field] = "y";
306 }
307 }
308
309 $pub_profile->setCustomPrefs($prefs);
310 }
311
312 if($this->getOutputMode() != "offline")
313 {
314 return $ilCtrl->getHTML($pub_profile);
315 }
316 else
317 {
318 return $pub_profile->getEmbeddable();
319 }
320 }
321
322 protected function renderVerification($a_user_id, $a_type, $a_id)
323 {
324 global $objDefinition;
325
326 // not used
327 // $user_id = $this->getPageContentUserId($a_user_id);
328
329 $class = "ilObj".$objDefinition->getClassName($a_type)."GUI";
330 include_once $objDefinition->getLocation($a_type)."/class.".$class.".php";
331 $verification = new $class($a_id, ilObject2GUI::WORKSPACE_OBJECT_ID);
332
333 if($this->getOutputMode() != "offline")
334 {
335 // direct download link
336 $this->ctrl->setParameter($this, "dlid", $a_id);
337 $url = $this->ctrl->getLinkTarget($this, "dl".$a_type);
338 $this->ctrl->setParameter($this, "dlid", "");
339 }
340 else
341 {
342 $file = $verification->object->getFilePath();
343 $url = "files/".basename($file);
344
345 $this->export_material["files"][] = $file;
346 }
347
348 return $verification->render(true, $url);
349 }
350
351 protected function dltstv()
352 {
353 $id = $_GET["dlid"];
354 if($id)
355 {
356 include_once "Modules/Test/classes/class.ilObjTestVerificationGUI.php";
358 $verification->downloadFromPortfolioPage($this->getPageObject());
359 }
360 }
361
362 protected function dlexcv()
363 {
364 $id = $_GET["dlid"];
365 if($id)
366 {
367 include_once "Modules/Exercise/classes/class.ilObjExerciseVerificationGUI.php";
369 $verification->downloadFromPortfolioPage($this->getPageObject());
370 }
371 }
372
373 protected function dlcrsv()
374 {
375 $id = $_GET["dlid"];
376 if($id)
377 {
378 include_once "Modules/Course/classes/Verification/class.ilObjCourseVerificationGUI.php";
380 $verification->downloadFromPortfolioPage($this->getPageObject());
381 }
382 }
383
384 protected function dlscov()
385 {
386 $id = $_GET["dlid"];
387 if($id)
388 {
389 include_once "Modules/ScormAicc/classes/Verification/class.ilObjSCORMVerificationGUI.php";
391 $verification->downloadFromPortfolioPage($this->getPageObject());
392 }
393 }
394
395 protected function renderBlog($a_user_id, $a_blog_id, array $a_posting_ids = null)
396 {
397 global $ilCtrl;
398
399 // not used
400 // $user_id = $this->getPageContentUserId($a_user_id);
401
402 // full blog (separate tab/page)
403 if(!$a_posting_ids)
404 {
405 include_once "Modules/Blog/classes/class.ilObjBlogGUI.php";
406 $blog = new ilObjBlogGUI($a_blog_id, ilObject2GUI::WORKSPACE_OBJECT_ID);
407 $blog->disableNotes(!$this->enable_comments);
408 $blog->setContentStyleSheet();
409
410 if($this->getOutputMode() != "offline")
411 {
412 return $ilCtrl->getHTML($blog);
413 }
414 else
415 {
416
417 }
418 }
419 // embedded postings
420 else
421 {
422 $html = array();
423
424 include_once "Modules/Blog/classes/class.ilObjBlog.php";
425 $html[] = ilObjBlog::_lookupTitle($a_blog_id);
426
427 include_once "Modules/Blog/classes/class.ilBlogPostingGUI.php";
428 foreach($a_posting_ids as $post)
429 {
430 $page = new ilBlogPostingGUI(0, null, $post);
431 if($this->getOutputMode() != "offline")
432 {
433 $page->setOutputMode(IL_PAGE_PREVIEW);
434 }
435 else
436 {
437 $page->setOutputMode("offline");
438 }
439 $html[] = $page->showPage();
440 }
441
442 return implode("\n", $html);
443 }
444 }
445
446 protected function renderBlogTeaser($a_user_id, $a_blog_id, array $a_posting_ids = null)
447 {
448 // not used
449 // $user_id = $this->getPageContentUserId($a_user_id);
450
451 $postings = "";
452 if($a_posting_ids)
453 {
454 $postings = array("<ul>");
455 include_once "Modules/Blog/classes/class.ilBlogPosting.php";
456 foreach($a_posting_ids as $post)
457 {
458 $post = new ilBlogPosting($post);
459 $postings[] = "<li>".$post->getTitle()." - ".
460 ilDatePresentation::formatDate($post->getCreated())."</li>";
461 }
462 $postings[] = "</ul>";
463 $postings = implode("\n", $postings);
464 }
465
466 return $this->renderTeaser("blog", $this->lng->txt("obj_blog").' "'.
467 ilObject::_lookupTitle($a_blog_id).'"', $postings);
468 }
469
470 protected function renderSkills($a_user_id, $a_skills_id)
471 {
472 if($this->getOutputMode() == "preview")
473 {
474 return $this->renderSkillsTeaser($a_user_id, $a_skills_id);
475 }
476
477 $user_id = $this->getPageContentUserId($a_user_id);
478
479 include_once "Services/Skill/classes/class.ilPersonalSkillsGUI.php";
480 $gui = new ilPersonalSkillsGUI();
481 if($this->getOutputMode() == "offline")
482 {
483 $gui->setOfflineMode("./files/");
484 }
485 $html = $gui->getSkillHTML($a_skills_id, $user_id);
486
487 if($this->getOutputMode() == "offline")
488 {
489 $js = $gui->getTooltipsJs();
490 if(sizeof($js))
491 {
492 $this->js_onload_code = array_merge($this->js_onload_code, $js);
493 }
494 }
495
496 return $html;
497 }
498
499 protected function renderSkillsTeaser($a_user_id, $a_skills_id)
500 {
501 // not used
502 // $user_id = $this->getPageContentUserId($a_user_id);
503
504 include_once "Services/Skill/classes/class.ilSkillTreeNode.php";
505
506 return $this->renderTeaser("skills", $this->lng->txt("skills").' "'.
507 ilSkillTreeNode::_lookupTitle($a_skills_id).'"');
508 }
509
510 protected function renderConsultationHoursTeaser($a_user_id, $a_mode, $a_group_ids)
511 {
512 // not used
513 // $user_id = $this->getPageContentUserId($a_user_id);
514
515 if($a_mode == "auto")
516 {
517 $mode = $this->lng->txt("cont_cach_mode_automatic");
518 $groups = null;
519 }
520 else
521 {
522 $mode = $this->lng->txt("cont_cach_mode_manual");
523
524 include_once "Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php";
525 $groups = array();
526 foreach($a_group_ids as $grp_id)
527 {
528 $groups[] = ilConsultationHourGroups::lookupTitle($grp_id);
529 }
530 $groups = " (".implode(", ", $groups).")";
531 }
532
533 $this->lng->loadLanguageModule("dateplaner");
534 return $this->renderTeaser("consultation_hours",
535 $this->lng->txt("app_consultation_hours"), $mode.$groups);
536 }
537
538 protected function renderConsultationHours($a_user_id, $a_mode, $a_group_ids)
539 {
540 global $ilUser;
541
542 if($this->getOutputMode() == "preview")
543 {
544 return $this->renderConsultationHoursTeaser($a_user_id, $a_mode, $a_group_ids);
545 }
546
547 if($this->getOutputMode() == "offline")
548 {
549 return;
550 }
551
552 $user_id = $this->getPageContentUserId($a_user_id);
553
554 // only if not owner
555 if($ilUser->getId() != $user_id)
556 {
557 $_GET["bkid"] = $user_id;
558 }
559
560 if($a_mode != "manual")
561 {
562 $a_group_ids = null;
563 }
564
565 include_once('./Services/Calendar/classes/class.ilCalendarCategories.php');
566 ilCalendarCategories::_getInstance()->setCHUserId($user_id);
568
569 if(!$_REQUEST["seed"])
570 {
571 $seed = new ilDate(time(), IL_CAL_UNIX);
572 }
573 else
574 {
575 $seed = new ilDate($_REQUEST["seed"], IL_CAL_DATE);
576 }
577
578 include_once('./Services/Calendar/classes/class.ilCalendarMonthGUI.php');
579 $month_gui = new ilCalendarMonthGUI($seed);
580
581 // custom schedule filter: handle booking group ids
582 include_once('./Services/Calendar/classes/class.ilCalendarScheduleFilterBookings.php');
583 $filter = new ilCalendarScheduleFilterBookings($user_id, $a_group_ids);
584 $month_gui->addScheduleFilter($filter);
585
586 $this->tpl->addCss(ilUtil::getStyleSheetLocation('filesystem','delos.css','Services/Calendar'));
587
588 $this->lng->loadLanguageModule("dateplaner");
589 return '<h3>'.$this->lng->txt("app_consultation_hours").'</h3>'.
590 $this->ctrl->getHTML($month_gui);
591 }
592
593 protected function isMyCoursesActive()
594 {
595 $prfa_set = new ilSetting("prfa");
596 return (bool)$prfa_set->get("mycrs", true);
597 }
598
599 protected function renderMyCoursesTeaser($a_user_id)
600 {
601 // not used
602 // $user_id = $this->getPageContentUserId($a_user_id);
603
604 $title = $this->isMyCoursesActive()
605 ? "my_courses"
606 : "my_courses_inactive";
607
608 return $this->renderTeaser($title,
609 $this->lng->txt("prtf_page_element_my_courses_title"));
610 }
611
612 protected function renderMyCourses($a_user_id)
613 {
614 global $ilAccess, $ilUser;
615
616 if($this->getOutputMode() == "preview")
617 {
618 return $this->renderMyCoursesTeaser($a_user_id);
619 }
620
621 if(!$this->isMyCoursesActive())
622 {
623 return;
624 }
625
626 $img_path = null;
627 if($this->getOutputMode() == "offline")
628 {
629 $this->export_material["images"][] = "./templates/default/images/icon_crs.svg";
630 $this->export_material["images"][] = "./templates/default/images/icon_lobj.svg";
631 $this->export_material["images"][] = "./templates/default/images/scorm/complete.svg";
632 $this->export_material["images"][] = "./templates/default/images/scorm/not_attempted.svg";
633 $this->export_material["images"][] = "./templates/default/images/scorm/failed.svg";
634 $this->export_material["images"][] = "./templates/default/images/scorm/incomplete.svg";
635
636 $img_path = "images/";
637 }
638
639 $user_id = $this->getPageContentUserId($a_user_id);
640
641 $data = $this->getCoursesOfUser($user_id);
642 if(sizeof($data))
643 {
644 $tpl = new ilTemplate("tpl.pc_my_courses.html", true, true, "Modules/Portfolio");
645 $tpl->setVariable("TITLE", $this->lng->txt("prtf_page_element_my_courses_title"));
646 $tpl->setVariable("INFO", $this->lng->txt("prtf_page_element_my_courses_info")); // #14464
647
648 include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
649 $this->lng->loadLanguageModule("trac");
650 $this->lng->loadLanguageModule("crs");
651
652 include_once("./Services/Container/classes/class.ilContainerObjectiveGUI.php");
653 include_once("./Services/Link/classes/class.ilLink.php");
654
655 foreach($data as $course)
656 {
657 if(isset($course["lp_status"]))
658 {
659 $lp_icon = ilLearningProgressBaseGUI::_getImagePathForStatus($course["lp_status"]);
660 $lp_alt = ilLearningProgressBaseGUI::_getStatusText($course["lp_status"]);
661
662 if($img_path)
663 {
664 $lp_icon = $img_path.basename($lp_icon);
665 }
666
667 $tpl->setCurrentBlock("lp_bl");
668 $tpl->setVariable("LP_ICON_URL", $lp_icon);
669 $tpl->setVariable("LP_ICON_ALT", $lp_alt);
670 $tpl->parseCurrentBlock();
671 }
672
673 if(isset($course["objectives"]))
674 {
675 include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
676 $loc_settings = ilLOSettings::getInstanceByObjId($course["obj_id"]);
677 $has_initial_test = (bool)$loc_settings->getInitialTest();
678
679 foreach($course["objectives"] as $objtv)
680 {
681 $objtv_icon = ilUtil::getTypeIconPath("lobj", $objtv["id"]);
682 if($img_path)
683 {
684 $objtv_icon = $img_path.basename($objtv_icon);
685 }
686
687 $tpl->setCurrentBlock("objective_bl");
688 $tpl->setVariable("OBJECTIVE_TITLE", $objtv["title"]);
689 $tpl->setVariable("OBJTV_ICON_URL", $objtv_icon);
690 $tpl->setVariable("OBJTV_ICON_ALT", $this->lng->txt("crs_objectives"));
691
692 if($objtv["type"])
693 {
694 $tpl->setVariable("LP_OBJTV_PROGRESS",
695 ilContainerObjectiveGUI::buildObjectiveProgressBar($has_initial_test, $objtv["id"], $objtv, true));
696 }
697
698 $tpl->parseCurrentBlock();
699 }
700 }
701
702 // always check against current user
703 if($ilAccess->checkAccessOfUser($ilUser->getId(), "read", "", $course["ref_id"], "crs") ||
704 ($ilAccess->checkAccessOfUser($ilUser->getId(), "visible", "", $course["ref_id"], "crs") &&
705 $ilAccess->checkAccessOfUser($ilUser->getId(), "join", "", $course["ref_id"], "crs")))
706 {
707 $tpl->setCurrentBlock("course_link_bl");
708 $tpl->setVariable("COURSE_LINK_TITLE", $course["title"]);
709 $tpl->setVariable("COURSE_LINK_URL", ilLink::_getLink($course["ref_id"]));
710 $tpl->parseCurrentBlock();
711 }
712 else
713 {
714 $tpl->setCurrentBlock("course_nolink_bl");
715 $tpl->setVariable("COURSE_NOLINK_TITLE", $course["title"]);
716 $tpl->parseCurrentBlock();
717 }
718
719 $crs_icon = ilUtil::getTypeIconPath("crs", $course["obj_id"]);
720 if($img_path)
721 {
722 $crs_icon = $img_path.basename($crs_icon);
723 }
724
725 $tpl->setCurrentBlock("course_bl");
726 $tpl->setVariable("CRS_ICON_URL", $crs_icon);
727 $tpl->setVariable("CRS_ICON_ALT", $this->lng->txt("obj_crs"));
728 $tpl->parseCurrentBlock();
729 }
730
731 return $tpl->get();
732 }
733 }
734
735 protected function getCoursesOfUser($a_user_id)
736 {
737 global $tree;
738
739 // see ilPDSelectedItemsBlockGUI
740
741 include_once 'Modules/Course/classes/class.ilObjCourseAccess.php';
742 include_once 'Services/Membership/classes/class.ilParticipants.php';
743 $items = ilParticipants::_getMembershipByType($a_user_id, 'crs');
744
745 $references = $lp_obj_refs = array();
746 foreach($items as $obj_id)
747 {
749 if(is_array($ref_id) && count($ref_id))
750 {
751 $ref_id = array_pop($ref_id);
752 if(!$tree->isDeleted($ref_id))
753 {
754 $visible = false;
755 $active = ilObjCourseAccess::_isActivated($obj_id, $visible, false);
756 if($active && $visible)
757 {
758 $references[$ref_id] = array(
759 'ref_id' => $ref_id,
760 'obj_id' => $obj_id,
761 'title' => ilObject::_lookupTitle($obj_id)
762 );
763 $lp_obj_refs[$obj_id] = $ref_id;
764 }
765 }
766 }
767 }
768
769 // get lp data for valid courses
770
771 if(sizeof($lp_obj_refs))
772 {
773 // lp must be active, personal and not anonymized
774 include_once "Services/Tracking/classes/class.ilObjUserTracking.php";
778 {
779 // see ilLPProgressTableGUI
780 include_once "Services/Tracking/classes/class.ilTrQuery.php";
781 include_once "Services/Tracking/classes/class.ilLPStatusFactory.php";
782 $lp_data = ilTrQuery::getObjectsStatusForUser($a_user_id, $lp_obj_refs);
783 foreach($lp_data as $item)
784 {
785 $ref_id = $item["ref_ids"];
786 $references[$ref_id]["lp_status"] = $item["status"];
787
788 // add objectives
789 if($item["u_mode"] == ilLPObjSettings::LP_MODE_OBJECTIVES)
790 {
791 // we need the collection for the correct order
792 include_once "Services/Tracking/classes/collection/class.ilLPCollectionOfObjectives.php";
793 $coll_objtv = new ilLPCollectionOfObjectives($item["obj_id"], $item["u_mode"]);
794 $coll_objtv = $coll_objtv->getItems();
795 if($coll_objtv)
796 {
797 // #13373
798 $lo_results = $this->parseLOUserResults($item["obj_id"], $a_user_id);
799
800 $tmp = array();
801
802 include_once "Modules/Course/classes/class.ilCourseObjective.php";
803 foreach($coll_objtv as $objective_id)
804 {
805 $tmp[$objective_id] = array(
806 "id" => $objective_id,
807 "title" => ilCourseObjective::lookupObjectiveTitle($objective_id));
808
809 if(array_key_exists($objective_id, $lo_results))
810 {
811 $lo_result = $lo_results[$objective_id];
812 $tmp[$objective_id]["result_perc"] = $lo_result["result_perc"];
813 $tmp[$objective_id]["limit_perc"] = $lo_result["limit_perc"];
814 $tmp[$objective_id]["status"] = $lo_result["status"];
815 $tmp[$objective_id]["type"] = $lo_result["type"];
816 }
817 }
818
819 // order
820 foreach($coll_objtv as $objtv_id)
821 {
822 $references[$ref_id]["objectives"][] = $tmp[$objtv_id];
823 }
824 }
825 }
826 }
827 }
828 }
829
830 $references = ilUtil::sortArray($references, "title", "ASC");
831
832 return $references;
833 }
834
835 // see ilContainerObjectiveGUI::parseLOUserResults()
836 protected function parseLOUserResults($a_course_obj_id, $a_user_id)
837 {
838 $res = array();
839
840 include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
841 $lur = new ilLOUserResults($a_course_obj_id, $a_user_id);
842 foreach($lur->getCourseResultsForUserPresentation() as $objective_id => $types)
843 {
844 // show either initial or qualified for objective
845 if(isset($types[ilLOUserResults::TYPE_INITIAL]))
846 {
847 $initial_status = $types[ilLOUserResults::TYPE_INITIAL]["status"];
848 }
849
850 // qualified test has priority
851 if(isset($types[ilLOUserResults::TYPE_QUALIFIED]))
852 {
855 }
856 else
857 {
860 }
861
862 $result["initial_status"] = $initial_status;
863
864 $res[$objective_id] = $result;
865 }
866
867 return $res;
868 }
869
870 public function getExportMaterial()
871 {
873 }
874}
875
876?>
$result
print $file
$_GET["client_id"]
const IL_CAL_DATE
const IL_CAL_UNIX
const IL_PAGE_PREVIEW
Class ilBlogPosting GUI class.
Class ilBlogPosting.
static _getInstance($a_usr_id=0)
get singleton instance
Calendar schedule filter for consultation hour bookings.
static lookupTitle($a_group_id)
Lookup group title.
static buildObjectiveProgressBar($a_has_initial_test, $a_objective_id, array $a_lo_result, $a_list_mode=false)
static lookupObjectiveTitle($a_objective_id)
static formatDate(ilDateTime $date)
Format a date @access public.
Class for single dates.
static getInstanceByObjId($a_obj_id)
get singleton instance
_getImagePathForStatus($a_status)
Get image path for status.
_getStatusText($a_status)
Get status alt text.
Class ilObjBlogGUI.
static _isActivated($a_obj_id, &$a_visible_flag=null, $a_mind_member_view=true)
Is activated?
GUI class for course verification.
GUI class for exercise verification.
GUI class for scorm verification.
getContentStylePath($a_style_id)
get content style path
getSyntaxStylePath()
get syntax style path
GUI class for test verification.
static _enabledLearningProgress()
check wether learing progress is enabled or not
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
static _lookupTitle($a_id)
lookup object title
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
Class ilPageObjectGUI.
setPresentationTitle($a_title="")
getPageObject()
Get Page Object.
setTemplateOutput($a_output=true)
static _getMembershipByType($a_usr_id, $a_type, $a_only_member_role=false)
get membership by type Get course or group membership
Personal skills GUI class.
Portfolio page gui class.
setEmbedded($a_value)
Set embedded mode: will suppress tabs.
parseLOUserResults($a_course_obj_id, $a_user_id)
renderTeaser($a_type, $a_title, $a_options=null)
getParentType()
Get parent type.
renderPageElement($a_type, $a_html)
renderProfile($a_user_id, $a_type, array $a_fields=null)
renderConsultationHours($a_user_id, $a_mode, $a_group_ids)
renderSkillsTeaser($a_user_id, $a_skills_id)
getTabs($a_activate="")
Set all tabs.
renderBlog($a_user_id, $a_blog_id, array $a_posting_ids=null)
renderBlogTeaser($a_user_id, $a_blog_id, array $a_posting_ids=null)
renderVerification($a_user_id, $a_type, $a_id)
postOutputProcessing($a_output)
Finalizing output processing.
getAdditional()
Get Additonal Information.
renderConsultationHoursTeaser($a_user_id, $a_mode, $a_group_ids)
__construct($a_portfolio_id, $a_id=0, $a_old_nr=0, $a_enable_comments=true)
Constructor.
& executeCommand()
execute command
renderSkills($a_user_id, $a_skills_id)
setAdditional($a_additional)
Set Additonal Information.
GUI class for public user profile presentation.
ILIAS Setting Class.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
special template class to simplify handling of ITX/PEAR
getObjectsStatusForUser($a_user_id, array $obj_refs)
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static getTypeIconPath($a_type, $a_obj_id, $a_size='small')
Get type icon path path Return image path for icon_xxx.pngs Or (if enabled) path to custom icon Depre...
Tree handler for personal workspace.
global $ilCtrl
Definition: ilias.php:18
$cmd
Definition: sahs_server.php:35
$ref_id
Definition: sahs_server.php:39
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
if(!is_array($argv)) $options
global $ilUser
Definition: imgupload.php:15