ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjPortfolioGUI.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('./Modules/Portfolio/classes/class.ilObjPortfolioBaseGUI.php');
5
19{
23 protected $help;
24
25 protected $ws_access; // [ilWorkspaceAccessHandler]
26
27 public function __construct($a_id = 0)
28 {
29 global $DIC;
30
31 $this->lng = $DIC->language();
32 $this->help = $DIC["ilHelp"];
33 $this->settings = $DIC->settings();
34 $this->access = $DIC->access();
35 $this->user = $DIC->user();
36 $this->ctrl = $DIC->ctrl();
37 parent::__construct($a_id, self::PORTFOLIO_OBJECT_ID, 0);
38
39 $this->ctrl->saveParameter($this, "exc_back_ref_id");
40 }
41
42 public function getType()
43 {
44 return "prtf";
45 }
46
47 protected function checkPermissionBool($a_perm, $a_cmd = "", $a_type = "", $a_node_id = null)
48 {
49 if ($a_perm == "create") {
50 return true;
51 }
52 if (!$a_node_id) {
53 $a_node_id = $this->obj_id;
54 }
55 return $this->access_handler->checkAccess($a_perm, "", $a_node_id);
56 }
57
58 public function executeCommand()
59 {
61
62 $this->checkPermission("read");
63
64 // goto link to portfolio page
65 if ($_GET["gtp"]) {
66 $_GET["user_page"] = $_GET["gtp"];
67 }
68
70
71 $next_class = $this->ctrl->getNextClass($this);
72 $cmd = $this->ctrl->getCmd("view");
73
74 /*
75 if($_REQUEST["ecal"])
76 {
77 $cmd = "preview";
78 $next_class = "";
79 }
80 */
81
82 switch ($next_class) {
83 case "ilworkspaceaccessgui":
84 if ($this->checkPermissionBool("write")) {
85 $this->setTabs();
86 $this->tabs_gui->activateTab("share");
87
88 if ($this->access_handler->getPermissions($this->object->getId()) &&
89 !$this->object->isOnline()) {
90 ilUtil::sendInfo($lng->txt("prtf_shared_offline_info"));
91 }
92
93 $this->tpl->setPermanentLink("prtf", $this->object->getId());
94
95 include_once('./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
96 $wspacc = new ilWorkspaceAccessGUI($this->object->getId(), $this->access_handler, true);
97 $this->ctrl->forwardCommand($wspacc);
98 }
99 break;
100
101 case 'ilportfoliopagegui':
102 if ($this->determinePageCall()) {
103 // only in edit mode
104 $this->addLocator();
105
106 include_once "Services/Form/classes/class.ilFileInputGUI.php";
108 }
109 $this->handlePageCall($cmd);
110 break;
111
112 case "ilnotegui":
113 $this->preview();
114 break;
115
116 case "ilobjstylesheetgui":
117 include_once("./Services/Style/Content/classes/class.ilObjStyleSheetGUI.php");
118 $this->ctrl->setReturn($this, "editStyleProperties");
119 $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
120 $style_gui->omitLocator();
121 if ($cmd == "create" || $_GET["new_type"]=="sty") {
122 $style_gui->setCreationMode(true);
123 }
124
125 if ($cmd == "confirmedDelete") {
126 $this->object->setStyleSheetId(0);
127 $this->object->update();
128 }
129
130 $ret = $this->ctrl->forwardCommand($style_gui);
131
132 if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
133 $style_id = $ret;
134 $this->object->setStyleSheetId($style_id);
135 $this->object->update();
136 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
137 }
138 break;
139
140 case "ilportfolioexercisegui":
141 $this->ctrl->setReturn($this, "view");
142 include_once "Modules/Portfolio/classes/class.ilPortfolioExerciseGUI.php";
143 $gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
144 $this->ctrl->forwardCommand($gui);
145 break;
146
147 default:
148
149 if ($cmd != "preview") {
150 $this->addLocator();
151 $this->setTabs();
152 }
153 $this->$cmd();
154 break;
155 }
156
157 return true;
158 }
159
160 protected function setTabs()
161 {
162 $ilHelp = $this->help;
163
164 $ilHelp->setScreenIdComponent("prtf");
165
166 if ($this->checkPermissionBool("write")) {
167 $this->tabs_gui->addTab(
168 "pages",
169 $this->lng->txt("content"),
170 $this->ctrl->getLinkTarget($this, "view")
171 );
172
173 $this->tabs_gui->addTab(
174 "settings",
175 $this->lng->txt("settings"),
176 $this->ctrl->getLinkTarget($this, "edit")
177 );
178
179 $this->tabs_gui->addNonTabbedLink(
180 "preview",
181 $this->lng->txt("user_profile_preview"),
182 $this->ctrl->getLinkTarget($this, "preview")
183 );
184
185 $this->lng->loadLanguageModule("wsp");
186 $this->tabs_gui->addTab(
187 "share",
188 $this->lng->txt("wsp_permissions"),
189 $this->ctrl->getLinkTargetByClass("ilworkspaceaccessgui", "share")
190 );
191 }
192 }
193
194 protected function addLocator()
195 {
196 if (!$this->creation_mode) {
197 $this->ctrl->setParameter($this, "prt_id", $this->object->getId());
198 }
199
200 parent::addLocatorItems();
201
202 $this->tpl->setLocator();
203 }
204
205 protected function setTitleAndDescription()
206 {
207 // parent::setTitleAndDescription();
208
209 $title = $this->lng->txt("portfolio");
210 if ($this->object) {
211 $title .= ": " . $this->object->getTitle();
212 }
213 $this->tpl->setTitle($title);
214 $this->tpl->setTitleIcon(
215 ilUtil::getImagePath("icon_prtf.svg"),
216 $this->lng->txt("portfolio")
217 );
218
219 if ($this->object &&
220 !$this->object->isOnline()) {
221 $this->tpl->setAlertProperties(array(
222 array("alert" => true,
223 "property" => $this->lng->txt("status"),
224 "value" => $this->lng->txt("offline"))
225 ));
226 }
227 }
228
229
230 //
231 // CREATE/EDIT
232 //
233
234 protected function initCreationForms($a_new_type)
235 {
236 return array(self::CFORM_NEW => $this->initCreateForm($a_new_type));
237 }
238
239 protected function initCreateForm($a_new_type)
240 {
242
243 $this->ctrl->setParameter($this, "new_type", $this->getType());
244
245 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
246 $form = new ilPropertyFormGUI();
247 $form->setFormAction($this->ctrl->getFormAction($this));
248
249 // title
250 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
251 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
252 $ti->setMaxLength(ilObject::TITLE_LENGTH);
253 $ti->setRequired(true);
254 $form->addItem($ti);
255
256 /* description
257 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
258 $ta->setCols(40);
259 $ta->setRows(2);
260 $form->addItem($ta);
261 */
262
263 $main = new ilRadioGroupInputGUI($this->lng->txt("prtf_creation_mode"), "mode");
264 $main->setValue("mode_scratch");
265 $form->addItem($main);
266
267 $opt_scratch = new ilRadioOption($this->lng->txt("prtf_creation_mode_scratch"), "mode_scratch");
268 $main->addOption($opt_scratch);
269
270
271 // 1st page
272
273 $type = new ilRadioGroupInputGUI($this->lng->txt("prtf_first_page_title"), "ptype");
274 $type->setRequired(true);
275 $opt_scratch->addSubItem($type);
276
277 $type_page = new ilRadioOption($this->lng->txt("page"), "page");
278 $type->addOption($type_page);
279
280 // page type: page
281 $tf = new ilTextInputGUI($this->lng->txt("title"), "fpage");
282 $tf->setMaxLength(128);
283 $tf->setSize(40);
284 $tf->setRequired(true);
285 $type_page->addSubItem($tf);
286
287 // page templates
288 include_once "Services/COPage/Layout/classes/class.ilPageLayout.php";
290 if ($templates) {
291 $options = array(0 => $this->lng->txt("none"));
292 foreach ($templates as $templ) {
293 $templ->readObject();
294 $options[$templ->getId()] = $templ->getTitle();
295 }
296
297 $use_template = new ilSelectInputGUI($this->lng->txt("prtf_use_page_layout"), "tmpl");
298 $use_template->setRequired(true);
299 $use_template->setOptions($options);
300 $type_page->addSubItem($use_template);
301 }
302
303 // page type: blog
304 if (!$ilSetting->get('disable_wsp_blogs')) {
305 $options = array();
306 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
307 $tree = new ilWorkspaceTree($this->user_id);
308 $root = $tree->readRootId();
309 if ($root) {
310 $root = $tree->getNodeData($root);
311 foreach ($tree->getSubTree($root) as $node) {
312 if ($node["type"] == "blog") {
313 $options[$node["obj_id"]] = $node["title"];
314 }
315 }
316 asort($options);
317 }
318 if (sizeof($options)) {
319 $type_blog = new ilRadioOption($this->lng->txt("obj_blog"), "blog");
320 $type->addOption($type_blog);
321
322 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
323 $obj->setRequired(true);
324 $obj->setOptions(array(""=>$this->lng->txt("please_select"))+$options);
325 $type_blog->addSubItem($obj);
326 } else {
327 // #18147
328 $this->lng->loadLanguageModule('pd');
329 $url = $this->ctrl->getLinkTargetByClass("ilpersonaldesktopgui", "jumpToWorkspace");
330 $url = '<a href="' . $url . '">' . $this->lng->txt("pd_personal_workspace") . '</a>';
331
332 ilUtil::sendInfo(sprintf($this->lng->txt("prtf_no_blogs_info"), $url), true);
333 $type->setValue("page");
334 }
335 }
336
337
338 // portfolio templates
339
340 $opt_tmpl = new ilRadioOption($this->lng->txt("prtf_creation_mode_template"), "mode_tmpl");
341 $main->addOption($opt_tmpl);
342
343 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
345 if (!sizeof($templates)) {
346 $opt_tmpl->setDisabled(true);
347 } else {
348 $tmpl = new ilSelectInputGUI($this->lng->txt("obj_prtt"), "prtt");
349 $tmpl->setRequired(true);
350 $tmpl->setOptions(array(""=>$this->lng->txt("please_select"))+$templates);
351 $opt_tmpl->addSubItem($tmpl);
352
353 // incoming from repository
354 if ((int) $_REQUEST["prtt_pre"]) {
355 $tmpl->setValue((int) $_REQUEST["prtt_pre"]);
356 $main->setValue("mode_tmpl");
357 }
358 }
359
360
361 $form->setTitle($this->lng->txt("prtf_create_portfolio"));
362 $form->addCommandButton("save", $this->lng->txt("create"));
363 $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
364
365 return $form;
366 }
367
368 public function save()
369 {
370 $form = $this->initCreateForm("prtf");
371 if ($form->checkInput()) {
372 // trigger portfolio template "import" process
373 if ($form->getInput("mode") == "mode_tmpl") {
374 $_REQUEST["pt"] = $form->getInput("title");
375 return $this->createPortfolioFromTemplate();
376 }
377 }
378
379 return parent::save();
380 }
381
382 protected function afterSave(ilObject $a_new_object)
383 {
384 // create 1st page / blog
385 include_once("Modules/Portfolio/classes/class.ilPortfolioPage.php");
386 $page = $this->getPageInstance(null, $a_new_object->getId());
387 if ($_POST["ptype"] == "page") {
388 $page->setType(ilPortfolioPage::TYPE_PAGE);
389 $page->setTitle($_POST["fpage"]);
390
391 // use template as basis
392 $layout_id = $_POST["tmpl"];
393 if ($layout_id) {
394 include_once("./Services/COPage/Layout/classes/class.ilPageLayout.php");
395 $layout_obj = new ilPageLayout($layout_id);
396 $page->setXMLContent($layout_obj->getXMLContent());
397 }
398 } else {
399 $page->setType(ilPortfolioPage::TYPE_BLOG);
400 $page->setTitle($_POST["blog"]);
401 }
402 $page->create();
403
404 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
405 $this->ctrl->setParameter($this, "prt_id", $a_new_object->getId());
406 $this->ctrl->redirect($this, "view");
407 }
408
409 protected function toRepository()
410 {
411 $ilAccess = $this->access;
412
413 // return to exercise (portfolio assignment)
414 $exc_ref_id = (int) $_REQUEST["exc_id"];
415 if ($exc_ref_id &&
416 $ilAccess->checkAccess("read", "", $exc_ref_id)) {
417 include_once "Services/Link/classes/class.ilLink.php";
418 ilUtil::redirect(ilLink::_getLink($exc_ref_id, "exc"));
419 }
420
421 $this->ctrl->redirectByClass("ilportfoliorepositorygui", "show");
422 }
423
424 protected function initEditForm()
425 {
426 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
427 $form = new ilPropertyFormGUI();
428 $form->setFormAction($this->ctrl->getFormAction($this));
429
430 // title
431 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
432 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
433 $ti->setMaxLength(ilObject::TITLE_LENGTH);
434 $ti->setRequired(true);
435 $ti->setValue($this->object->getTitle());
436 $form->addItem($ti);
437
438 /* description
439 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
440 $ta->setCols(40);
441 $ta->setRows(2);
442 $ta->setValue($this->object->getDescription());
443 $form->addItem($ta);
444 */
445
446 // :TODO: online
447 $online = new ilCheckboxInputGUI($this->lng->txt("online"), "online");
448 $online->setChecked($this->object->isOnline());
449 $form->addItem($online);
450
452
453 $form->setTitle($this->lng->txt("prtf_edit_portfolio"));
454 $form->addCommandButton("update", $this->lng->txt("save"));
455 $form->addCommandButton("view", $this->lng->txt("cancel"));
456
457 return $form;
458 }
459
460 protected function getEditFormCustomValues(array &$a_values)
461 {
462 $a_values["online"] = $this->object->isOnline();
463
464 parent::getEditFormCustomValues($a_values);
465 }
466
467 public function updateCustom(ilPropertyFormGUI $a_form)
468 {
469 $this->object->setOnline($a_form->getInput("online"));
470
471 // if portfolio is not online, it cannot be default
472 if (!$a_form->getInput("online")) {
473 ilObjPortfolio::setUserDefault($this->user_id, 0);
474 }
475
476 parent::updateCustom($a_form);
477 }
478
479
480 //
481 // PAGES
482 //
483
491 protected function getPageInstance($a_page_id = null, $a_portfolio_id = null)
492 {
493 // #11531
494 if (!$a_portfolio_id && $this->object) {
495 $a_portfolio_id = $this->object->getId();
496 }
497 include_once "Modules/Portfolio/classes/class.ilPortfolioPage.php";
498 $page = new ilPortfolioPage($a_page_id);
499 $page->setPortfolioId($a_portfolio_id);
500 return $page;
501 }
502
509 protected function getPageGUIInstance($a_page_id)
510 {
511 include_once("Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
512 $page_gui = new ilPortfolioPageGUI(
513 $this->object->getId(),
514 $a_page_id,
515 0,
516 $this->object->hasPublicComments()
517 );
518 $page_gui->setAdditional($this->getAdditional());
519 return $page_gui;
520 }
521
522 public function getPageGUIClassName()
523 {
524 return "ilportfoliopagegui";
525 }
526
527 protected function initCopyPageFormOptions(ilPropertyFormGUI $a_form)
528 {
529 $a_tgt = new ilRadioGroupInputGUI($this->lng->txt("target"), "target");
530 $a_tgt->setRequired(true);
531 $a_form->addItem($a_tgt);
532
533 $old = new ilRadioOption($this->lng->txt("prtf_existing_portfolio"), "old");
534 $a_tgt->addOption($old);
535
536 $options = array();
537 $all = ilObjPortfolio::getPortfoliosOfUser($this->user_id);
538 foreach ($all as $item) {
539 $options[$item["id"]] = $item["title"];
540 }
541 $prtf = new ilSelectInputGUI($this->lng->txt("portfolio"), "prtf");
542 $prtf->setRequired(true);
543 $prtf->setOptions($options);
544 $old->addSubItem($prtf);
545
546 $new = new ilRadioOption($this->lng->txt("prtf_new_portfolio"), "new");
547 $a_tgt->addOption($new);
548
549 $tf = new ilTextInputGUI($this->lng->txt("title"), "title");
550 $tf->setMaxLength(128);
551 $tf->setSize(40);
552 $tf->setRequired(true);
553 $new->addSubItem($tf);
554 }
555
556
557 //
558 // BLOG
559 //
560
567 public function initBlogForm()
568 {
569 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
570 $form = new ilPropertyFormGUI();
571 $form->setFormAction($this->ctrl->getFormAction($this));
572
573 $options = array();
574 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
575 $tree = new ilWorkspaceTree($this->user_id);
576 $root = $tree->readRootId();
577 if ($root) {
578 $root = $tree->getNodeData($root);
579 foreach ($tree->getSubTree($root, true, "blog") as $node) {
580 $options[$node["obj_id"]] = $node["title"];
581 }
582 asort($options);
583 }
584
585 // add blog
586 $radg = new ilRadioGroupInputGUI($this->lng->txt("obj_blog"), "creation_mode");
587 $radg->setInfo($this->lng->txt(""));
588 $radg->setValue("new");
589 $radg->setInfo($this->lng->txt(""));
590
591 $op1 = new ilRadioOption($this->lng->txt("prtf_add_new_blog"), "new", $this->lng->txt("prtf_add_new_blog_info"));
592 $radg->addOption($op1);
593 $form->addItem($radg);
594
595 // Blog title
596 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
597 $ti->setRequired(true);
598 $op1->addSubItem($ti);
599
600
601 if (sizeof($options)) {
602 $op2 = new ilRadioOption($this->lng->txt("prtf_add_existing_blog"), "existing");
603 $radg->addOption($op2);
604
605 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
606 $obj->setOptions($options);
607 $op2->addSubItem($obj);
608 }
609
610 $form->setTitle($this->lng->txt("prtf_add_blog") . ": " .
611 $this->object->getTitle());
612 $form->addCommandButton("saveBlog", $this->lng->txt("save"));
613 $form->addCommandButton("view", $this->lng->txt("cancel"));
614
615 return $form;
616 }
617
621 public function saveBlog()
622 {
623 global $DIC;
624
625 $ilUser = $DIC->user();
626
627 $form = $this->initBlogForm();
628 if ($form->checkInput() && $this->checkPermissionBool("write")) {
629 if ($form->getInput("creation_mode") == "existing") {
630 $page = $this->getPageInstance();
631 $page->setType(ilPortfolioPage::TYPE_BLOG);
632 $page->setTitle($form->getInput("blog"));
633 $page->create();
634 } else {
635 $blog = new ilObjBlog();
636 $blog->setTitle($form->getInput("title"));
637 $blog->create();
638
639 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
640 $tree = new ilWorkspaceTree($ilUser->getId());
641
642 // @todo: see also e.g. ilExSubmissionObjectGUI->getOverviewContentBlog, this needs refactoring, consumer should not
643 // be responsibel to handle this
644 if (!$tree->getRootId()) {
645 $tree->createTreeForUser($ilUser->getId());
646 }
647
648 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
650 $node_id = $tree->insertObject($tree->readRootId(), $blog->getId());
651 $access_handler->setPermissions($tree->readRootId(), $node_id);
652
653 $page = $this->getPageInstance();
654 $page->setType(ilPortfolioPage::TYPE_BLOG);
655 $page->setTitle($blog->getId());
656 $page->create();
657 }
658
659 ilUtil::sendSuccess($this->lng->txt("prtf_blog_page_created"), true);
660 $this->ctrl->redirect($this, "view");
661 }
662
663 $this->tabs_gui->clearTargets();
664 $this->tabs_gui->setBackTarget(
665 $this->lng->txt("back"),
666 $this->ctrl->getLinkTarget($this, "view")
667 );
668
669 $form->setValuesByPost();
670 $this->tpl->setContent($form->getHtml());
671 }
672
673
674 //
675 // CREATE FROM TEMPLATE
676 //
677
678 protected function createPortfolioFromTemplate(ilPropertyFormGUI $a_form = null)
679 {
680 $title = trim($_REQUEST["pt"]);
681 $prtt_id = (int) $_REQUEST["prtt"];
682
683 // valid template?
684 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
686 if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
687 $this->toRepository();
688 }
689 unset($templates);
690
691 $this->ctrl->setParameter($this, "prtt", $prtt_id);
692
693 if (!$a_form) {
694 $a_form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
695 }
696 if ($a_form) {
697 $this->tpl->setContent($a_form->getHTML());
698 } else {
700 }
701 }
702
703 protected function initCreatePortfolioFromTemplateForm($a_prtt_id, $a_title)
704 {
707
708 if ((int) $_REQUEST["exc_id"]) {
709 $this->ctrl->setParameter($this, "exc_id", (int) $_REQUEST["exc_id"]);
710 $this->ctrl->setParameter($this, "ass_id", (int) $_REQUEST["ass_id"]);
711 }
712
713 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
714 $form = new ilPropertyFormGUI();
715 $form->setFormAction($this->ctrl->getFormAction($this));
716
717 $tmpl = new ilNonEditableValueGUI($this->lng->txt("obj_prtt"));
718 $tmpl->setValue(ilObject::_lookupTitle($a_prtt_id));
719 $form->addItem($tmpl);
720
721 $title = new ilNonEditableValueGUI($this->lng->txt("title"), "pt");
722 $title->setValue($a_title);
723 $form->addItem($title);
724
725 // gather user blogs
726 if (!$ilSetting->get('disable_wsp_blogs')) {
727 $blog_options = array();
728 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
729 $tree = new ilWorkspaceTree($this->user_id);
730 $root = $tree->readRootId();
731 if ($root) {
732 $root = $tree->getNodeData($root);
733 foreach ($tree->getSubTree($root, true, "blog") as $node) {
734 $blog_options[$node["obj_id"]] = $node["title"];
735 }
736 asort($blog_options);
737 }
738 }
739
740 $has_form_content = false;
741
742 include_once "Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
744 $quota_sum = 0;
745
746 include_once "Services/Skill/classes/class.ilPersonalSkill.php";
747 $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
748 $skill_ids = array();
749
750 include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
751 foreach (ilPortfolioTemplatePage::getAllPortfolioPages($a_prtt_id) as $page) {
752 switch ($page["type"]) {
754 // skills
755 $source_page = new ilPortfolioTemplatePage($page["id"]);
756 $source_page->buildDom(true);
757 $skill_ids = $this->getSkillsToPortfolioAssignment($pskills, $skill_ids, $source_page);
758
759 if ($check_quota) {
760 $quota_sum += $source_page->getPageDiskSize();
761 }
762 if (sizeof($skill_ids)) {
763 $has_form_content = true;
764 }
765 break;
766
768 if (!$ilSetting->get('disable_wsp_blogs')) {
769 $has_form_content = true;
770
771 $field_id = "blog_" . $page["id"];
772
773 $blog = new ilRadioGroupInputGUI($this->lng->txt("obj_blog") . ": " .
774 $page["title"], $field_id);
775 $blog->setRequired(true);
776 $blog->setValue("blog_create");
777 $form->addItem($blog);
778
779 $new_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_create"), "blog_create");
780 $blog->addOption($new_blog);
781
782 $title = new ilTextInputGUI($this->lng->txt("title"), $field_id . "_create_title");
783 $title->setRequired(true);
784 $new_blog->addSubItem($title);
785
786 if (sizeof($blog_options)) {
787 $reuse_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_reuse"), "blog_resuse");
788 $blog->addOption($reuse_blog);
789
790 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), $field_id . "_reuse_blog");
791 $obj->setRequired(true);
792 $obj->setOptions(array(""=>$this->lng->txt("please_select"))+$blog_options);
793 $reuse_blog->addSubItem($obj);
794 }
795
796 $blog->addOption(new ilRadioOption($this->lng->txt("prtf_template_import_blog_ignore"), "blog_ignore"));
797 }
798 break;
799 }
800 }
801
802 if ($skill_ids) {
803 include_once "Services/Skill/classes/class.ilSkillTreeNode.php";
804 $skills = new ilCheckboxGroupInputGUI($this->lng->txt("skills"), "skill_ids");
805 $skills->setInfo($this->lng->txt("prtf_template_import_new_skills"));
806 $skills->setValue($skill_ids);
807 foreach ($skill_ids as $skill_id) {
808 $skills->addOption(new ilCheckboxOption(ilSkillTreeNode::_lookupTitle($skill_id), $skill_id));
809 }
810 $form->addItem($skills);
811 }
812
813 if ($quota_sum) {
814 include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
815 if (!ilDiskQuotaHandler::isUploadPossible($quota_sum)) {
816 ilUtil::sendFailure($this->lng->txt("prtf_template_import_quota_failure"), true);
817 $this->ctrl->redirect($this, "create");
818 }
819 }
820
821 // no dialog needed, go ahead
822 if (!$has_form_content) {
823 return;
824 }
825
826 $form->setTitle($this->lng->txt("prtf_creation_mode") . ": " . $this->lng->txt("prtf_creation_mode_template"));
827 $form->addCommandButton("createPortfolioFromTemplateProcess", $this->lng->txt("continue"));
828 $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
829
830 return $form;
831 }
832
833 protected function createPortfolioFromTemplateProcess($a_process_form = true)
834 {
837 $ilAccess = $this->access;
838
839 $title = trim($_REQUEST["pt"]);
840 $prtt_id = (int) $_REQUEST["prtt"];
841
842 // valid template?
843 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
845 if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
846 $this->toRepository();
847 }
848 unset($templates);
849
850 // build page recipe (aka import form values)
851 $recipe = null;
852 if ($a_process_form) {
853 $this->ctrl->setParameter($this, "prtt", $prtt_id);
854
856 if ($form->checkInput()) {
857 include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
858 foreach (ilPortfolioTemplatePage::getAllPortfolioPages($prtt_id) as $page) {
859 switch ($page["type"]) {
861 if (!$ilSetting->get('disable_wsp_blogs')) {
862 $field_id = "blog_" . $page["id"];
863 switch ($form->getInput($field_id)) {
864 case "blog_create":
865 $recipe[$page["id"]] = array("blog", "create",
866 trim($form->getInput($field_id . "_create_title")));
867 break;
868
869 case "blog_resuse":
870 $recipe[$page["id"]] = array("blog", "reuse",
871 (int) $form->getInput($field_id . "_reuse_blog"));
872 break;
873
874 case "blog_ignore":
875 $recipe[$page["id"]] = array("blog", "ignore");
876 break;
877 }
878 }
879 break;
880 }
881 }
882
883 $recipe["skills"] = (array) $form->getInput("skill_ids");
884 } else {
885 $form->setValuesByPost();
886 return $this->createPortfolioFromTemplate($form);
887 }
888 }
889
890 $source = new ilObjPortfolioTemplate($prtt_id, false);
891
892 // create portfolio
893 include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
894 $target = new ilObjPortfolio();
895 $target->setTitle($title);
896 $target->create();
897 $target_id = $target->getId();
898
899 $source->clonePagesAndSettings($source, $target, $recipe);
900
901 // link portfolio to exercise assignment
903
904 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created_from_template"), true);
905 $this->ctrl->setParameter($this, "prt_id", $target_id);
906 $this->ctrl->redirect($this, "preview");
907 }
908
909 public static function _goto($a_target)
910 {
911 $id = explode("_", $a_target);
912
913 $_GET["baseClass"] = "ilsharedresourceGUI";
914 $_GET["prt_id"] = $id[0];
915 if (sizeof($id) == 2) {
916 $_GET["gtp"] = $id[1];
917 }
918
919 include("ilias.php");
920 exit;
921 }
922
924 {
927
928 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
929 include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
930 include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
931
932 $title = trim($_REQUEST["pt"]);
933 $prtt_id = (int) $_REQUEST["prtt"];
934
935 // get assignment template
936 $ass_template_id = 0;
937 if ((int) $_REQUEST["ass_id"] > 0) {
938 include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
939 $ass = new ilExAssignment((int) $_REQUEST["ass_id"]);
940 $ass_template_id = ilObject::_lookupObjectId($ass->getPortfolioTemplateId());
941 }
942
943 if ($prtt_id > 0) {
945 if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
946 if ($ass_template_id != $prtt_id) {
947 $this->toRepository();
948 }
949 }
950
951 //quota manipulation
952 include_once "Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
954 $quota_sum = 0;
955
956 //skills manipulation
957 include_once "Services/Skill/classes/class.ilPersonalSkill.php";
958 $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
959 $skill_ids = array();
960
961 $recipe = array();
962 foreach (ilPortfolioTemplatePage::getAllPortfolioPages($prtt_id) as $page) {
963 switch ($page["type"]) {
965 if (!$ilSetting->get('disable_wsp_blogs')) {
966 $recipe[$page["id"]] = array("blog", "create", $page['title']);
967 }
968 break;
970 $source_page = new ilPortfolioTemplatePage($page["id"]);
971 $source_page->buildDom(true);
972 if ($check_quota) {
973 $quota_sum += $source_page->getPageDiskSize();
974 }
975 $skill_ids = $this->getSkillsToPortfolioAssignment($pskills, $skill_ids, $source_page);
976 break;
977 }
978 }
979
980 if ($quota_sum) {
981 include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
982 if (!ilDiskQuotaHandler::isUploadPossible($quota_sum)) {
983 ilUtil::sendFailure($this->lng->txt("prtf_template_import_quota_failure"), true);
984 $this->ctrl->redirect($this, "create");
985 }
986 }
987
988 if ($skill_ids) {
989 $recipe["skills"] = $skill_ids;
990 }
991 }
992
993 // create portfolio
994 $target = new ilObjPortfolio();
995 $target->setTitle($title);
996 $target->create();
997 $target_id = $target->getId();
998
999 if ($prtt_id) {
1000 $source = new ilObjPortfolioTemplate($prtt_id, false);
1001 $source->clonePagesAndSettings($source, $target, $recipe);
1002 }
1003
1004 // link portfolio to exercise assignment
1006
1007 $this->ctrl->setParameter($this, "prt_id", $target_id);
1008 if ($prtt_id) {
1009 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created_from_template"), true);
1010 $this->ctrl->redirect($this, "preview");
1011 } else {
1012 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
1013 $this->ctrl->redirect($this, "view");
1014 }
1015 }
1016
1017 public function linkPortfolioToAssignment($a_target_id)
1018 {
1019 $ilAccess = $this->access;
1021
1022 $exc_ref_id = (int) $_REQUEST["exc_id"];
1023 $ass_id = (int) $_REQUEST["ass_id"];
1024
1025 if ($exc_ref_id &&
1026 $ass_id &&
1027 $ilAccess->checkAccess("read", "", $exc_ref_id)) {
1028 include_once "Modules/Exercise/classes/class.ilObjExercise.php";
1029 include_once "Modules/Exercise/classes/class.ilExAssignment.php";
1030 $exc = new ilObjExercise($exc_ref_id);
1031 $ass = new ilExAssignment($ass_id);
1032 if ($ass->getExerciseId() == $exc->getId() &&
1033 $ass->getType() == ilExAssignment::TYPE_PORTFOLIO) {
1034 // #16205
1035 include_once "Modules/Exercise/classes/class.ilExSubmission.php";
1036 $sub = new ilExSubmission($ass, $ilUser->getId());
1037 $sub->addResourceObject($a_target_id);
1038 }
1039 }
1040 }
1041
1048 public function getSkillsToPortfolioAssignment($a_pskills, $a_skill_ids, $a_source_page)
1049 {
1050 $dom = $a_source_page->getDom();
1051 if ($dom instanceof php4DOMDocument) {
1052 $dom = $dom->myDOMDocument;
1053 }
1054 $xpath = new DOMXPath($dom);
1055 $nodes = $xpath->query("//PageContent/Skills");
1056 foreach ($nodes as $node) {
1057 $skill_id = $node->getAttribute("Id");
1058 if (!in_array($skill_id, $a_pskills)) {
1059 $a_skill_ids[] = $skill_id;
1060 }
1061 }
1062 unset($nodes);
1063 unset($xpath);
1064 unset($dom);
1065
1066 return $a_skill_ids;
1067 }
1068
1074 public function exportPDFSelection()
1075 {
1076 global $DIC;
1077
1078 $tpl = $DIC["tpl"];
1079
1080 $form = $this->initPDFSelectionForm();
1081
1082 $tpl->setContent($form->getHTML());
1083 }
1084
1088 public function initPDFSelectionForm()
1089 {
1090 global $DIC;
1091
1092 $lng = $this->lng;
1094
1095 $tabs = $DIC->tabs();
1096
1097 $tabs->clearTargets();
1098 $tabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "view"));
1099
1100 $pages = ilPortfolioPage::getAllPortfolioPages($this->object->getId());
1101
1102
1103 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1104 $form = new ilPropertyFormGUI();
1105
1106 // because of PDF export
1107 $form->setPreventDoubleSubmission(false);
1108
1109 // signature
1110 $cb = new ilCheckboxInputGUI($this->lng->txt("prtf_signature"), "signature");
1111 $cb->setInfo($this->lng->txt("prtf_signature_info"));
1112 $form->addItem($cb);
1113
1114
1115 // selection type
1116 $radg = new ilRadioGroupInputGUI($lng->txt("prtf_print_selection"), "sel_type");
1117 $radg->setValue("all_pages");
1118 $op2 = new ilRadioOption($lng->txt("prtf_all_pages"), "all_pages");
1119 $radg->addOption($op2);
1120 $op3= new ilRadioOption($lng->txt("prtf_selected_pages"), "selection");
1121 $radg->addOption($op3);
1122
1123 include_once("./Services/Form/classes/class.ilNestedListInputGUI.php");
1124 $nl = new ilNestedListInputGUI("", "obj_id");
1125 $op3->addSubItem($nl);
1126
1127 foreach ($pages as $p) {
1128 if ($p["type"] != ilPortfolioPage::TYPE_BLOG) {
1129 $nl->addListNode(
1130 $p["id"],
1131 $p["title"],
1132 0,
1133 false,
1134 false,
1135 ilUtil::getImagePath("icon_pg.svg"),
1136 $lng->txt("page")
1137 );
1138 } else {
1139 $nl->addListNode(
1140 $p["id"],
1141 $lng->txt("obj_blog") . ": " . ilObject::_lookupTitle($p["title"]),
1142 0,
1143 false,
1144 false,
1145 ilUtil::getImagePath("icon_blog.svg"),
1146 $lng->txt("obj_blog")
1147 );
1148 $pages2 = ilBlogPosting::getAllPostings($p["title"]);
1149 foreach ($pages2 as $p2) {
1150 $nl->addListNode(
1151 "b" . $p2["id"],
1152 $p2["title"],
1153 $p["id"],
1154 false,
1155 false,
1156 ilUtil::getImagePath("icon_pg.svg"),
1157 $lng->txt("page")
1158 );
1159 }
1160 }
1161 }
1162
1163 $form->addItem($radg);
1164
1165 $form->addCommandButton("exportPDF", $lng->txt("prtf_pdf"));
1166 if (DEVMODE == "1") {
1167 $form->addCommandButton("exportPDFDev", $lng->txt("prtf_pdf") . " (DEV)");
1168 }
1169
1170 $form->setTitle($lng->txt("prtf_print_options"));
1171 $form->setFormAction($ilCtrl->getFormAction($this, "exportPDF"));
1172
1173 return $form;
1174 }
1175
1179 public function exportPDFDev()
1180 {
1181 $this->exportPDF(true);
1182 }
1183
1188 public function exportPDF($a_dev_mode = false)
1189 {
1190 require_once 'Services/WebAccessChecker/classes/class.ilWACSignedPath.php';
1192
1193 $html = $this->printView(true);
1194
1195 // :TODO: fixing css dummy parameters
1196 $html = preg_replace("/\?dummy\=[0-9]+/", "", $html);
1197 $html = preg_replace("/\?vers\=[0-9A-Za-z\-]+/", "", $html);
1198
1199 $html = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $html);
1200 $html = preg_replace("/href=\"\\.\\//ims", "href=\"" . ILIAS_HTTP_PATH . "/", $html);
1201
1202
1203 if ($a_dev_mode) {
1204 echo $html;
1205 exit;
1206 }
1207
1208 //$html = str_replace("&amp;", "&", $html);
1209
1210 $pdf_factory = new ilHtmlToPdfTransformerFactory();
1211 $pdf_factory->deliverPDFFromHTMLString($html, "portfolio.pdf", ilHtmlToPdfTransformerFactory::PDF_OUTPUT_DOWNLOAD, "Portfolio", "ContentExport");
1212 }
1213
1214 public function printView($a_pdf_export = false)
1215 {
1216 global $tpl;
1217
1218 $lng = $this->lng;
1219
1220 $pages = ilPortfolioPage::getAllPortfolioPages($this->object->getId());
1221
1222
1223 $tpl = new ilTemplate("tpl.main.html", true, true);
1224
1225 $tpl->setBodyClass("ilPrtfPdfBody");
1226
1227 $tpl->setCurrentBlock("AdditionalStyle");
1228 $tpl->setVariable("LOCATION_ADDITIONAL_STYLESHEET", ilUtil::getStyleSheetLocation("filesystem"));
1229 $tpl->parseCurrentBlock();
1230
1231 $tpl->setCurrentBlock("ContentStyle");
1232 $tpl->setVariable(
1233 "LOCATION_CONTENT_STYLESHEET",
1234 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId(), false)
1235 );
1236 $tpl->parseCurrentBlock();
1237
1238 $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
1239 //$this->setContentStyleSheet($tpl);
1240
1241 // syntax style
1242 $tpl->setCurrentBlock("SyntaxStyle");
1243 $tpl->setVariable(
1244 "LOCATION_SYNTAX_STYLESHEET",
1246 );
1247 $tpl->parseCurrentBlock();
1248
1249
1250 include_once("./Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
1251
1252 $page_content = "";
1253
1254 // cover page
1255 $cover_tpl = new ilTemplate("tpl.prtf_cover.html", true, true, "Modules/Portfolio");
1256 foreach ($pages as $page) {
1257 if ($page["type"] != ilPortfolioPage::TYPE_BLOG) {
1258 if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array($page["id"], $_POST["obj_id"]))) {
1259 continue;
1260 }
1261 $cover_tpl->setCurrentBlock("content_item");
1262 $cover_tpl->setVariable("ITEM_TITLE", $page["title"]);
1263 $cover_tpl->parseCurrentBlock();
1264 } else {
1265 $cover_tpl->setCurrentBlock("content_item");
1266 $cover_tpl->setVariable("ITEM_TITLE", $lng->txt("obj_blog") . ": " . ilObject::_lookupTitle($page["title"]));
1267 $cover_tpl->parseCurrentBlock();
1268 }
1269 }
1270
1271 if ($_POST["signature"]) {
1272 $cover_tpl->setCurrentBlock("signature");
1273 $cover_tpl->setVariable("TXT_SIGNATURE", $lng->txt("prtf_signature_date"));
1274 $cover_tpl->parseCurrentBlock();
1275 }
1276
1277 $cover_tpl->setVariable("PORTFOLIO_TITLE", $this->object->getTitle());
1278 $cover_tpl->setVariable("PORTFOLIO_ICON", ilUtil::getImagePath("icon_prtf.svg"));
1279
1280 $cover_tpl->setVariable("TXT_AUTHOR", $lng->txt("prtf_author"));
1281 $cover_tpl->setVariable("TXT_LINK", $lng->txt("prtf_link"));
1282 $cover_tpl->setVariable("TXT_DATE", $lng->txt("prtf_date_of_print"));
1283
1284 $author = ilObjUser::_lookupName($this->object->getOwner());
1285 $author_str = $author["firstname"] . " " . $author["lastname"];
1286 $cover_tpl->setVariable("AUTHOR", $author_str);
1287
1288 include_once('./Services/Link/classes/class.ilLink.php');
1289 $href = ilLink::_getStaticLink($this->object->getId(), "prtf");
1290 $cover_tpl->setVariable("LINK", $href);
1291
1293 $date_str = ilDatePresentation::formatDate(new ilDate(date("Y-m-d"), IL_CAL_DATE));
1294 $cover_tpl->setVariable("DATE", $date_str);
1295
1296 $page_content .= $cover_tpl->get();
1297 $page_content .= '<p style="page-break-after:always;"></p>';
1298
1299 $page_head_tpl = new ilTemplate("tpl.prtf_page_head.html", true, true, "Modules/Portfolio");
1300 $page_head_tpl->setVariable("AUTHOR", $author_str);
1301 $page_head_tpl->setVariable("DATE", $date_str);
1302 $page_head_str = $page_head_tpl->get();
1303
1304 foreach ($pages as $page) {
1305 if ($page["type"] != ilPortfolioPage::TYPE_BLOG) {
1306 if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array($page["id"], $_POST["obj_id"]))) {
1307 continue;
1308 }
1309
1310 $page_gui = new ilPortfolioPageGUI($this->object->getId(), $page["id"]);
1311 $page_gui->setOutputMode("print");
1312 $page_gui->setPresentationTitle($page["title"]);
1313 $page_content .= $page_head_str . $page_gui->showPage();
1314
1315 if ($a_pdf_export) {
1316 $page_content .= '<p style="page-break-after:always;"></p>';
1317 }
1318 } else {
1319 $pages2 = ilBlogPosting::getAllPostings($page["title"]);
1320 foreach ($pages2 as $p2) {
1321 if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array("b" . $p2["id"], $_POST["obj_id"]))) {
1322 continue;
1323 }
1324 $page_gui = new ilBlogPostingGUI(0, null, $p2["id"]);
1325 $page_gui->setFileDownloadLink("#");
1326 $page_gui->setFullscreenLink("#");
1327 $page_gui->setSourcecodeDownloadScript("#");
1328 $page_gui->setOutputMode("print");
1329 $page_content .= $page_head_str . $page_gui->showPage(ilObject::_lookupTitle($page["title"]) . ": " . $page_gui->getBlogPosting()->getTitle());
1330
1331 if ($a_pdf_export) {
1332 $page_content .= '<p style="page-break-after:always;"></p>';
1333 }
1334 }
1335 }
1336 }
1337
1338 $page_content = '<div class="ilInvisibleBorder">' . $page_content . '</div>';
1339
1340 if (!$a_pdf_export) {
1341 $page_content .= '<script type="text/javascript" language="javascript1.2">
1342 <!--
1343 il.Util.addOnLoad(function () {
1344 il.Util.print();
1345 });
1346 //-->
1347 </script>';
1348 }
1349
1350 $tpl->setVariable("CONTENT", $page_content);
1351
1352 if (!$a_pdf_export) {
1353 $tpl->show(false);
1354 exit;
1355 } else {
1356 $tpl->fillJavaScriptFiles();
1357 $ret = $tpl->get("DEFAULT", false, false, false, true, false, false);
1358 return $ret;
1359 }
1360 }
1361}
sprintf('%.4f', $callTime)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
user()
Definition: user.php:4
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
$source
Definition: linkback.php:22
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_DATE
Class ilBlogPosting GUI class.
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
This class represents a property in a property form.
This class represents a checkbox property in a property form.
This class represents an option in a checkbox group.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
Class for single dates.
static isUploadPossible($a_additional_size=null)
Exercise assignment.
Exercise submission.
static setPersonalWorkspaceQuotaCheck($a_value)
Class ilHtmlToPdfTransformerFactory.
This class represents a (nested) list of checkboxes (could be extended for radio items,...
This class represents a non editable value in a property form.
Class ilObjBlog.
Class ilObjExercise.
Portfolio view gui base class.
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
getAdditional()
Get Additonal Information.
preview($a_return=false, $a_content=false, $a_show_notes=true)
Show user page.
Portfolio view gui class.
getType()
Functions that must be overwritten.
getSkillsToPortfolioAssignment($a_pskills, $a_skill_ids, $a_source_page)
initEditForm()
Init object edit form.
exportPDFSelection()
Export PDF selection.
executeCommand()
execute command
getPageGUIInstance($a_page_id)
Get portfolio template page gui instance.
exportPDF($a_dev_mode=false)
saveBlog()
Create new portfolio blog page.
initCreateForm($a_new_type)
Init object creation form.
getPageInstance($a_page_id=null, $a_portfolio_id=null)
Get portfolio template page instance.
afterSave(ilObject $a_new_object)
Post (successful) object creation hook.
printView($a_pdf_export=false)
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
setTitleAndDescription()
called by prepare output
createPortfolioFromTemplate(ilPropertyFormGUI $a_form=null)
createPortfolioFromTemplateProcess($a_process_form=true)
updateCustom(ilPropertyFormGUI $a_form)
Insert custom update form values into object.
initCopyPageFormOptions(ilPropertyFormGUI $a_form)
setTabs()
create tabs (repository/workspace switch)
initBlogForm()
Init blog page form.
initPDFSelectionForm()
Init print view selection form.
initCreationForms($a_new_type)
Init creation froms.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
initCreatePortfolioFromTemplateForm($a_prtt_id, $a_title)
linkPortfolioToAssignment($a_target_id)
static getAvailablePortfolioTemplates($a_permission="read")
static setUserDefault($a_user_id, $a_portfolio_id=null)
Set the user default portfolio.
static getPortfoliosOfUser($a_user_id)
Get views of user.
Class ilObjStyleSheetGUI.
static getContentPrintStyle()
get content print style
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
static _lookupName($a_user_id)
lookup user name
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
Class ilObject Basic functions for all objects.
const TITLE_LENGTH
max length of object title
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
getId()
get object id @access public
Class ilPageLayout.
static activeLayouts($a_special_page=false, $a_module=null)
Get active layouts.
static getSelectedUserSkills($a_user_id)
Get personal selected user skills.
Class ilPortfolioExerciseGUI.
Portfolio page gui class.
Page for user portfolio.
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
Page for portfolio template.
This class represents a property form user interface.
addItem($a_item)
Add Item (Property, SectionHeader).
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
Access handler for personal workspace.
Tree handler for personal workspace.
if(!empty($this->data['faventry'])) $tabs
Definition: disco.tpl.php:124
$html
Definition: example_001.php:87
if(!array_key_exists('StateId', $_REQUEST)) $id
$target_id
Definition: goto.php:49
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6
global $ilSetting
Definition: privfeed.php:17
$type
$url
if(isset($_POST['submit'])) $form
$old
global $DIC
Definition: saml.php:7
settings()
Definition: settings.php:2
$ilUser
Definition: imgupload.php:18
$a_type
Definition: workflow.php:92