ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilObjWikiGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once "./Services/Object/classes/class.ilObjectGUI.php";
5require_once "./Modules/Wiki/classes/class.ilObjWiki.php";
6
7
24{
25
29 protected $log;
30
35 function ilObjWikiGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output = true)
36 {
37 global $ilCtrl, $lng;
38
39 $this->type = "wiki";
40
41 $this->log = ilLoggerFactory::getLogger('wiki');
42
43 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
44 $lng->loadLanguageModule("obj");
45 $lng->loadLanguageModule("wiki");
46
47 if ($_GET["page"] != "")
48 {
49 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
50 }
51 }
52
53 function executeCommand()
54 {
55 global $ilUser, $ilCtrl, $tpl, $ilTabs, $ilAccess;
56
57 $next_class = $this->ctrl->getNextClass($this);
58 $cmd = $this->ctrl->getCmd();
59
60 $this->prepareOutput();
61
62 // see ilWikiPageGUI::printViewOrderList()
63 // printView() and pdfExport() cannot be in ilWikiPageGUI because of stylesheet confusion
64 if($cmd == "printView" || $cmd == "pdfExport")
65 {
66 $next_class = null;
67 }
68
69 switch($next_class)
70 {
71 case "ilinfoscreengui":
72 $this->checkPermission("visible");
73 $this->addHeaderAction();
74 $this->infoScreen(); // forwards command
75 break;
76
77 case 'ilpermissiongui':
78 $this->addHeaderAction();
79 $ilTabs->activateTab("perm_settings");
80 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
81 $perm_gui =& new ilPermissionGUI($this);
82 $ret =& $this->ctrl->forwardCommand($perm_gui);
83 break;
84
85 case 'ilsettingspermissiongui':
86 $this->checkPermission("write");
87 $this->addHeaderAction();
88 $ilTabs->activateTab("settings");
89 $this->setSettingsSubTabs("permission_settings");
90 include_once("Services/AccessControl/classes/class.ilSettingsPermissionGUI.php");
91 $perm_gui = new ilSettingsPermissionGUI($this);
92 $perm_gui->setPermissions(array("edit_wiki_navigation", "delete_wiki_pages", "activate_wiki_protection",
93 "wiki_html_export"));
94 $perm_gui->setRoleRequiredPermissions(array("edit_content"));
95 $perm_gui->setRoleProhibitedPermissions(array("write"));
96 $ret = $this->ctrl->forwardCommand($perm_gui);
97 break;
98
99 case 'ilwikipagegui':
100 $this->checkPermission("read");
101 include_once("./Modules/Wiki/classes/class.ilWikiPageGUI.php");
102 $wpage_gui = ilWikiPageGUI::getGUIForTitle($this->object->getId(),
103 ilWikiUtil::makeDbTitle($_GET["page"]), $_GET["old_nr"], $this->object->getRefId());
104 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
105 $wpage_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
106 $this->object->getStyleSheetId(), "wiki"));
107 $this->setContentStyleSheet();
108 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()) &&
109 (!$ilAccess->checkAccess("edit_content", "", $this->object->getRefId()) ||
110 $wpage_gui->getPageObject()->getBlocked()
111 ))
112 {
113 $wpage_gui->setEnableEditing(false);
114 }
115
116 // alter title and description
117// $tpl->setTitle($wpage_gui->getPageObject()->getTitle());
118// $tpl->setDescription($this->object->getTitle());
119 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
120 {
121 $wpage_gui->activateMetaDataEditor($this->object, "wpg", $wpage_gui->getId());
122 }
123
124 $ret = $this->ctrl->forwardCommand($wpage_gui);
125 if ($ret != "")
126 {
127 $tpl->setContent($ret);
128 }
129 break;
130
131 case 'ilobjectcopygui':
132 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
133 $cp = new ilObjectCopyGUI($this);
134 $cp->setType('wiki');
135 $this->ctrl->forwardCommand($cp);
136 break;
137
138 case 'ilpublicuserprofilegui':
139 require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
140 $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
141 $ret = $this->ctrl->forwardCommand($profile_gui);
142 $tpl->setContent($ret);
143 break;
144
145 case "ilobjstylesheetgui":
146 include_once ("./Services/Style/classes/class.ilObjStyleSheetGUI.php");
147 $this->ctrl->setReturn($this, "editStyleProperties");
148 $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
149 $style_gui->omitLocator();
150 if ($cmd == "create" || $_GET["new_type"]=="sty")
151 {
152 $style_gui->setCreationMode(true);
153 }
154
155 if ($cmd == "confirmedDelete")
156 {
157 $this->object->setStyleSheetId(0);
158 $this->object->update();
159 }
160
161 $ret = $this->ctrl->forwardCommand($style_gui);
162
163 if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
164 {
165 $style_id = $ret;
166 $this->object->setStyleSheetId($style_id);
167 $this->object->update();
168 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
169 }
170 break;
171
172 case "ilexportgui":
173// $this->prepareOutput();
174 $this->addHeaderAction();
175 $ilTabs->activateTab("export");
176 include_once("./Services/Export/classes/class.ilExportGUI.php");
177 $exp_gui = new ilExportGUI($this);
178 $exp_gui->addFormat("xml");
179 $exp_gui->addFormat("html", "", $this, "exportHTML");
180 $ret = $this->ctrl->forwardCommand($exp_gui);
181// $this->tpl->show();
182 break;
183
184 case "ilcommonactiondispatchergui":
185 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
187 $this->ctrl->forwardCommand($gui);
188 break;
189
190 case "ilratinggui":
191 // for rating category editing
192 $this->checkPermission("write");
193 $this->addHeaderAction();
194 $ilTabs->activateTab("settings");
195 $this->setSettingsSubTabs("rating_categories");
196 include_once("Services/Rating/classes/class.ilRatingGUI.php");
197 $gui = new ilRatingGUI();
198 $gui->setObject($this->object->getId(), $this->object->getType());
199 $gui->setExportCallback(array($this, "getSubObjectTitle"), $this->lng->txt("page"));
200 $this->ctrl->forwardCommand($gui);
201 break;
202
203 case "ilwikistatgui":
204 $this->checkPermission("statistics_read");
205
206 $this->addHeaderAction();
207 $ilTabs->activateTab("statistics");
208
209 include_once "Modules/Wiki/classes/class.ilWikiStatGUI.php";
210 $gui = new ilWikiStatGUI($this->object->getId());
211 $this->ctrl->forwardCommand($gui);
212 break;
213
214 case "ilwikipagetemplategui":
215 $this->checkPermission("write");
216 $this->addHeaderAction();
217 $ilTabs->activateTab("settings");
218 $this->setSettingsSubTabs("page_templates");
219 include_once("./Modules/Wiki/classes/class.ilWikiPageTemplateGUI.php");
220 $wptgui = new ilWikiPageTemplateGUI($this);
221 $this->ctrl->forwardCommand($wptgui);
222 break;
223
224 case 'ilobjectmetadatagui';
225 $this->checkPermission("write");
226 $this->addHeaderAction();
227 $ilTabs->activateTab("advmd");
228 include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
229 $md_gui = new ilObjectMetaDataGUI($this->object, "wpg");
230 $this->ctrl->forwardCommand($md_gui);
231 break;
232
233 case 'ilrepositoryobjectsearchgui':
234 $this->addHeaderAction();
235 $this->setSideBlock();
236 $ilTabs->setTabActive("wiki_search_results");
237 $ilCtrl->setReturn($this,'view');
238 include_once './Services/Search/classes/class.ilRepositoryObjectSearchGUI.php';
239 $search_gui = new ilRepositoryObjectSearchGUI(
240 $this->object->getRefId(),
241 $this,
242 'view'
243 );
244 $ilCtrl->forwardCommand($search_gui);
245 break;
246
247 default:
248 $this->addHeaderAction();
249 if(!$cmd)
250 {
251 $cmd = "infoScreen";
252 }
253 $cmd .= "Object";
254 if ($cmd != "infoScreenObject")
255 {
256 if (!in_array($cmd, array("createObject", "saveObject", "importFileObject")))
257 {
258 $this->checkPermission("read");
259 }
260 }
261 else
262 {
263 $this->checkPermission("visible");
264 }
265 $this->$cmd();
266 break;
267 }
268
269 return $ret;
270 }
271
278 {
279 if (is_object($this->object))
280 {
281 return ilObjWiki::isOnlineHelpWiki($this->object->getRefId());
282 }
283 return false;
284 }
285
289 function viewObject()
290 {
291 $this->checkPermission("read");
292 $this->gotoStartPageObject();
293 }
294
295 protected function initCreationForms($a_new_type)
296 {
297 $this->initSettingsForm("create");
298 $this->getSettingsFormValues("create");
299
300 $forms = array(self::CFORM_NEW => $this->form_gui,
301 self::CFORM_IMPORT => $this->initImportForm($a_new_type),
302 self::CFORM_CLONE => $this->fillCloneTemplate(null, $a_new_type));
303
304 return $forms;
305 }
306
311 function saveObject()
312 {
313 global $tpl, $lng, $rbacsystem;
314
315 if (!$this->checkPermissionBool("create", "", "wiki", $_GET["ref_id"]))
316 {
317 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
318 }
319
320 $this->initSettingsForm("create");
321 if ($this->form_gui->checkInput())
322 {
323 if (!ilObjWiki::checkShortTitleAvailability($this->form_gui->getInput("shorttitle")))
324 {
325 $short_item = $this->form_gui->getItemByPostVar("shorttitle");
326 $short_item->setAlert($lng->txt("wiki_short_title_already_in_use"));
327 }
328 else
329 {
330 // create and insert forum in objecttree
331 $_POST["title"] = $this->form_gui->getInput("title");
332 $_POST["desc"] = $this->form_gui->getInput("description");
333 return parent::saveObject();
334 }
335 }
336
337 $this->form_gui->setValuesByPost();
338 $tpl->setContent($this->form_gui->getHtml());
339 }
340
345 function afterSave($newObj)
346 {
347 global $ilSetting;
348
349 $newObj->setTitle($this->form_gui->getInput("title"));
350 $newObj->setDescription($this->form_gui->getInput("description"));
351 $newObj->setIntroduction($this->form_gui->getInput("intro"));
352 $newObj->setStartPage($this->form_gui->getInput("startpage"));
353 $newObj->setShortTitle($this->form_gui->getInput("shorttitle"));
354 $newObj->setRating($this->form_gui->getInput("rating"));
355 // $newObj->setRatingAsBlock($this->form_gui->getInput("rating_side"));
356 $newObj->setRatingForNewPages($this->form_gui->getInput("rating_new"));
357 $newObj->setRatingCategories($this->form_gui->getInput("rating_ext"));
358
359 $newObj->setRatingOverall($this->form_gui->getInput("rating_overall"));
360 $newObj->setPageToc($this->form_gui->getInput("page_toc"));
361
362
363
364 if (!$ilSetting->get("disable_comments"))
365 {
366 $newObj->setPublicNotes($this->form_gui->getInput("public_notes"));
367 }
368 $newObj->setOnline($this->form_gui->getInput("online"));
369 $newObj->update();
370
371 // always send a message
372 ilUtil::sendSuccess($this->lng->txt("object_added"),true);
373 ilUtil::redirect(ilObjWikiGUI::getGotoLink($newObj->getRefId()));
374 }
375
382 {
383 $this->checkPermission("visible");
384 $this->ctrl->setCmd("showSummary");
385 $this->ctrl->setCmdClass("ilinfoscreengui");
386 $this->infoScreen();
387 }
388
392 function infoScreen()
393 {
394 global $ilAccess, $ilUser, $ilTabs, $lng;
395
396 $ilTabs->activateTab("info_short");
397
398 if (!$ilAccess->checkAccess("visible", "", $this->object->getRefId()))
399 {
400 $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
401 }
402
403 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
404 $info = new ilInfoScreenGUI($this);
405 $info->enablePrivateNotes();
406 if (trim($this->object->getIntroduction()) != "")
407 {
408 $info->addSection($lng->txt("wiki_introduction"));
409 $info->addProperty("", nl2br($this->object->getIntroduction()));
410 }
411
412 // feedback from tutor; mark, status, comment
413 include_once("./Modules/Wiki/classes/class.ilWikiContributor.php");
414 include_once("./Services/Tracking/classes/class.ilLPMarks.php");
415 $lpcomment = ilLPMarks::_lookupComment($ilUser->getId(), $this->object->getId());
416 $mark = ilLPMarks::_lookupMark($ilUser->getId(), $this->object->getId());
417 $status = ilWikiContributor::_lookupStatus($this->object->getId(), $ilUser->getId());
418 if ($lpcomment != "" || $mark != "" || $status != ilWikiContributor::STATUS_NOT_GRADED)
419 {
420 $info->addSection($this->lng->txt("wiki_feedback_from_tutor"));
421 if ($lpcomment != "")
422 {
423 $info->addProperty($this->lng->txt("wiki_comment"),
424 $lpcomment);
425 }
426 if ($mark != "")
427 {
428 $info->addProperty($this->lng->txt("wiki_mark"),
429 $mark);
430 }
431
432 if ($status == ilWikiContributor::STATUS_PASSED)
433 {
434 $info->addProperty($this->lng->txt("status"),
435 $this->lng->txt("wiki_passed"));
436 }
437 if ($status == ilWikiContributor::STATUS_FAILED)
438 {
439 $info->addProperty($this->lng->txt("status"),
440 $this->lng->txt("wiki_failed"));
441 }
442 }
443
444 /*
445 $info->enableNews();
446 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
447 {
448 //$info->enableNewsEditing();
449 $info->setBlockProperty("news", "settings", true);
450 }*/
451
452 if ($ilAccess->checkAccess("read", "", $this->object->getRefId()))
453 {
454 $info->addButton($lng->txt("wiki_start_page"), ilObjWikiGUI::getGotoLink($this->object->getRefId()));
455 }
456
457 // general information
458 $this->lng->loadLanguageModule("meta");
459 $this->lng->loadLanguageModule("wiki");
460
461 //$info->addSection($this->lng->txt("meta_general"));
462 //$info->addProperty($this->lng->txt("mcst_nr_items"),
463 // (int) count($med_items));
464
465 // forward the command
466 $this->ctrl->forwardCommand($info);
467
468 if ($ilAccess->checkAccess("read", "", $this->object->getRefId()))
469 {
470// $this->setSideBlock();
471 }
472 }
473
478 {
479 global $ilCtrl;
480
481 ilUtil::redirect(ilObjWikiGUI::getGotoLink($this->object->getRefId()));
482 }
483
487 function addPageTabs()
488 {
489 global $ilTabs, $ilCtrl;
490
491 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
492 $ilCtrl->setParameter($this, "wpg_id",
493 ilWikiPage::getPageIdForTitle($this->object->getId(), ilWikiUtil::makeDbTitle($_GET["page"])));
494 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
495 $ilTabs->addTarget("wiki_what_links_here",
496 $this->ctrl->getLinkTargetByClass("ilwikipagegui",
497 "whatLinksHere"), "whatLinksHere");
498 $ilTabs->addTarget("wiki_print_view",
499 $this->ctrl->getLinkTargetByClass("ilwikipagegui",
500 "printViewSelection"), "printViewSelection");
501 }
502
507 {
508 global $ilTabs, $ilCtrl;
509
510 $ilTabs->activateTab("wiki_pages");
511
512 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
513 $ilCtrl->setParameter($this, "wpg_id",
514 ilWikiPage::getPageIdForTitle($this->object->getId(),
516 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
517 $ilTabs->addSubTabTarget("wiki_all_pages",
518 $this->ctrl->getLinkTarget($this, "allPages"), "allPages");
519 $ilTabs->addSubTabTarget("wiki_recent_changes",
520 $this->ctrl->getLinkTarget($this, "recentChanges"), "recentChanges");
521 $ilTabs->addSubTabTarget("wiki_new_pages",
522 $this->ctrl->getLinkTarget($this, "newPages"), "newPages");
523 $ilTabs->addSubTabTarget("wiki_popular_pages",
524 $this->ctrl->getLinkTarget($this, "popularPages"), "popularPages");
525 $ilTabs->addSubTabTarget("wiki_orphaned_pages",
526 $this->ctrl->getLinkTarget($this, "orphanedPages"), "orphanedPages");
527 }
528
534 function getTabs($tabs_gui)
535 {
536 global $ilCtrl, $ilAccess, $ilTabs, $lng, $ilHelp;
537
538 $ilHelp->setScreenIdComponent("wiki");
539
540 // wiki tabs
541 if (in_array($ilCtrl->getCmdClass(), array("", "ilobjwikigui",
542 "ilinfoscreengui", "ilpermissiongui", "ilexportgui", "ilratingcategorygui",
543 "ilwikistatgui", "ilwikipagetemplategui", "iladvancedmdsettingsgui", "ilsettingspermissiongui", 'ilrepositoryobjectsearchgui'
544 )) || (in_array($ilCtrl->getNextClass(), array("ilpermissiongui"))))
545 {
546 if ($_GET["page"] != "")
547 {
548 $tabs_gui->setBackTarget($lng->txt("wiki_last_visited_page"),
549 $this->getGotoLink($_GET["ref_id"],
551 }
552
553 // pages
554 if ($ilAccess->checkAccess('read', "", $this->object->getRefId()))
555 {
556 $ilTabs->addTab("wiki_pages",
557 $lng->txt("wiki_pages"),
558 $this->ctrl->getLinkTarget($this, "allPages"));
559 }
560
561 // info screen
562 if ($ilAccess->checkAccess('visible', "", $this->object->getRefId()))
563 {
564 $ilTabs->addTab("info_short",
565 $lng->txt("info_short"),
566 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
567 }
568
569 // settings
570 if ($ilAccess->checkAccess('write', "", $this->object->getRefId()))
571 {
572 $ilTabs->addTab("settings",
573 $lng->txt("settings"),
574 $this->ctrl->getLinkTarget($this, "editSettings"));
575
576 // metadata
577 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
578 $mdgui = new ilObjectMetaDataGUI($this->object, "wpg");
579 $mdtab = $mdgui->getTab();
580 if($mdtab)
581 {
582 $ilTabs->addTab("advmd",
583 $this->lng->txt("meta_data"),
584 $mdtab);
585 }
586 }
587
588 // contributors
589 if ($ilAccess->checkAccess('write', "", $this->object->getRefId()))
590 {
591 $ilTabs->addTab("wiki_contributors",
592 $lng->txt("wiki_contributors"),
593 $this->ctrl->getLinkTarget($this, "listContributors"));
594 }
595
596 // statistics
597 if ($ilAccess->checkAccess('statistics_read', "", $this->object->getRefId()))
598 {
599 $ilTabs->addTab("statistics",
600 $lng->txt("statistics"),
601 $this->ctrl->getLinkTargetByClass("ilWikiStatGUI", "initial"));
602 }
603
604 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
605 {
606 $ilTabs->addTab("export",
607 $lng->txt("export"),
608 $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
609 }
610
611 // edit permissions
612 if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId()))
613 {
614 $ilTabs->addTab("perm_settings",
615 $lng->txt("perm_settings"),
616 $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"));
617 }
618 }
619 }
620
624 function setSettingsSubTabs($a_active)
625 {
626 global $ilTabs, $ilCtrl, $lng, $ilAccess;
627
628 if (in_array($a_active,
629 array("general_settings", "style", "imp_pages", "rating_categories",
630 "page_templates", "advmd", "permission_settings")))
631 {
632 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
633 {
634 // general properties
635 $ilTabs->addSubTab("general_settings",
636 $lng->txt("wiki_general_settings"),
637 $ilCtrl->getLinkTarget($this, 'editSettings'));
638
639 // permission settings
640 $ilTabs->addSubTab("permission_settings",
641 $lng->txt("obj_permission_settings"),
642 $this->ctrl->getLinkTargetByClass("ilsettingspermissiongui", ""));
643
644 // style properties
645 $ilTabs->addSubTab("style",
646 $lng->txt("wiki_style"),
647 $ilCtrl->getLinkTarget($this, 'editStyleProperties'));
648 }
649
650 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
651 {
652 // important pages
653 $ilTabs->addSubTab("imp_pages",
654 $lng->txt("wiki_navigation"),
655 $ilCtrl->getLinkTarget($this, 'editImportantPages'));
656 }
657
658 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
659 {
660 // page templates
661 $ilTabs->addSubTab("page_templates",
662 $lng->txt("wiki_page_templates"),
663 $ilCtrl->getLinkTargetByClass("ilwikipagetemplategui", ""));
664
665 // rating categories
666 if ($this->object->getRating() && $this->object->getRatingCategories())
667 {
668 $lng->loadLanguageModule("rating");
669 $ilTabs->addSubTab("rating_categories",
670 $lng->txt("rating_categories"),
671 $ilCtrl->getLinkTargetByClass(array('ilratinggui', 'ilratingcategorygui'), ''));
672 }
673 }
674
675 $ilTabs->activateSubTab($a_active);
676 }
677 }
678
683 {
684 global $tpl;
685
686 $this->checkPermission("write");
687
688 $this->setSettingsSubTabs("general_settings");
689
690 $this->initSettingsForm();
691 $this->getSettingsFormValues();
692
693 // Edit ecs export settings
694 include_once 'Modules/Wiki/classes/class.ilECSWikiSettings.php';
695 $ecs = new ilECSWikiSettings($this->object);
696 $ecs->addSettingsToForm($this->form_gui, 'wiki');
697
698 $tpl->setContent($this->form_gui->getHtml());
699 $this->setSideBlock();
700 }
701
705 function initSettingsForm($a_mode = "edit")
706 {
707 global $lng, $ilCtrl, $ilTabs, $ilSetting;
708
709 $lng->loadLanguageModule("wiki");
710 $ilTabs->activateTab("settings");
711
712 require_once("Services/Form/classes/class.ilPropertyFormGUI.php");
713 $this->form_gui = new ilPropertyFormGUI();
714
715 // Title
716 $tit = new ilTextInputGUI($lng->txt("title"), "title");
717 $tit->setRequired(true);
718 $this->form_gui->addItem($tit);
719
720 // Short Title
721 // The problem with the short title is, that it is per object
722 // and can't be a substitute for a ref id in the permanent link
723/*
724 $stit = new ilRegExpInputGUI($lng->txt("wiki_short_title"), "shorttitle");
725 $stit->setPattern("/^[^0-9][^ _\&]+$/");
726 $stit->setRequired(false);
727 $stit->setNoMatchMessage($lng->txt("wiki_msg_short_name_regexp")." &amp; _");
728 $stit->setSize(20);
729 $stit->setMaxLength(20);
730 $stit->setInfo($lng->txt("wiki_short_title_desc2"));
731 $this->form_gui->addItem($stit);
732*/
733
734 // Description
735 $des = new ilTextAreaInputGUI($lng->txt("description"), "description");
736 $this->form_gui->addItem($des);
737
738 // Introduction
739 $intro = new ilTextAreaInputGUI($lng->txt("wiki_introduction"), "intro");
740 $intro->setCols(40);
741 $intro->setRows(4);
742 $this->form_gui->addItem($intro);
743
744 // Start Page
745 if ($a_mode == "edit")
746 {
747 $pages = ilWikiPage::getAllPages($this->object->getId());
748 foreach ($pages as $p)
749 {
750 $options[$p["id"]] = ilUtil::shortenText($p["title"], 60, true);
751 }
752 $si = new ilSelectInputGUI($lng->txt("wiki_start_page"), "startpage_id");
753 $si->setOptions($options);
754 $this->form_gui->addItem($si);
755 }
756 else
757 {
758 $sp = new ilTextInputGUI($lng->txt("wiki_start_page"), "startpage");
759 if ($a_mode == "edit")
760 {
761 $sp->setInfo($lng->txt("wiki_start_page_info"));
762 }
763 $sp->setMaxLength(200);
764 $sp->setRequired(true);
765 $this->form_gui->addItem($sp);
766 }
767
768 // Online
769 $online = new ilCheckboxInputGUI($lng->txt("online"), "online");
770 $this->form_gui->addItem($online);
771
772
773 // rating
774
775 $lng->loadLanguageModule('rating');
776 $rate = new ilCheckboxInputGUI($lng->txt('rating_activate_rating'), 'rating_overall');
777 $rate->setInfo($lng->txt('rating_activate_rating_info'));
778 $this->form_gui->addItem($rate);
779
780 $rating = new ilCheckboxInputGUI($lng->txt("wiki_activate_rating"), "rating");
781 $this->form_gui->addItem($rating);
782
783 /* always active
784 $side = new ilCheckboxInputGUI($lng->txt("wiki_activate_sideblock_rating"), "rating_side");
785 $rating->addSubItem($side);
786 */
787
788 $new = new ilCheckboxInputGUI($lng->txt("wiki_activate_new_page_rating"), "rating_new");
789 $rating->addSubItem($new);
790
791 $extended = new ilCheckboxInputGUI($lng->txt("wiki_activate_extended_rating"), "rating_ext");
792 $rating->addSubItem($extended);
793
794
795 // public comments
796 if (!$ilSetting->get("disable_comments"))
797 {
798 $comments = new ilCheckboxInputGUI($lng->txt("wiki_public_comments"), "public_notes");
799 $this->form_gui->addItem($comments);
800 }
801
802 // important pages
803// $imp_pages = new ilCheckboxInputGUI($lng->txt("wiki_important_pages"), "imp_pages");
804// $this->form_gui->addItem($imp_pages);
805
806 // page toc
807 $page_toc = new ilCheckboxInputGUI($lng->txt("wiki_page_toc"), "page_toc");
808 $page_toc->setInfo($lng->txt("wiki_page_toc_info"));
809 $this->form_gui->addItem($page_toc);
810
811 if($a_mode == "edit")
812 {
813 // advanced metadata auto-linking
814 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
815 if(count(ilAdvancedMDRecord::_getSelectedRecordsByObject("wiki", $this->object->getId(), "wpg")) > 0)
816 {
817 $link_md = new ilCheckboxInputGUI($lng->txt("wiki_link_md_values"), "link_md_values");
818 $link_md->setInfo($lng->txt("wiki_link_md_values_info"));
819 $this->form_gui->addItem($link_md);
820 }
821
822 // additional features
823 $feat = new ilFormSectionHeaderGUI();
824 $feat->setTitle($this->lng->txt('obj_features'));
825 $this->form_gui->addItem($feat);
826
827 include_once './Services/Container/classes/class.ilContainer.php';
828 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
830 $this->object->getId(),
831 $this->form_gui,
832 array(
834 )
835 );
836 }
837
838 // :TODO: sorting
839
840 // Form action and save button
841 $this->form_gui->setTitleIcon(ilUtil::getImagePath("icon_wiki.svg"));
842 if ($a_mode != "create")
843 {
844 $this->form_gui->setTitle($lng->txt("wiki_settings"));
845 $this->form_gui->addCommandButton("saveSettings", $lng->txt("save"));
846 }
847 else
848 {
849 $this->form_gui->setTitle($lng->txt("wiki_new"));
850 $this->form_gui->addCommandButton("save", $lng->txt("wiki_add"));
851 $this->form_gui->addCommandButton("cancel", $lng->txt("cancel"));
852 }
853
854 // set values
855 if ($a_mode == "create")
856 {
857 $ilCtrl->setParameter($this, "new_type", "wiki");
858 }
859
860 $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveSettings"));
861 }
862
863 function getSettingsFormValues($a_mode = "edit")
864 {
865 global $lng, $ilUser;
866
867 // set values
868 if ($a_mode == "create")
869 {
870 //$values["startpage"] = $lng->txt("wiki_main_page");
871 $values["rating_new"] = true;
872
873 $values["rating_overall"] = ilObject::hasAutoRating("wiki", $_GET["ref_id"]);
874
875 $this->form_gui->setValuesByArray($values);
876 }
877 else
878 {
879 $values["online"] = $this->object->getOnline();
880 $values["title"] = $this->object->getTitle();
881 //$values["startpage"] = $this->object->getStartPage();
882 $values["startpage_id"] = ilWikiPage::_getPageIdForWikiTitle($this->object->getId(), $this->object->getStartPage());
883 $values["shorttitle"] = $this->object->getShortTitle();
884 $values["description"] = $this->object->getLongDescription();
885 $values["rating_overall"] = $this->object->getRatingOverall();
886 $values["rating"] = $this->object->getRating();
887 // $values["rating_side"] = $this->object->getRatingAsBlock();
888 $values["rating_new"] = $this->object->getRatingForNewPages();
889 $values["rating_ext"] = $this->object->getRatingCategories();
890 $values["public_notes"] = $this->object->getPublicNotes();
891 $values["intro"] = $this->object->getIntroduction();
892// $values["imp_pages"] = $this->object->getImportantPages();
893 $values["page_toc"] = $this->object->getPageToc();
894 $values["link_md_values"] = $this->object->getLinkMetadataValues();
895
896 // only set given values (because of adv. metadata)
897 $this->form_gui->setValuesByArray($values, true);
898 }
899 }
900
901
906 {
907 global $ilCtrl, $lng, $ilUser, $ilSetting;
908
909 $this->checkPermission("write");
910
911 $this->initSettingsForm();
912
913 if ($this->form_gui->checkInput())
914 {
915 if (!ilObjWiki::checkShortTitleAvailability($this->form_gui->getInput("shorttitle")) &&
916 $this->form_gui->getInput("shorttitle") != $this->object->getShortTitle())
917 {
918 $short_item = $this->form_gui->getItemByPostVar("shorttitle");
919 $short_item->setAlert($lng->txt("wiki_short_title_already_in_use"));
920 }
921 else
922 {
923 $this->object->setTitle($this->form_gui->getInput("title"));
924 $this->object->setDescription($this->form_gui->getInput("description"));
925 $this->object->setOnline($this->form_gui->getInput("online"));
926 $this->object->setStartPage(ilWikiPage::lookupTitle($this->form_gui->getInput("startpage_id")));
927 $this->object->setShortTitle($this->form_gui->getInput("shorttitle"));
928 $this->object->setRatingOverall($this->form_gui->getInput("rating_overall"));
929 $this->object->setRating($this->form_gui->getInput("rating"));
930 // $this->object->setRatingAsBlock($this->form_gui->getInput("rating_side"));
931 $this->object->setRatingForNewPages($this->form_gui->getInput("rating_new"));
932 $this->object->setRatingCategories($this->form_gui->getInput("rating_ext"));
933
934 if (!$ilSetting->get("disable_comments"))
935 {
936 $this->object->setPublicNotes($this->form_gui->getInput("public_notes"));
937 }
938 $this->object->setIntroduction($this->form_gui->getInput("intro"));
939// $this->object->setImportantPages($this->form_gui->getInput("imp_pages"));
940 $this->object->setPageToc($this->form_gui->getInput("page_toc"));
941 $this->object->setLinkMetadataValues($this->form_gui->getInput("link_md_values"));
942 $this->object->update();
943
944 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
946 $this->object->getId(),
947 $this->form_gui,
948 array(
950 )
951 );
952
953 // Update ecs export settings
954 include_once 'Modules/Wiki/classes/class.ilECSWikiSettings.php';
955 $ecs = new ilECSWikiSettings($this->object);
956 if($ecs->handleSettingsUpdate())
957 {
958 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
959 $ilCtrl->redirect($this, "editSettings");
960 }
961 }
962 }
963
964 $this->form_gui->setValuesByPost();
965 $this->tpl->setContent($this->form_gui->getHTML());
966 }
967
972 {
973 global $tpl, $ilTabs;
974
975 $this->checkPermission("write");
976 $ilTabs->activateTab("wiki_contributors");
977
978 include_once("./Modules/Wiki/classes/class.ilWikiContributorsTableGUI.php");
979
980 $table_gui = new ilWikiContributorsTableGUI($this, "listContributors",
981 $this->object->getId());
982
983 $tpl->setContent($table_gui->getHTML());
984
985 $this->setSideBlock();
986 }
987
992 {
993 global $ilCtrl, $lng;
994
995 $this->checkPermission("write");
996
997 $users = (is_array($_POST["user_id"])
998 ? $_POST["user_id"]
999 : array());
1000
1001 include_once("./Modules/Wiki/classes/class.ilWikiContributor.php");
1002 include_once("./Services/Tracking/classes/class.ilLPMarks.php");
1003 $saved = false;
1004 foreach($users as $user_id)
1005 {
1006 if ($user_id != "")
1007 {
1008 $marks_obj = new ilLPMarks($this->object->getId(),$user_id);
1009 $new_mark = ilUtil::stripSlashes($_POST['mark'][$user_id]);
1010 $new_comment = ilUtil::stripSlashes($_POST['lcomment'][$user_id]);
1011 $new_status = ilUtil::stripSlashes($_POST["status"][$user_id]);
1012
1013 if ($marks_obj->getMark() != $new_mark ||
1014 $marks_obj->getComment() != $new_comment ||
1015 ilWikiContributor::_lookupStatus($this->object->getId(), $user_id) != $new_status)
1016 {
1017 ilWikiContributor::_writeStatus($this->object->getId(), $user_id, $new_status);
1018 $marks_obj->setMark($new_mark);
1019 $marks_obj->setComment($new_comment);
1020 $marks_obj->update();
1021 $saved = true;
1022 }
1023 }
1024 }
1025 if ($saved)
1026 {
1027 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1028 }
1029
1030 $ilCtrl->redirect($this, "listContributors");
1031 }
1032
1033 // add wiki to locator
1035 {
1036 global $ilLocator;
1037
1038 if (is_object($this->object))
1039 {
1040 $ilLocator->addItem($this->object->getTitle(),
1041 $this->getGotoLink($this->object->getRefId()), "", $_GET["ref_id"]);
1042 }
1043 }
1044
1045 public static function _goto($a_target)
1046 {
1047 global $ilAccess, $ilErr, $lng, $ilNavigationHistory;
1048
1049 $i = strpos($a_target, "_");
1050 if ($i > 0)
1051 {
1052 $a_page = substr($a_target, $i+1);
1053 $a_target = substr($a_target, 0, $i);
1054 }
1055
1056 if ($a_target == "wpage")
1057 {
1058 $a_page_arr = explode("_", $a_page);
1059 $wpg_id = (int) $a_page_arr[0];
1060 $ref_id = (int) $a_page_arr[1];
1061 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1062 $w_id = ilWikiPage::lookupWikiId($wpg_id);
1063 if ($ref_id > 0)
1064 {
1065 $refs = array($ref_id);
1066 }
1067 else
1068 {
1069 $refs = ilObject::_getAllReferences($w_id);
1070 }
1071 foreach ($refs as $r)
1072 {
1073 if ($ilAccess->checkAccess("read", "", $r))
1074 {
1075 $a_target = $r;
1076 $a_page = ilWikiPage::lookupTitle($wpg_id);
1077 }
1078 }
1079 }
1080
1081 if ($ilAccess->checkAccess("read", "", $a_target))
1082 {
1083 $_GET["cmd"] = "viewPage";
1084 $_GET["ref_id"] = $a_target;
1085 $_GET["page"] = $a_page;
1086 $_GET["baseClass"] = "ilwikihandlergui";
1087 $_GET["cmdClass"] = "ilobjwikigui";
1088/* if ($a_page != "")
1089 {
1090 $add = "&amp;page=".rawurlencode($_GET["page"]);
1091 $ilNavigationHistory->addItem($_GET["ref_id"],
1092 "./goto.php?target=wiki_".$_GET["ref_id"].$add, "wiki");
1093 }*/
1094 include("ilias.php");
1095 exit;
1096 }
1097 else if ($ilAccess->checkAccess("visible", "", $a_target))
1098 {
1099 ilObjectGUI::_gotoRepositoryNode($tarr[0], "infoScreen");
1100 }
1101 else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1102 {
1103 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
1106 }
1107
1108 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1109 }
1110
1114 static function getGotoLink($a_ref_id, $a_page = "")
1115 {
1116 if ($a_page == "")
1117 {
1119 }
1120
1121 $goto = "goto.php?target=wiki_".$a_ref_id."_".
1122 ilWikiUtil::makeUrlTitle($a_page);
1123
1124 return $goto;
1125 }
1126
1131 {
1132 global $lng, $ilCtrl, $tpl, $ilTabs, $ilAccess;
1133
1134 $this->checkPermission("read");
1135
1136 $ilTabs->clearTargets();
1137 $tpl->setHeaderActionMenu(null);
1138
1139 $page = ($_GET["page"] != "")
1140 ? $_GET["page"]
1141 : $this->object->getStartPage();
1142 $_GET["page"] = $page;
1143
1144 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1145 if (!ilWikiPage::exists($this->object->getId(), $page))
1146 {
1147 $page = $this->object->getStartPage();
1148 }
1149
1150 if (!ilWikiPage::exists($this->object->getId(), $page))
1151 {
1152 ilUtil::sendInfo($lng->txt("wiki_no_start_page"), true);
1153 $ilCtrl->redirect($this, "infoScreen");
1154 return;
1155 }
1156
1157 // page exists, show it !
1158 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($page));
1159
1160 include_once("./Modules/Wiki/classes/class.ilWikiPageGUI.php");
1161 $wpage_gui = ilWikiPageGUI::getGUIForTitle($this->object->getId(),
1162 ilWikiUtil::makeDbTitle($page), 0, $this->object->getRefId());
1163 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1164 $wpage_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
1165 $this->object->getStyleSheetId(), "wiki"));
1166
1167 $this->setContentStyleSheet();
1168 //$wpage_gui->setOutputMode(IL_PAGE_PREVIEW);
1169
1170 //$wpage_gui->setSideBlock();
1171 $ilCtrl->setCmdClass("ilwikipagegui");
1172 $ilCtrl->setCmd("preview");
1173 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()) &&
1174 (!$ilAccess->checkAccess("edit_content", "", $this->object->getRefId()) ||
1175 $wpage_gui->getPageObject()->getBlocked()
1176 ))
1177 {
1178 $wpage_gui->setEnableEditing(false);
1179 }
1180
1181 // alter title and description
1182 //$tpl->setTitle($wpage_gui->getPageObject()->getTitle());
1183 //$tpl->setDescription($this->object->getTitle());
1184 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1185 {
1186 $wpage_gui->activateMetaDataEditor($this->object, "wpg", $wpage_gui->getId());
1187 }
1188
1189
1190 $html = $ilCtrl->forwardCommand($wpage_gui);
1191 //$this->addPageTabs();
1192
1193 $tpl->setContent($html);
1194 }
1195
1200 {
1201 global $tpl;
1202
1203 $this->checkPermission("read");
1204
1205 include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1206
1207 $this->addPagesSubTabs();
1208
1209 $table_gui = new ilWikiPagesTableGUI($this, "allPages",
1210 $this->object->getId(), IL_WIKI_ALL_PAGES);
1211
1212 $this->setSideBlock();
1213 $tpl->setContent($table_gui->getHTML());
1214 }
1215
1220 {
1221 global $tpl;
1222
1223 $this->checkPermission("read");
1224
1225 include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1226
1227 $this->addPagesSubTabs();
1228
1229 $table_gui = new ilWikiPagesTableGUI($this, "popularPages",
1230 $this->object->getId(), IL_WIKI_POPULAR_PAGES);
1231
1232 $this->setSideBlock();
1233 $tpl->setContent($table_gui->getHTML());
1234 }
1235
1240 {
1241 global $tpl;
1242
1243 $this->checkPermission("read");
1244
1245 include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1246
1247 $this->addPagesSubTabs();
1248
1249 $table_gui = new ilWikiPagesTableGUI($this, "orphanedPages",
1250 $this->object->getId(), IL_WIKI_ORPHANED_PAGES);
1251
1252 $this->setSideBlock();
1253 $tpl->setContent($table_gui->getHTML());
1254 }
1255
1261 function gotoPageObject($a_page = "")
1262 {
1263 global $ilCtrl;
1264
1265 if ($a_page == "")
1266 {
1267 $a_page = $_GET["page"];
1268 }
1269
1270 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1271 if (ilWikiPage::_wikiPageExists($this->object->getId(),
1272 ilWikiUtil::makeDbTitle($a_page)))
1273 {
1274 // to do: get rid of this redirect
1275 ilUtil::redirect(ilObjWikiGUI::getGotoLink($this->object->getRefId(), $a_page));
1276 }
1277 else
1278 {
1279 if (!$this->object->getTemplateSelectionOnCreation())
1280 {
1281 // check length
1282 include_once("./Services/Utilities/classes/class.ilStr.php");
1283 if (ilStr::strLen(ilWikiUtil::makeDbTitle($a_page)) > 200)
1284 {
1285 ilUtil::sendFailure($this->lng->txt("wiki_page_title_too_long")." (".$a_page.")", true);
1286 $ilCtrl->setParameterByClass("ilwikipagegui", "page", ilWikiUtil::makeUrlTitle($_GET["from_page"]));
1287 $ilCtrl->redirectByClass("ilwikipagegui", "preview");
1288 }
1289 $this->object->createWikiPage($a_page);
1290
1291 // redirect to newly created page
1292 $ilCtrl->setParameterByClass("ilwikipagegui", "page", ilWikiUtil::makeUrlTitle(($a_page)));
1293 $ilCtrl->redirectByClass("ilwikipagegui", "edit");
1294 }
1295 else
1296 {
1297 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
1298 $ilCtrl->setParameter($this, "from_page", ilWikiUtil::makeUrlTitle($_GET["from_page"]));
1299 $ilCtrl->redirect($this, "showTemplateSelection");
1300 }
1301 }
1302 }
1303
1310 {
1311 $this->checkPermission("read");
1312
1313 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1314 $page = ilWikiPage::getRandomPage($this->object->getId());
1315 $this->gotoPageObject($page);
1316 }
1317
1322 {
1323 global $tpl;
1324
1325 $this->checkPermission("read");
1326
1327 include_once("./Modules/Wiki/classes/class.ilWikiRecentChangesTableGUI.php");
1328
1329 $this->addPagesSubTabs();
1330
1331 $table_gui = new ilWikiRecentChangesTableGUI($this, "recentChanges",
1332 $this->object->getId());
1333
1334 $this->setSideBlock();
1335 $tpl->setContent($table_gui->getHTML());
1336 }
1337
1341 function setSideBlock($a_wpg_id = 0)
1342 {
1343 ilObjWikiGUI::renderSideBlock($a_wpg_id, $this->object->getRefId());
1344 }
1345
1346
1350 static function renderSideBlock($a_wpg_id, $a_wiki_ref_id, $a_wp = null)
1351 {
1352 global $tpl, $lng, $ilAccess, $ilCtrl;
1353
1354 $tpl->addJavaScript("./Modules/Wiki/js/WikiPres.js");
1355
1356 // setting asynch to false fixes #0019457, since otherwise ilBlockGUI would act on asynch and output html when side blocks
1357 // being processed during the export. This is a flaw in ilCtrl and/or ilBlockGUI.
1358 $tpl->addOnLoadCode("il.Wiki.Pres.init('".$ilCtrl->getLinkTargetByClass("ilobjwikigui", "", "", false, false)."');");
1359
1360 if ($a_wpg_id > 0 && !$a_wp)
1361 {
1362 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1363 $a_wp = ilWikiPage($a_wpg_id);
1364 }
1365
1366 // search block
1367 include_once './Services/Search/classes/class.ilRepositoryObjectSearchGUI.php';
1368 $rcontent = ilRepositoryObjectSearchGUI::getSearchBlockHTML($lng->txt('wiki_search'));
1369
1370 #include_once("./Modules/Wiki/classes/class.ilWikiSearchBlockGUI.php");
1371 #$wiki_search_block = new ilWikiSearchBlockGUI();
1372 #$rcontent = $wiki_search_block->getHTML();
1373
1374 // quick navigation
1375 if ($a_wpg_id > 0)
1376 {
1377// include_once("./Modules/Wiki/classes/class.ilWikiSideBlockGUI.php");
1378// $wiki_side_block = new ilWikiSideBlockGUI();
1379// $wiki_side_block->setPageObject($a_wp);
1380// $rcontent.= $wiki_side_block->getHTML();
1381
1382 // rating
1383 $wiki_id =ilObject::_lookupObjId($a_wiki_ref_id);
1384 if(ilObjWiki::_lookupRating($wiki_id) &&
1385 // ilObjWiki::_lookupRatingAsBlock($wiki_id) &&
1386 $a_wp->getRating())
1387 {
1388 include_once("./Services/Rating/classes/class.ilRatingGUI.php");
1389 $rgui = new ilRatingGUI();
1390 $rgui->setObject($wiki_id, "wiki", $a_wpg_id, "wpg");
1391 $rgui->enableCategories(ilObjWiki::_lookupRatingCategories($wiki_id));
1392 $rgui->setYourRatingText("#");
1393 $rcontent .= $rgui->getBlockHTML($lng->txt("wiki_rate_page"));
1394 }
1395
1396 // advanced metadata
1398 {
1399 $cmd = null;
1400 if($ilAccess->checkAccess("write", "", $a_wiki_ref_id))
1401 {
1402 $cmd = array(
1403 "edit" => $ilCtrl->getLinkTargetByClass("ilwikipagegui", "editAdvancedMetaData"),
1404 "hide" => $ilCtrl->getLinkTargetByClass("ilwikipagegui", "hideAdvancedMetaData")
1405 );
1406 }
1407 include_once("./Services/Object/classes/class.ilObjectMetaDataGUI.php");
1408 $wiki = new ilObjWiki($a_wiki_ref_id);
1409 $callback = $wiki->getLinkMetadataValues()
1410 ? array($wiki, "decorateAdvMDValue")
1411 : null;
1412 $mdgui = new ilObjectMetaDataGUI($wiki, "wpg", $a_wpg_id);
1413 $rcontent .= $mdgui->getBlockHTML($cmd, $callback); // #17291
1414 }
1415 }
1416
1417 // important pages
1418// if (ilObjWiki::_lookupImportantPages(ilObject::_lookupObjId($a_wiki_ref_id)))
1419// {
1420 include_once("./Modules/Wiki/classes/class.ilWikiImportantPagesBlockGUI.php");
1421 $imp_pages_block = new ilWikiImportantPagesBlockGUI();
1422 $rcontent.= $imp_pages_block->getHTML();
1423// }
1424
1425 // wiki functions block
1426 if ($a_wpg_id > 0)
1427 {
1428 include_once("./Modules/Wiki/classes/class.ilWikiFunctionsBlockGUI.php");
1429 $wiki_functions_block = new ilWikiFunctionsBlockGUI();
1430 $wiki_functions_block->setPageObject($a_wp);
1431 $rcontent .= $wiki_functions_block->getHTML();
1432 }
1433
1434 $tpl->setRightContent($rcontent);
1435 }
1436
1441 {
1442 global $tpl;
1443
1444 $this->checkPermission("read");
1445
1446 include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1447
1448 $this->addPagesSubTabs();
1449
1450 $table_gui = new ilWikiPagesTableGUI($this, "newPages",
1451 $this->object->getId(), IL_WIKI_NEW_PAGES);
1452
1453 $this->setSideBlock();
1454 $tpl->setContent($table_gui->getHTML());
1455 }
1456
1457 protected function getPrintPageIds()
1458 {
1459 // multiple ordered page ids
1460 if(is_array($_POST["wordr"]))
1461 {
1462 asort($_POST["wordr"]);
1463 $page_ids = array_keys($_POST["wordr"]);
1464 }
1465 // single page
1466 else if((int)$_GET["wpg_id"])
1467 {
1468 $page_ids = array((int)$_GET["wpg_id"]);
1469 }
1470
1471 return $page_ids;
1472 }
1473
1474 public function printViewObject($a_pdf_export = false)
1475 {
1476 global $tpl;
1477
1478 $page_ids = $this->getPrintPageIds();
1479 if(!$page_ids)
1480 {
1481 $this->ctrl->redirect($this, "");
1482 }
1483
1484 $tpl = new ilTemplate("tpl.main.html", true, true);
1485 $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
1486 $this->setContentStyleSheet($tpl);
1487
1488 // syntax style
1489 $tpl->setCurrentBlock("SyntaxStyle");
1490 $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
1492 $tpl->parseCurrentBlock();
1493
1494
1495 // determine target frames for internal links
1496
1497 include_once("./Modules/Wiki/classes/class.ilWikiPageGUI.php");
1498
1499 $page_content = "";
1500
1501 foreach ($page_ids as $p_id)
1502 {
1503 $page_gui = new ilWikiPageGUI($p_id);
1504 $page_gui->setOutputMode("print");
1505 $page_content.= $page_gui->showPage();
1506
1507 if($a_pdf_export)
1508 {
1509 $page_content .= '<p style="page-break-after:always;"></p>';
1510 }
1511 }
1512
1513 $page_content = '<div class="ilInvisibleBorder">'.$page_content.'</div>';
1514
1515 if(!$a_pdf_export)
1516 {
1517 $page_content .= '<script type="text/javascript" language="javascript1.2">
1518 <!--
1519 il.Util.addOnLoad(function () {
1520 il.Util.print();
1521 });
1522 //-->
1523 </script>';
1524 }
1525
1526 $tpl->setVariable("CONTENT", $page_content);
1527
1528 if(!$a_pdf_export)
1529 {
1530 $tpl->show(false);
1531 exit;
1532 }
1533 else
1534 {
1535 return $tpl->get("DEFAULT", false, false, false, true, false, false);
1536 }
1537 }
1538
1539 public function pdfExportObject()
1540 {
1541 $html = $this->printViewObject(true);
1542
1543 // :TODO: fixing css dummy parameters
1544 $html = preg_replace("/\?dummy\=[0-9]+/", "", $html);
1545 $html = preg_replace("/\?vers\=[0-9A-Za-z\-]+/", "", $html);
1546
1547 include_once "Services/PDFGeneration/classes/class.ilPDFGeneration.php";
1548 include_once "Services/PDFGeneration/classes/class.ilPDFGenerationJob.php";
1549
1550 $job = new ilPDFGenerationJob();
1551 $job->setAutoPageBreak(true)
1552 ->setMarginLeft("10")
1553 ->setMarginRight("10")
1554 ->setMarginTop("10")
1555 ->setMarginBottom("10")
1556 ->setOutputMode("D") // download
1557 ->setFilename("wiki.pdf") // :TODO:
1558 ->setCreator("ILIAS Wiki") // :TODO:
1559 ->setImageScale(1.25) // complete content scaling ?!
1560 ->addPage($html);
1561
1563 }
1564
1569 {
1570 global $tpl, $ilTabs, $ilCtrl, $lng;
1571
1572 $this->checkPermission("read");
1573
1574 include_once("./Modules/Wiki/classes/class.ilWikiSearchResultsTableGUI.php");
1575
1576 $ilTabs->setTabActive("wiki_search_results");
1577
1578 if (trim($_POST["search_term"]) == "")
1579 {
1580 ilUtil::sendFailure($lng->txt("wiki_please_enter_search_term"), true);
1581 $ilCtrl->redirectByClass("ilwikipagegui", "preview");
1582 }
1583
1584 $search_results = ilObjWiki::_performSearch($this->object->getId(),
1585 ilUtil::stripSlashes($_POST["search_term"]));
1586 $table_gui = new ilWikiSearchResultsTableGUI($this, "performSearch",
1587 $this->object->getId(), $search_results, $_POST["search_term"]);
1588
1589 $this->setSideBlock();
1590 $tpl->setContent($table_gui->getHTML());
1591 }
1592
1596 function setContentStyleSheet($a_tpl = null)
1597 {
1598 global $tpl;
1599
1600 if ($a_tpl != null)
1601 {
1602 $ctpl = $a_tpl;
1603 }
1604 else
1605 {
1606 $ctpl = $tpl;
1607 }
1608
1609 $ctpl->setCurrentBlock("ContentStyle");
1610 $ctpl->setVariable("LOCATION_CONTENT_STYLESHEET",
1611 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
1612 $ctpl->parseCurrentBlock();
1613
1614 }
1615
1616
1621 {
1622 global $ilTabs, $tpl;
1623
1624 $this->checkPermission("write");
1625
1626 $this->initStylePropertiesForm();
1627 $tpl->setContent($this->form->getHTML());
1628
1629 $ilTabs->activateTab("settings");
1630 $this->setSettingsSubTabs("style");
1631
1632 $this->setSideBlock();
1633 }
1634
1639 {
1640 global $ilCtrl, $lng, $ilTabs, $ilSetting;
1641
1642 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1643 $lng->loadLanguageModule("style");
1644
1645 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1646 $this->form = new ilPropertyFormGUI();
1647
1648 $fixed_style = $ilSetting->get("fixed_content_style_id");
1649 $style_id = $this->object->getStyleSheetId();
1650
1651 if ($fixed_style > 0)
1652 {
1653 $st = new ilNonEditableValueGUI($lng->txt("style_current_style"));
1654 $st->setValue(ilObject::_lookupTitle($fixed_style)." (".
1655 $this->lng->txt("global_fixed").")");
1656 $this->form->addItem($st);
1657 }
1658 else
1659 {
1660 $st_styles = ilObjStyleSheet::_getStandardStyles(true, false,
1661 $_GET["ref_id"]);
1662
1663 $st_styles[0] = $this->lng->txt("default");
1664 ksort($st_styles);
1665
1666 if ($style_id > 0)
1667 {
1668 // individual style
1669 if (!ilObjStyleSheet::_lookupStandard($style_id))
1670 {
1671 $st = new ilNonEditableValueGUI($lng->txt("style_current_style"));
1672 $st->setValue(ilObject::_lookupTitle($style_id));
1673 $this->form->addItem($st);
1674
1675//$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "edit"));
1676
1677 // delete command
1678 $this->form->addCommandButton("editStyle",
1679 $lng->txt("style_edit_style"));
1680 $this->form->addCommandButton("deleteStyle",
1681 $lng->txt("style_delete_style"));
1682//$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "delete"));
1683 }
1684 }
1685
1686 if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id))
1687 {
1688 $style_sel = ilUtil::formSelect ($style_id, "style_id",
1689 $st_styles, false, true);
1690 $style_sel = new ilSelectInputGUI($lng->txt("style_current_style"), "style_id");
1691 $style_sel->setOptions($st_styles);
1692 $style_sel->setValue($style_id);
1693 $this->form->addItem($style_sel);
1694//$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "create"));
1695 $this->form->addCommandButton("saveStyleSettings",
1696 $lng->txt("save"));
1697 $this->form->addCommandButton("createStyle",
1698 $lng->txt("sty_create_ind_style"));
1699 }
1700 }
1701 $this->form->setTitle($lng->txt("wiki_style"));
1702 $this->form->setFormAction($ilCtrl->getFormAction($this));
1703 }
1704
1709 {
1710 global $ilCtrl;
1711
1712 $ilCtrl->redirectByClass("ilobjstylesheetgui", "create");
1713 }
1714
1719 {
1720 global $ilCtrl;
1721
1722 $ilCtrl->redirectByClass("ilobjstylesheetgui", "edit");
1723 }
1724
1729 {
1730 global $ilCtrl;
1731
1732 $ilCtrl->redirectByClass("ilobjstylesheetgui", "delete");
1733 }
1734
1739 {
1740 global $ilSetting;
1741
1742 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1743 if ($ilSetting->get("fixed_content_style_id") <= 0 &&
1744 (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId())
1745 || $this->object->getStyleSheetId() == 0))
1746 {
1747 $this->object->setStyleSheetId(ilUtil::stripSlashes($_POST["style_id"]));
1748 $this->object->update();
1749 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1750 }
1751 $this->ctrl->redirect($this, "editStyleProperties");
1752 }
1753
1754 //
1755 // Important pages
1756 //
1757
1762 {
1763 global $tpl, $ilToolbar, $ilTabs, $lng, $ilCtrl;
1764
1765 $this->checkPermission("edit_wiki_navigation");
1766
1767 ilUtil::sendInfo($lng->txt("wiki_navigation_info"));
1768
1769 $ipages = ilObjWiki::_lookupImportantPagesList($this->object->getId());
1770 $ipages_ids = array();
1771 foreach ($ipages as $i)
1772 {
1773 $ipages_ids[] = $i["page_id"];
1774 }
1775
1776 // list pages
1777 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1778 $pages = ilWikiPage::getAllPages($this->object->getId());
1779 $options = array("" => $lng->txt("please_select"));
1780 foreach ($pages as $p)
1781 {
1782 if (!in_array($p["id"], $ipages_ids))
1783 {
1784 $options[$p["id"]] = ilUtil::shortenText($p["title"], 60, true);
1785 }
1786 }
1787 if (count($options) > 0)
1788 {
1789 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1790 $si = new ilSelectInputGUI($lng->txt("wiki_pages"), "imp_page_id");
1791 $si->setOptions($options);
1792 $si->setInfo($lng->txt(""));
1793 $ilToolbar->addInputItem($si);
1794 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1795 $ilToolbar->addFormButton($lng->txt("add"), "addImportantPage");
1796 }
1797
1798
1799 $ilTabs->activateTab("settings");
1800 $this->setSettingsSubTabs("imp_pages");
1801
1802 include_once("./Modules/Wiki/classes/class.ilImportantPagesTableGUI.php");
1803 $imp_table = new ilImportantPagesTableGUI($this, "editImportantPages");
1804
1805 $tpl->setContent($imp_table->getHTML());
1806 }
1807
1815 {
1816 global $ilCtrl, $lng;
1817
1818 $this->checkPermission("edit_wiki_navigation");
1819
1820 if ($_POST["imp_page_id"] > 0)
1821 {
1822 $this->object->addImportantPage((int) $_POST["imp_page_id"]);
1823 ilUtil::sendSuccess($lng->txt("wiki_imp_page_added"), true);
1824 }
1825 $ilCtrl->redirect($this, "editImportantPages");
1826 }
1827
1832 {
1833 global $ilCtrl, $tpl, $lng;
1834
1835 if (!is_array($_POST["imp_page_id"]) || count($_POST["imp_page_id"]) == 0)
1836 {
1837 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1838 $ilCtrl->redirect($this, "editImportantPages");
1839 }
1840 else
1841 {
1842 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1843 $cgui = new ilConfirmationGUI();
1844 $cgui->setFormAction($ilCtrl->getFormAction($this));
1845 $cgui->setHeaderText($lng->txt("wiki_sure_remove_imp_pages"));
1846 $cgui->setCancel($lng->txt("cancel"), "editImportantPages");
1847 $cgui->setConfirm($lng->txt("remove"), "removeImportantPages");
1848
1849 foreach ($_POST["imp_page_id"] as $i)
1850 {
1851 $cgui->addItem("imp_page_id[]", $i, ilWikiPage::lookupTitle((int) $i));
1852 }
1853
1854 $tpl->setContent($cgui->getHTML());
1855 }
1856 }
1857
1865 {
1866 global $ilCtrl, $lng;
1867
1868 $this->checkPermission("edit_wiki_navigation");
1869
1870 if (is_array($_POST["imp_page_id"]))
1871 {
1872 foreach ($_POST["imp_page_id"] as $i)
1873 {
1874 $this->object->removeImportantPage((int) $i);
1875 }
1876 }
1877 ilUtil::sendSuccess($lng->txt("wiki_removed_imp_pages"), true);
1878 $ilCtrl->redirect($this, "editImportantPages");
1879 }
1880
1885 {
1886 global $ilCtrl, $lng;
1887
1888 $this->checkPermission("edit_wiki_navigation");
1889
1890 $this->object->saveOrderingAndIndentation($_POST["ord"], $_POST["indent"]);
1891 ilUtil::sendSuccess($lng->txt("wiki_ordering_and_indent_saved"), true);
1892 $ilCtrl->redirect($this, "editImportantPages");
1893 }
1894
1899 {
1900 global $ilCtrl, $lng;
1901
1902 $this->checkPermission("edit_wiki_navigation");
1903
1904 if (!is_array($_POST["imp_page_id"]) || count($_POST["imp_page_id"]) != 1)
1905 {
1906 ilUtil::sendInfo($lng->txt("wiki_select_one_item"), true);
1907 }
1908 else
1909 {
1910 $this->object->removeImportantPage((int) $_POST["imp_page_id"][0]);
1911 $this->object->setStartPage(ilWikiPage::lookupTitle((int) $_POST["imp_page_id"][0]));
1912 $this->object->update();
1913 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
1914 }
1915 $ilCtrl->redirect($this, "editImportantPages");
1916 }
1917
1918
1922 function exportHTML()
1923 {
1924 require_once("./Modules/Wiki/classes/class.ilWikiHTMLExport.php");
1925 $cont_exp = new ilWikiHTMLExport($this->object);
1926 $cont_exp->buildExportFile();
1927 }
1928
1936 static function lookupSubObjectTitle($a_wiki_id, $a_page_id)
1937 {
1938 include_once "Modules/Wiki/classes/class.ilWikiPage.php";
1939 $page = new ilWikiPage($a_page_id);
1940 if($page->getWikiId() == $a_wiki_id)
1941 {
1942 return $page->getTitle();
1943 }
1944 }
1945
1953 function getSubObjectTitle($a_id, $a_type)
1954 {
1955 include_once "Modules/Wiki/classes/class.ilWikiPage.php";
1956 return ilWikiPage::lookupTitle($a_id);
1957 }
1958
1963 {
1964 global $lng, $tpl, $ilTabs, $ilCtrl;
1965
1966
1967 $ilCtrl->setParameterByClass("ilobjwikigui", "from_page", ilWikiUtil::makeUrlTitle($_GET["from_page"]));
1968 $ilTabs->clearTargets();
1969 ilUtil::sendInfo($lng->txt("wiki_page_not_exist_select_templ"));
1970
1971 $form = $this->initTemplateSelectionForm();
1972 $tpl->setContent($form->getHTML());
1973 }
1974
1979 {
1980 global $lng, $ilCtrl;
1981
1982 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1983 $form = new ilPropertyFormGUI();
1984
1985 // page name
1986 $hi = new ilHiddenInputGUI("page");
1987 $hi->setValue($_GET["page"]);
1988 $form->addItem($hi);
1989
1990 // page template
1991 $radg = new ilRadioGroupInputGUI($lng->txt("wiki_page_template"), "page_templ");
1992 $radg->setRequired(true);
1993
1994 if ($this->object->getEmptyPageTemplate())
1995 {
1996 $op1 = new ilRadioOption($lng->txt("wiki_empty_page"), 0);
1997 $radg->addOption($op1);
1998 }
1999
2000 include_once("./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
2001 $wt = new ilWikiPageTemplate($this->object->getId());
2002 $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);
2003 foreach ($ts as $t)
2004 {
2005 $op = new ilRadioOption($t["title"], $t["wpage_id"]);
2006 $radg->addOption($op);
2007 }
2008
2009 $form->addItem($radg);
2010
2011 // save and cancel commands
2012 $form->addCommandButton("createPageUsingTemplate", $lng->txt("wiki_create_page"));
2013 $form->addCommandButton("cancelCreationPageUsingTemplate", $lng->txt("cancel"));
2014
2015 $form->setTitle($lng->txt("wiki_new_page").": ".$_GET["page"]);
2016 $form->setFormAction($ilCtrl->getFormAction($this));
2017
2018 return $form;
2019 }
2020
2025 {
2026 global $tpl, $lng, $ilCtrl;
2027
2028 $form = $this->initTemplateSelectionForm();
2029 if ($form->checkInput())
2030 {
2031 $a_page = $_POST["page"];
2032 $this->object->createWikiPage($a_page, (int) $_POST["page_templ"]);
2033
2034 // redirect to newly created page
2035 $ilCtrl->setParameterByClass("ilwikipagegui", "page", ilWikiUtil::makeUrlTitle(($a_page)));
2036 $ilCtrl->redirectByClass("ilwikipagegui", "edit");
2037
2038 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2039 $ilCtrl->redirect($this, "");
2040 }
2041 else
2042 {
2043 $form->setValuesByPost();
2044 $tpl->setContent($form->getHtml());
2045 }
2046 }
2047
2052 {
2053 global $ilCtrl;
2054
2055 // redirect to newly created page
2056 $ilCtrl->setParameterByClass("ilwikipagegui", "page", ilWikiUtil::makeUrlTitle(($_GET["from_page"])));
2057 $ilCtrl->redirectByClass("ilwikipagegui", "preview");
2058 }
2059
2069 protected function checkPermissionBool($a_perm, $a_cmd = "", $a_type = "", $a_ref_id = null)
2070 {
2071 if($a_perm == "create")
2072 {
2073 return parent::checkPermissionBool($a_perm, $a_cmd, $a_type, $a_ref_id);
2074 }
2075 else
2076 {
2077 if (!$a_ref_id)
2078 {
2079 $a_ref_id = $this->object->getRefId();
2080 }
2081 include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
2082 return ilWikiPerm::check($a_perm, $a_ref_id, $a_cmd);
2083 }
2084 }
2085
2086
2087 //
2088 // User HTML Export
2089 //
2090
2095 {
2096 $this->log->debug("init");
2097 $this->checkPermission("wiki_html_export");
2098 $this->object->initUserHTMLExport();
2099 }
2100
2105 {
2106 $this->log->debug("start");
2107 $this->checkPermission("wiki_html_export");
2108 $this->object->startUserHTMLExport();
2109 }
2110
2115 {
2116 $this->log->debug("get progress");
2117 $this->checkPermission("wiki_html_export");
2118 $p = $this->object->getUserHTMLExportProgress();
2119
2120 include_once("./Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php");
2122 $pb->setCurrent($p["progress"]);
2123
2124 $r = new stdClass();
2125 $r->progressBar = $pb->render();
2126 $r->status = $p["status"];
2127 include_once("./Services/JSON/classes/class.ilJsonUtil.php");
2128 $this->log->debug("status: ".$r->status);
2129 echo (ilJsonUtil::encode($r));
2130 exit;
2131 }
2132
2137 {
2138 $this->log->debug("download");
2139 $this->checkPermission("wiki_html_export");
2140 $this->object->deliverUserHTMLExport();
2141 }
2142
2143
2144}
2145
2146?>
$_GET["client_id"]
const IL_WIKI_ALL_PAGES
const IL_WIKI_POPULAR_PAGES
const IL_WIKI_NEW_PAGES
const IL_WIKI_ORPHANED_PAGES
static _getSelectedRecordsByObject($a_obj_type, $a_obj_id, $a_sub_type="")
Get selected records by object.
This class represents a checkbox property in a property form.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.
Class ilECSWikiSettings.
Export User Interface Class.
This class represents a section header in a property form.
This class represents a hidden form property in a property form.
Class ilInfoScreenGUI.
static encode($mixed, $suppress_native=false)
_lookupComment($a_usr_id, $a_obj_id)
_lookupMark($a_usr_id, $a_obj_id)
static getLogger($a_component_id)
Get component logger.
This class represents a non editable value in a property form.
Class ilObjStyleSheetGUI.
getContentStylePath($a_style_id)
get content style path
_getStandardStyles($a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
getContentPrintStyle()
get content print style
getSyntaxStylePath()
get syntax style path
_lookupStandard($a_id)
Lookup standard flag.
Class ilObjWikiGUI.
orphanedPagesObject()
Orphaned pages.
popularPagesObject()
Popular pages.
setSettingsSubTabs($a_active)
Set sub tabs.
gotoStartPageObject()
Go to start page.
saveSettingsObject()
Save Settings.
editSettingsObject()
Edit settings.
allPagesObject()
All pages of wiki.
ilObjWikiGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
Constructor @access public.
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
downloadUserHTMLExportObject()
Download user html export file.
cancelCreationPageUsingTemplateObject()
Cancel page creation using a template.
createStyleObject()
Create Style.
static renderSideBlock($a_wpg_id, $a_wiki_ref_id, $a_wp=null)
Side column.
static getGotoLink($a_ref_id, $a_page="")
Get goto link.
editStylePropertiesObject()
Edit style properties.
deleteStyleObject()
Delete Style.
saveObject()
save object @access public
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
editStyleObject()
Edit Style.
addImportantPageObject()
Add important pages.
infoScreen()
show information screen
addPagesSubTabs()
Add Pages SubTabs.
saveStyleSettingsObject()
Save style settings.
initStylePropertiesForm()
Init style properties form.
getSubObjectTitle($a_id, $a_type)
Used for rating export.
initSettingsForm($a_mode="edit")
Init Settings Form.
executeCommand()
execute command
setContentStyleSheet($a_tpl=null)
Set content style sheet.
viewPageObject()
view wiki page
printViewObject($a_pdf_export=false)
randomPageObject()
Go to random page.
viewObject()
Start page.
afterSave($newObj)
save object @access public
isOnlineHelpWiki()
Is wiki an online help wiki?
performSearchObject()
Search.
getSettingsFormValues($a_mode="edit")
initTemplateSelectionForm()
Init template selection form.
static _goto($a_target)
newPagesObject()
Latest pages.
showTemplateSelectionObject()
Show template selection.
getTabs($tabs_gui)
get tabs @access public
startUserHTMLExportObject()
Export html (as user)
createPageUsingTemplateObject()
Save creation with template form.
saveOrderingAndIndentObject()
Save important pages ordering and indentation.
saveGradingObject()
Save grading.
initCreationForms($a_new_type)
Init creation froms.
removeImportantPagesObject()
Remove important pages.
listContributorsObject()
List all contributors.
exportHTML()
Create html package.
setSideBlock($a_wpg_id=0)
Side column.
setAsStartPageObject()
Confirm important pages deletion.
editImportantPagesObject()
List important pages.
getUserHTMLExportProgressObject()
Get user html export progress.
initUserHTMLExportObject()
Export html (as user)
gotoPageObject($a_page="")
Go to specific page.
addPageTabs()
Add Page Tabs.
static lookupSubObjectTitle($a_wiki_id, $a_page_id)
Get title for wiki page (used in ilNotesGUI)
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
recentChangesObject()
Recent Changes.
confirmRemoveImportantPagesObject()
Confirm important pages deletion.
Class ilObjWiki.
static _lookupRatingCategories($a_wiki_id)
Lookup whether rating categories are activated.
static _performSearch($a_wiki_id, $a_searchterm)
Search in Wiki.
static isOnlineHelpWiki($a_ref_id)
Is wiki an online help wiki?
static _lookupImportantPagesList($a_wiki_id)
Get important pages list.
static checkShortTitleAvailability($a_short_title)
Check availability of short title.
static _lookupStartPage($a_wiki_id)
Lookup start page.
static _lookupRating($a_wiki_id)
Lookup whether rating is activated.
GUI class for the workflow of copying objects.
Class ilObjectGUI Basic methods of all Output classes.
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
initImportForm($a_new_type)
Init object import form.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
prepareOutput()
prepare output
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
fillCloneTemplate($a_tpl_varname, $a_type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...
addHeaderAction()
Add header action menu.
Class ilObjectMetaDataGUI.
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
static hasAutoRating($a_type, $a_ref_id)
Check if auto rating is active for parent group/course.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
Class ilPDFGenerationJob.
static doJob(ilPDFGenerationJob $job)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getInstance()
Factory.
This class represents a property form user interface.
GUI class for public user profile presentation.
This class represents a property in a property form.
This class represents an option in a radio group.
Class ilRatingGUI.
static getSearchBlockHTML($a_title)
Get standar search block html.
This class represents a selection list property in a property form.
UI class for handling permissions that can be configured having the write permission for an object.
static strLen($a_string)
Definition: class.ilStr.php:79
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
_writeStatus($a_obj_id, $a_user_id, $a_status)
Write success status.
_lookupStatus($a_obj_id, $a_user_id)
Lookup current success status (STATUS_NOT_GRADED|STATUS_PASSED|STATUS_FAILED)
TableGUI class for listing users that contributed to the wiki.
BlockGUI class for wiki functions block.
Wiki HTML exporter class.
Class ilWikiPage GUI class.
static getGUIForTitle($a_wiki_id, $a_title, $a_old_nr=0, $a_wiki_ref_id=0)
Get wiki page gui for id and title.
Wiki page template gui class.
Class ilWikiPage.
static lookupAdvancedMetadataHidden($a_page_id)
static exists($a_wiki_id, $a_title)
Checks whether a page with given title exists.
static getPageIdForTitle($a_wiki_id, $a_title)
Get wiki page object for id and title.
static _wikiPageExists($a_wiki_id, $a_title)
Check whether page exists for wiki or not
static getAllPages($a_wiki_id)
Get all pages of wiki
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
static _getPageIdForWikiTitle($a_wiki_id, $a_title)
Checks whether a page with given title exists.
static getRandomPage($a_wiki_id)
Get a random page
static lookupWikiId($a_page_id)
Lookup wiki id.
TableGUI class for wiki pages table.
static check($a_perm, $a_ref_id, $a_cmd="")
Check permission.
TableGUI class for recent changes in wiki.
TableGUI class for recent changes in wiki.
Wiki statistics GUI class.
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
static makeDbTitle($a_par)
Handle page GET parameter.
$_POST['username']
Definition: cron.php:12
$html
Definition: example_001.php:87
$r
Definition: example_031.php:79
$info
Definition: example_052.php:80
global $ilCtrl
Definition: ilias.php:18
exit
Definition: login.php:54
redirection script todo: (a better solution should control the processing via a xml file)
global $ilSetting
Definition: privfeed.php:40
$cmd
Definition: sahs_server.php:35
if(!is_array($argv)) $options
global $ilUser
Definition: imgupload.php:15