4 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
5 require_once
"./Modules/Wiki/classes/class.ilObjWiki.php";
26 function ilObjWikiGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output =
true)
32 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
33 $lng->loadLanguageModule(
"wiki");
35 if (
$_GET[
"page"] !=
"")
45 $next_class = $this->ctrl->getNextClass($this);
46 $cmd = $this->ctrl->getCmd();
52 if(
$cmd ==
"printView" ||
$cmd ==
"pdfExport")
59 case "ilinfoscreengui":
65 case 'ilpermissiongui':
67 $ilTabs->activateTab(
"perm_settings");
68 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
70 $ret =& $this->ctrl->forwardCommand($perm_gui);
75 include_once(
"./Modules/Wiki/classes/class.ilWikiPageGUI.php");
78 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
80 $this->object->getStyleSheetId(),
"wiki"));
82 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
83 (!$ilAccess->checkAccess(
"edit_content",
"", $this->object->getRefId()) ||
84 $wpage_gui->getPageObject()->getBlocked()
87 $wpage_gui->setEnableEditing(
false);
94 $ret = $this->ctrl->forwardCommand($wpage_gui);
97 $tpl->setContent(
$ret);
101 case 'ilpublicuserprofilegui':
102 require_once
'./Services/User/classes/class.ilPublicUserProfileGUI.php';
104 $ret = $this->ctrl->forwardCommand($profile_gui);
105 $tpl->setContent(
$ret);
108 case "ilobjstylesheetgui":
109 include_once (
"./Services/Style/classes/class.ilObjStyleSheetGUI.php");
110 $this->ctrl->setReturn($this,
"editStyleProperties");
111 $style_gui =
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
113 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
115 $style_gui->setCreationMode(
true);
118 if (
$cmd ==
"confirmedDelete")
120 $this->
object->setStyleSheetId(0);
121 $this->
object->update();
124 $ret = $this->ctrl->forwardCommand($style_gui);
126 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
129 $this->
object->setStyleSheetId($style_id);
130 $this->
object->update();
131 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
138 $ilTabs->activateTab(
"export");
139 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
141 $exp_gui->addFormat(
"xml");
142 $exp_gui->addFormat(
"html",
"", $this,
"exportHTML");
143 $ret = $this->ctrl->forwardCommand($exp_gui);
147 case "ilcommonactiondispatchergui":
148 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
150 $this->ctrl->forwardCommand($gui);
157 $ilTabs->activateTab(
"settings");
159 include_once(
"Services/Rating/classes/class.ilRatingGUI.php");
161 $gui->setObject($this->object->getId(), $this->
object->getType());
162 $gui->setExportCallback(array($this,
"getSubObjectTitle"), $this->lng->txt(
"page"));
163 $this->ctrl->forwardCommand($gui);
166 case "ilwikistatgui":
170 $ilTabs->activateTab(
"statistics");
172 include_once
"Modules/Wiki/classes/class.ilWikiStatGUI.php";
174 $this->ctrl->forwardCommand($gui);
177 case "ilwikipagetemplategui":
179 $ilTabs->activateTab(
"settings");
181 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplateGUI.php");
183 $this->ctrl->forwardCommand($wptgui);
193 if (
$cmd !=
"infoScreenObject")
215 if (is_object($this->
object))
236 $forms = array(self::CFORM_NEW => $this->form_gui,
252 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
256 if ($this->form_gui->checkInput())
260 $short_item = $this->form_gui->getItemByPostVar(
"shorttitle");
261 $short_item->setAlert($lng->txt(
"wiki_short_title_already_in_use"));
266 $_POST[
"title"] = $this->form_gui->getInput(
"title");
267 $_POST[
"desc"] = $this->form_gui->getInput(
"description");
272 $this->form_gui->setValuesByPost();
273 $tpl->setContent($this->form_gui->getHtml());
284 $newObj->setTitle($this->form_gui->getInput(
"title"));
285 $newObj->setDescription($this->form_gui->getInput(
"description"));
286 $newObj->setIntroduction($this->form_gui->getInput(
"intro"));
287 $newObj->setStartPage($this->form_gui->getInput(
"startpage"));
288 $newObj->setShortTitle($this->form_gui->getInput(
"shorttitle"));
289 $newObj->setRating($this->form_gui->getInput(
"rating"));
291 $newObj->setRatingForNewPages($this->form_gui->getInput(
"rating_new"));
292 $newObj->setRatingCategories($this->form_gui->getInput(
"rating_ext"));
294 $newObj->setRatingOverall($this->form_gui->getInput(
"rating_overall"));
295 $newObj->setPageToc($this->form_gui->getInput(
"page_toc"));
299 if (!$ilSetting->get(
"disable_comments"))
301 $newObj->setPublicNotes($this->form_gui->getInput(
"public_notes"));
303 $newObj->setOnline($this->form_gui->getInput(
"online"));
319 $this->ctrl->setCmd(
"showSummary");
320 $this->ctrl->setCmdClass(
"ilinfoscreengui");
331 $ilTabs->activateTab(
"info_short");
333 if (!$ilAccess->checkAccess(
"visible",
"", $this->object->getRefId()))
335 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
338 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
340 $info->enablePrivateNotes();
341 if (trim($this->object->getIntroduction()) !=
"")
343 $info->addSection($lng->txt(
"wiki_introduction"));
344 $info->addProperty(
"", nl2br($this->object->getIntroduction()));
348 include_once(
"./Modules/Wiki/classes/class.ilWikiContributor.php");
349 include_once(
"./Services/Tracking/classes/class.ilLPMarks.php");
355 $info->addSection($this->lng->txt(
"wiki_feedback_from_tutor"));
356 if ($lpcomment !=
"")
358 $info->addProperty($this->lng->txt(
"wiki_comment"),
363 $info->addProperty($this->lng->txt(
"wiki_mark"),
369 $info->addProperty($this->lng->txt(
"status"),
370 $this->lng->txt(
"wiki_passed"));
374 $info->addProperty($this->lng->txt(
"status"),
375 $this->lng->txt(
"wiki_failed"));
387 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
393 $this->lng->loadLanguageModule(
"meta");
394 $this->lng->loadLanguageModule(
"wiki");
401 $this->ctrl->forwardCommand($info);
403 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
426 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
427 $ilCtrl->setParameter($this,
"wpg_id",
430 $ilTabs->addTarget(
"wiki_what_links_here",
431 $this->ctrl->getLinkTargetByClass(
"ilwikipagegui",
432 "whatLinksHere"),
"whatLinksHere");
433 $ilTabs->addTarget(
"wiki_print_view",
434 $this->ctrl->getLinkTargetByClass(
"ilwikipagegui",
435 "printViewSelection"),
"printViewSelection");
445 $ilTabs->activateTab(
"wiki_pages");
447 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
448 $ilCtrl->setParameter($this,
"wpg_id",
452 $ilTabs->addSubTabTarget(
"wiki_all_pages",
453 $this->ctrl->getLinkTarget($this,
"allPages"),
"allPages");
454 $ilTabs->addSubTabTarget(
"wiki_recent_changes",
455 $this->ctrl->getLinkTarget($this,
"recentChanges"),
"recentChanges");
456 $ilTabs->addSubTabTarget(
"wiki_new_pages",
457 $this->ctrl->getLinkTarget($this,
"newPages"),
"newPages");
458 $ilTabs->addSubTabTarget(
"wiki_popular_pages",
459 $this->ctrl->getLinkTarget($this,
"popularPages"),
"popularPages");
460 $ilTabs->addSubTabTarget(
"wiki_orphaned_pages",
461 $this->ctrl->getLinkTarget($this,
"orphanedPages"),
"orphanedPages");
473 $ilHelp->setScreenIdComponent(
"wiki");
477 if (in_array($ilCtrl->getCmdClass(), array(
"",
"ilobjwikigui",
478 "ilinfoscreengui",
"ilpermissiongui",
"ilexportgui",
"ilratingcategorygui",
479 "ilwikistatgui",
"ilwikipagetemplategui"
482 if (
$_GET[
"page"] !=
"")
484 $tabs_gui->setBackTarget($lng->txt(
"wiki_last_visited_page"),
490 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId()))
492 $ilTabs->addTab(
"wiki_pages",
493 $lng->txt(
"wiki_pages"),
494 $this->ctrl->getLinkTarget($this,
"allPages"));
498 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId()))
500 $ilTabs->addTab(
"info_short",
501 $lng->txt(
"info_short"),
502 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
506 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId()))
508 $ilTabs->addTab(
"settings",
509 $lng->txt(
"settings"),
510 $this->ctrl->getLinkTarget($this,
"editSettings"));
514 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId()))
516 $ilTabs->addTab(
"wiki_contributors",
517 $lng->txt(
"wiki_contributors"),
518 $this->ctrl->getLinkTarget($this,
"listContributors"));
522 if ($ilAccess->checkAccess(
'statistics_read',
"", $this->object->getRefId()))
524 $ilTabs->addTab(
"statistics",
525 $lng->txt(
"statistics"),
526 $this->ctrl->getLinkTargetByClass(
"ilWikiStatGUI",
"initial"));
529 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
531 $ilTabs->addTab(
"export",
533 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
537 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId()))
539 $ilTabs->addTab(
"perm_settings",
540 $lng->txt(
"perm_settings"),
541 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm"));
553 if (in_array($a_active,
554 array(
"general_settings",
"style",
"imp_pages",
"rating_categories",
558 $ilTabs->addSubTab(
"general_settings",
559 $lng->txt(
"wiki_general_settings"),
560 $ilCtrl->getLinkTarget($this,
'editSettings'));
563 $ilTabs->addSubTab(
"style",
564 $lng->txt(
"wiki_style"),
565 $ilCtrl->getLinkTarget($this,
'editStyleProperties'));
568 $ilTabs->addSubTab(
"imp_pages",
569 $lng->txt(
"wiki_navigation"),
570 $ilCtrl->getLinkTarget($this,
'editImportantPages'));
573 $ilTabs->addSubTab(
"page_templates",
574 $lng->txt(
"wiki_page_templates"),
575 $ilCtrl->getLinkTargetByClass(
"ilwikipagetemplategui",
""));
578 if($this->object->getRating() && $this->
object->getRatingCategories())
580 $lng->loadLanguageModule(
"rating");
581 $ilTabs->addSubTab(
"rating_categories",
582 $lng->txt(
"rating_categories"),
583 $ilCtrl->getLinkTargetByClass(array(
'ilratinggui',
'ilratingcategorygui'),
''));
586 $ilTabs->activateSubTab($a_active);
605 include_once
'Modules/Wiki/classes/class.ilECSWikiSettings.php';
607 $ecs->addSettingsToForm($this->form_gui,
'wiki');
609 $tpl->setContent($this->form_gui->getHtml());
620 $lng->loadLanguageModule(
"wiki");
621 $ilTabs->activateTab(
"settings");
623 include(
"Services/Form/classes/class.ilPropertyFormGUI.php");
629 $this->form_gui->addItem($tit);
647 $this->form_gui->addItem($des);
653 $this->form_gui->addItem($intro);
656 if ($a_mode ==
"edit")
659 foreach ($pages as $p)
665 $this->form_gui->addItem(
$si);
669 $sp =
new ilTextInputGUI($lng->txt(
"wiki_start_page"),
"startpage");
670 if ($a_mode ==
"edit")
672 $sp->
setInfo($lng->txt(
"wiki_start_page_info"));
674 $sp->setMaxLength(200);
675 $sp->setRequired(
true);
676 $this->form_gui->addItem($sp);
681 $this->form_gui->addItem($online);
686 $lng->loadLanguageModule(
'rating');
687 $rate =
new ilCheckboxInputGUI($lng->txt(
'rating_activate_rating'),
'rating_overall');
688 $rate->
setInfo($lng->txt(
'rating_activate_rating_info'));
689 $this->form_gui->addItem($rate);
692 $this->form_gui->addItem($rating);
699 $new =
new ilCheckboxInputGUI($lng->txt(
"wiki_activate_new_page_rating"),
"rating_new");
702 $extended =
new ilCheckboxInputGUI($lng->txt(
"wiki_activate_extended_rating"),
"rating_ext");
707 if (!$ilSetting->get(
"disable_comments"))
709 $comments =
new ilCheckboxInputGUI($lng->txt(
"wiki_public_comments"),
"public_notes");
710 $this->form_gui->addItem($comments);
719 $page_toc->
setInfo($lng->txt(
"wiki_page_toc_info"));
720 $this->form_gui->addItem($page_toc);
722 if($a_mode ==
"edit")
725 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
728 $record_gui->parseRecordSelection($this->lng->txt(
"wiki_add_page_properties"));
735 if ($a_mode !=
"create")
737 $this->form_gui->setTitle($lng->txt(
"wiki_settings"));
738 $this->form_gui->addCommandButton(
"saveSettings", $lng->txt(
"save"));
742 $this->form_gui->setTitle($lng->txt(
"wiki_new"));
743 $this->form_gui->addCommandButton(
"save", $lng->txt(
"wiki_add"));
744 $this->form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
748 if ($a_mode ==
"create")
750 $ilCtrl->setParameter($this,
"new_type",
"wiki");
753 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveSettings"));
761 if ($a_mode ==
"create")
764 $values[
"rating_new"] =
true;
768 $this->form_gui->setValuesByArray($values);
772 $values[
"online"] = $this->
object->getOnline();
773 $values[
"title"] = $this->
object->getTitle();
776 $values[
"shorttitle"] = $this->
object->getShortTitle();
777 $values[
"description"] = $this->
object->getLongDescription();
778 $values[
"rating_overall"] = $this->
object->getRatingOverall();
779 $values[
"rating"] = $this->
object->getRating();
781 $values[
"rating_new"] = $this->
object->getRatingForNewPages();
782 $values[
"rating_ext"] = $this->
object->getRatingCategories();
783 $values[
"public_notes"] = $this->
object->getPublicNotes();
784 $values[
"intro"] = $this->
object->getIntroduction();
786 $values[
"page_toc"] = $this->
object->getPageToc();
789 $this->form_gui->setValuesByArray($values,
true);
805 if ($this->form_gui->checkInput())
808 $this->form_gui->getInput(
"shorttitle") != $this->
object->getShortTitle())
810 $short_item = $this->form_gui->getItemByPostVar(
"shorttitle");
811 $short_item->setAlert($lng->txt(
"wiki_short_title_already_in_use"));
815 $this->
object->setTitle($this->form_gui->getInput(
"title"));
816 $this->
object->setDescription($this->form_gui->getInput(
"description"));
817 $this->
object->setOnline($this->form_gui->getInput(
"online"));
819 $this->
object->setShortTitle($this->form_gui->getInput(
"shorttitle"));
820 $this->
object->setRatingOverall($this->form_gui->getInput(
"rating_overall"));
821 $this->
object->setRating($this->form_gui->getInput(
"rating"));
823 $this->
object->setRatingForNewPages($this->form_gui->getInput(
"rating_new"));
824 $this->
object->setRatingCategories($this->form_gui->getInput(
"rating_ext"));
826 if (!$ilSetting->get(
"disable_comments"))
828 $this->
object->setPublicNotes($this->form_gui->getInput(
"public_notes"));
830 $this->
object->setIntroduction($this->form_gui->getInput(
"intro"));
832 $this->
object->setPageToc($this->form_gui->getInput(
"page_toc"));
833 $this->
object->update();
836 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
841 include_once
'Modules/Wiki/classes/class.ilECSWikiSettings.php';
843 if($ecs->handleSettingsUpdate())
846 $ilCtrl->redirect($this,
"editSettings");
851 $this->form_gui->setValuesByPost();
852 $this->tpl->setContent($this->form_gui->getHTML());
860 global
$tpl, $ilTabs;
863 $ilTabs->activateTab(
"wiki_contributors");
865 include_once(
"./Modules/Wiki/classes/class.ilWikiContributorsTableGUI.php");
868 $this->object->getId());
870 $tpl->setContent($table_gui->getHTML());
884 $users = (is_array(
$_POST[
"user_id"])
888 include_once(
"./Modules/Wiki/classes/class.ilWikiContributor.php");
889 include_once(
"./Services/Tracking/classes/class.ilLPMarks.php");
891 foreach($users as $user_id)
895 $marks_obj =
new ilLPMarks($this->object->getId(),$user_id);
900 if ($marks_obj->getMark() != $new_mark ||
905 $marks_obj->setMark($new_mark);
906 $marks_obj->setComment($new_comment);
907 $marks_obj->update();
917 $ilCtrl->redirect($this,
"listContributors");
925 if (is_object($this->
object))
927 $ilLocator->addItem($this->object->getTitle(),
932 public static function _goto($a_target)
934 global $ilAccess,
$ilErr,
$lng, $ilNavigationHistory;
936 $i = strpos($a_target,
"_");
939 $a_page = substr($a_target, $i+1);
940 $a_target = substr($a_target, 0, $i);
943 if ($a_target ==
"wpage")
945 $a_page_arr = explode(
"_", $a_page);
946 $wpg_id = (int) $a_page_arr[0];
947 $ref_id = (int) $a_page_arr[1];
948 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
958 foreach ($refs as $r)
960 if ($ilAccess->checkAccess(
"read",
"", $r))
968 if ($ilAccess->checkAccess(
"read",
"", $a_target))
970 $_GET[
"cmd"] =
"viewPage";
971 $_GET[
"ref_id"] = $a_target;
972 $_GET[
"page"] = $a_page;
973 $_GET[
"baseClass"] =
"ilwikihandlergui";
974 $_GET[
"cmdClass"] =
"ilobjwikigui";
981 include(
"ilias.php");
984 else if ($ilAccess->checkAccess(
"visible",
"", $a_target))
988 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
995 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
1008 $goto =
"goto.php?target=wiki_".$a_ref_id.
"_".
1023 $ilTabs->clearTargets();
1024 $tpl->setHeaderActionMenu(null);
1026 $page = (
$_GET[
"page"] !=
"")
1028 : $this->object->getStartPage();
1029 $_GET[
"page"] = $page;
1031 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
1034 $page = $this->
object->getStartPage();
1040 $ilCtrl->redirect($this,
"infoScreen");
1047 include_once(
"./Modules/Wiki/classes/class.ilWikiPageGUI.php");
1050 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1052 $this->object->getStyleSheetId(),
"wiki"));
1058 $ilCtrl->setCmdClass(
"ilwikipagegui");
1059 $ilCtrl->setCmd(
"preview");
1060 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
1061 (!$ilAccess->checkAccess(
"edit_content",
"", $this->object->getRefId()) ||
1062 $wpage_gui->getPageObject()->getBlocked()
1065 $wpage_gui->setEnableEditing(
false);
1073 $html = $ilCtrl->forwardCommand($wpage_gui);
1076 $tpl->setContent($html);
1088 include_once(
"./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1096 $tpl->setContent($table_gui->getHTML());
1108 include_once(
"./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1116 $tpl->setContent($table_gui->getHTML());
1128 include_once(
"./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1136 $tpl->setContent($table_gui->getHTML());
1150 $a_page =
$_GET[
"page"];
1153 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
1162 if (!$this->object->getTemplateSelectionOnCreation())
1164 $this->
object->createWikiPage($a_page);
1168 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1174 $ilCtrl->redirect($this,
"showTemplateSelection");
1188 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
1202 include_once(
"./Modules/Wiki/classes/class.ilWikiRecentChangesTableGUI.php");
1207 $this->object->getId());
1210 $tpl->setContent($table_gui->getHTML());
1229 if ($a_wpg_id > 0 && !$a_wp)
1231 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
1236 include_once(
"./Modules/Wiki/classes/class.ilWikiSearchBlockGUI.php");
1238 $rcontent = $wiki_search_block->getHTML();
1254 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
1256 $rgui->setObject($wiki_id,
"wiki", $a_wpg_id,
"wpg");
1258 $rgui->setYourRatingText(
"#");
1259 $rcontent .= $rgui->getBlockHTML($lng->txt(
"wiki_rate_page"));
1263 include_once(
"./Modules/Wiki/classes/class.ilWikiAdvMetaDataBlockGUI.php");
1267 foreach($rec_ids as $record)
1270 $advmd_pages_block->setObject($a_wiki_ref_id, $wiki_id, $a_wpg_id);
1271 $rcontent.= $advmd_pages_block->getHTML();
1279 include_once(
"./Modules/Wiki/classes/class.ilWikiImportantPagesBlockGUI.php");
1281 $rcontent.= $imp_pages_block->getHTML();
1287 include_once(
"./Modules/Wiki/classes/class.ilWikiFunctionsBlockGUI.php");
1289 $wiki_functions_block->setPageObject($a_wp);
1290 $rcontent .= $wiki_functions_block->getHTML();
1293 $tpl->setRightContent($rcontent);
1305 include_once(
"./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1313 $tpl->setContent($table_gui->getHTML());
1319 if(is_array(
$_POST[
"wordr"]))
1322 $page_ids = array_keys(
$_POST[
"wordr"]);
1325 else if((
int)
$_GET[
"wpg_id"])
1327 $page_ids = array((
int)$_GET[
"wpg_id"]);
1340 $this->ctrl->redirect($this,
"");
1343 $tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
1348 $tpl->setCurrentBlock(
"SyntaxStyle");
1349 $tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
1351 $tpl->parseCurrentBlock();
1356 include_once(
"./Modules/Wiki/classes/class.ilWikiPageGUI.php");
1360 foreach ($page_ids as $p_id)
1363 $page_gui->setOutputMode(
"print");
1364 $page_content.= $page_gui->showPage();
1368 $page_content .=
'<p style="page-break-after:always;"></p>';
1372 $page_content =
'<div class="ilInvisibleBorder">'.$page_content.
'</div>';
1376 $page_content .=
'<script type="text/javascript" language="javascript1.2">
1378 il.Util.addOnLoad(function () {
1385 $tpl->setVariable(
"CONTENT", $page_content);
1394 return $tpl->get(
"DEFAULT",
false,
false,
false,
true,
false,
false);
1403 $html = preg_replace(
"/\?dummy\=[0-9]+/",
"", $html);
1404 $html = preg_replace(
"/\?vers\=[0-9A-Za-z\-]+/",
"", $html);
1406 include_once
"Services/PDFGeneration/classes/class.ilPDFGeneration.php";
1407 include_once
"Services/PDFGeneration/classes/class.ilPDFGenerationJob.php";
1410 $job->setAutoPageBreak(
true)
1411 ->setMarginLeft(
"10")
1412 ->setMarginRight(
"10")
1413 ->setMarginTop(
"10")
1414 ->setMarginBottom(
"10")
1415 ->setOutputMode(
"D")
1416 ->setFilename(
"wiki.pdf")
1417 ->setCreator(
"ILIAS Wiki")
1418 ->setImageScale(1.25)
1433 include_once(
"./Modules/Wiki/classes/class.ilWikiSearchResultsTableGUI.php");
1435 $ilTabs->setTabActive(
"wiki_search_results");
1437 if (trim(
$_POST[
"search_term"]) ==
"")
1440 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1446 $this->object->getId(), $search_results,
$_POST[
"search_term"]);
1449 $tpl->setContent($table_gui->getHTML());
1468 $ctpl->setCurrentBlock(
"ContentStyle");
1469 $ctpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
1471 $ctpl->parseCurrentBlock();
1481 global $ilTabs,
$tpl;
1486 $tpl->setContent($this->form->getHTML());
1488 $ilTabs->activateTab(
"settings");
1501 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1502 $lng->loadLanguageModule(
"style");
1504 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1507 $fixed_style = $ilSetting->get(
"fixed_content_style_id");
1508 $style_id = $this->
object->getStyleSheetId();
1510 if ($fixed_style > 0)
1514 $this->lng->txt(
"global_fixed").
")");
1515 $this->form->addItem($st);
1522 $st_styles[0] = $this->lng->txt(
"default");
1532 $this->form->addItem($st);
1537 $this->form->addCommandButton(
"editStyle",
1538 $lng->txt(
"style_edit_style"));
1539 $this->form->addCommandButton(
"deleteStyle",
1540 $lng->txt(
"style_delete_style"));
1548 $st_styles,
false,
true);
1549 $style_sel =
new ilSelectInputGUI($lng->txt(
"style_current_style"),
"style_id");
1551 $style_sel->setValue($style_id);
1552 $this->form->addItem($style_sel);
1554 $this->form->addCommandButton(
"saveStyleSettings",
1556 $this->form->addCommandButton(
"createStyle",
1557 $lng->txt(
"sty_create_ind_style"));
1560 $this->form->setTitle($lng->txt(
"wiki_style"));
1561 $this->form->setFormAction($ilCtrl->getFormAction($this));
1571 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"create");
1581 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
1591 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
1601 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1602 if ($ilSetting->get(
"fixed_content_style_id") <= 0 &&
1604 || $this->object->getStyleSheetId() == 0))
1607 $this->
object->update();
1610 $this->ctrl->redirect($this,
"editStyleProperties");
1629 $ipages_ids = array();
1630 foreach ($ipages as $i)
1632 $ipages_ids[] = $i[
"page_id"];
1636 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
1638 $options = array(
"" => $lng->txt(
"please_select"));
1639 foreach ($pages as $p)
1641 if (!in_array($p[
"id"], $ipages_ids))
1646 if (count($options) > 0)
1648 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1650 $si->setOptions($options);
1651 $si->setInfo($lng->txt(
""));
1652 $ilToolbar->addInputItem(
$si);
1653 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1654 $ilToolbar->addFormButton($lng->txt(
"add"),
"addImportantPage");
1658 $ilTabs->activateTab(
"settings");
1661 include_once(
"./Modules/Wiki/classes/class.ilImportantPagesTableGUI.php");
1664 $tpl->setContent($imp_table->getHTML());
1679 if (
$_POST[
"imp_page_id"] > 0)
1681 $this->
object->addImportantPage((
int)
$_POST[
"imp_page_id"]);
1684 $ilCtrl->redirect($this,
"editImportantPages");
1694 if (!is_array(
$_POST[
"imp_page_id"]) || count(
$_POST[
"imp_page_id"]) == 0)
1697 $ilCtrl->redirect($this,
"editImportantPages");
1701 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1703 $cgui->setFormAction($ilCtrl->getFormAction($this));
1704 $cgui->setHeaderText($lng->txt(
"wiki_sure_remove_imp_pages"));
1705 $cgui->setCancel($lng->txt(
"cancel"),
"editImportantPages");
1706 $cgui->setConfirm($lng->txt(
"remove"),
"removeImportantPages");
1708 foreach (
$_POST[
"imp_page_id"] as $i)
1713 $tpl->setContent($cgui->getHTML());
1729 if (is_array(
$_POST[
"imp_page_id"]))
1731 foreach (
$_POST[
"imp_page_id"] as $i)
1733 $this->
object->removeImportantPage((
int) $i);
1737 $ilCtrl->redirect($this,
"editImportantPages");
1749 $this->
object->saveOrderingAndIndentation(
$_POST[
"ord"],
$_POST[
"indent"]);
1751 $ilCtrl->redirect($this,
"editImportantPages");
1763 if (!is_array(
$_POST[
"imp_page_id"]) || count(
$_POST[
"imp_page_id"]) != 1)
1769 $this->
object->removeImportantPage((
int)
$_POST[
"imp_page_id"][0]);
1771 $this->
object->update();
1774 $ilCtrl->redirect($this,
"editImportantPages");
1783 require_once(
"./Modules/Wiki/classes/class.ilWikiHTMLExport.php");
1785 $cont_exp->buildExportFile();
1797 include_once
"Modules/Wiki/classes/class.ilWikiPage.php";
1799 if($page->getWikiId() == $a_wiki_id)
1801 return $page->getTitle();
1814 include_once
"Modules/Wiki/classes/class.ilWikiPage.php";
1827 $ilTabs->clearTargets();
1831 $tpl->setContent($form->getHTML());
1841 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1846 $hi->setValue(
$_GET[
"page"]);
1847 $form->addItem($hi);
1853 if ($this->object->getEmptyPageTemplate())
1856 $radg->addOption($op1);
1859 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1865 $radg->addOption($op);
1868 $form->addItem($radg);
1871 $form->addCommandButton(
"createPageUsingTemplate", $lng->txt(
"wiki_create_page"));
1872 $form->addCommandButton(
"cancelCreationPageUsingTemplate", $lng->txt(
"cancel"));
1874 $form->setTitle($lng->txt(
"wiki_new_page").
": ".
$_GET[
"page"]);
1875 $form->setFormAction($ilCtrl->getFormAction($this));
1888 if ($form->checkInput())
1890 $a_page =
$_POST[
"page"];
1891 $this->
object->createWikiPage($a_page, (
int)
$_POST[
"page_templ"]);
1895 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1898 $ilCtrl->redirect($this,
"");
1902 $form->setValuesByPost();
1903 $tpl->setContent($form->getHtml());
1916 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");