35 protected \ILIAS\Wiki\InternalDomainService
$domain;
36 protected \ILIAS\Wiki\Page\PageManager
$wiki_pm;
39 protected \ILIAS\Notes\Service
$notes;
40 protected \ILIAS\HTTP\Services
$http;
51 int $a_wiki_ref_id = 0,
62 $this->
settings = $domain->settings();
69 $this->
ctrl->saveParameterByClass(self::class,
"wpg_id");
73 $this->wiki_request =
$gui->request();
74 $this->notes =
$DIC->notes();
75 $this->wiki_gui =
$gui;
77 $this->wiki_pm = $this->domain->page()->page($this->
getWikiRefId());
78 $this->exc_domain =
$DIC->exercise()->internal()->domain();
89 $this->wiki_ref_id = $a_ref_id;
119 $next_class = $this->
ctrl->getNextClass($this);
122 ": " . $this->getWikiPage()->getTitle();
126 PageContentProvider::setPermaLink($this->wiki_pm->getPermaLink(
127 $this->getPageObject()->getId(),
128 $this->getPageObject()->getLanguage()
135 switch ($next_class) {
139 $ilTabs->setTabActive(
"pg");
145 $rating_gui->setObject(
151 $rating_gui->setUpdateCallback(array($this,
"updateStatsRating"));
152 $this->
ctrl->forwardCommand($rating_gui);
153 $ilCtrl->redirect($this,
"preview");
156 case "ilcommonactiondispatchergui":
158 if (!is_null(
$gui)) {
159 $gui->enableCommentsSettings(
false);
160 $gui->setRatingCallback(
168 case "ilwikistatgui":
169 if ($ilAccess->checkAccess(
"statistics_read",
"", $this->wiki_ref_id)) {
170 $this->tabs_gui->clearTargets();
180 case 'ilobjectmetadatagui':
182 if (!$ilAccess->checkAccess(
"write",
"", $this->wiki_ref_id)) {
183 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"permission_denied"),
true);
184 $ilCtrl->redirect($this,
"preview");
186 return parent::executeCommand();
188 case "ilpropertyformgui":
191 $ilCtrl->forwardCommand(
$form);
196 if (strtolower($ilCtrl->getNextClass()) ===
"ilpageeditorgui") {
200 if ($this->wiki_request->getNotification() > 0
202 switch ($this->wiki_request->getNotification()) {
220 $ilCtrl->redirect($this,
"preview");
224 return parent::executeCommand();
244 $this->getWikiPage()->
getId(),
251 bool $a_redraw =
false
253 $ilUser = $this->
user;
263 $this->requested_ref_id,
268 $dispatcher->setSubObject(
"wpg", $page_id);
271 $this->
ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
273 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false)
276 $lg = $dispatcher->initHeaderAction();
277 $lg->enableNotes(
true);
284 $this->
lng->txt(
"wiki_rate_overall"),
287 array(
"ilcommonactiondispatchergui",
"ilratinggui"),
295 $this->
ctrl->setParameter($this,
"ntf", 1);
297 $lg->addCustomCommand($this->
ctrl->getLinkTarget($this),
"wiki_notification_deactivate_wiki");
303 $this->
lng->txt(
"wiki_notification_activated")
306 $this->
ctrl->setParameter($this,
"ntf", 2);
307 $lg->addCustomCommand($this->
ctrl->getLinkTarget($this),
"wiki_notification_activate_wiki");
310 $this->
ctrl->setParameter($this,
"ntf", 3);
311 $lg->addCustomCommand($this->
ctrl->getLinkTarget($this),
"wiki_notification_deactivate_page");
316 $this->
lng->txt(
"wiki_page_notification_activated")
319 $this->
ctrl->setParameter($this,
"ntf", 4);
320 $lg->addCustomCommand($this->
ctrl->getLinkTarget($this),
"wiki_notification_activate_page");
325 $this->
lng->txt(
"wiki_notification_deactivated")
329 $this->
ctrl->setParameter($this,
"ntf",
"");
333 $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
336 return $lg->getHeaderAction() .
337 $this->tpl->getOnLoadCodeForAsynch();
344 echo $this->addHeaderAction(
true);
350 $ilCtrl = $this->ctrl;
351 $ilAccess = $this->access;
354 $ilUser = $this->user;
361 if ($this->getPageObject()->getBlocked()) {
362 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"wiki_page_status_blocked"));
365 $this->increaseViewCount();
367 $this->addHeaderAction();
370 if (!in_array($ilCtrl->getNextClass(), [
"ilnotegui",
"ilcommentgui"])) {
371 $this->setSideBlock();
375 "tpl.wiki_page_view_main_column.html",
378 "components/ILIAS/Wiki"
380 $callback = array($this,
"observeNoteAction");
384 $may_delete = (
$ilSetting->get(
"comments_del_tutor",
'1') &&
385 $ilAccess->checkAccess(
"write",
"", $this->requested_ref_id));
386 $wtpl->setVariable(
"NOTES", $this->getNotesHTML(
387 $this->getPageObject(),
398 $this->showEditToolbar();
399 $this->setRenderPageContainer(
true);
400 $wtpl->setVariable(
"PAGE", $this->showPage());
402 $tpl->setLoginTargetPar(
"wiki_" . $this->requested_ref_id . $append);
407 $lng->txt(
"wiki_last_edited") .
": " .
412 $this->getPageObject()->getLastChangeUser(),
415 $ilCtrl->getLinkTarget($this,
"preview")
419 $tpl->setLoginTargetPar(
"wiki_" . $this->requested_ref_id . $append);
422 if ($this->wiki_request->getSearchString()) {
425 $search_string = $cache->getQuery();
428 if (is_array($search_string)) {
429 $search_string = $search_string[
"lom_content"];
435 $words = $p->getQuotedWords();
436 if (is_array($words)) {
437 foreach ($words as $w) {
438 ilTextHighlighterGUI::highlight(
"ilCOPageContent", $w, $tpl);
441 $this->fill_on_load_code =
true;
450 $this->initToolbar();
452 $this->setTemplateOutput(
false);
454 if (!$this->getAbstractOnly()) {
455 $this->setPresentationTitle($this->getWikiPage()->
getTitle());
461 return parent::showPage();
466 $toolbar = $this->toolbar;
468 $this->addLanguageSelectionToToolbar();
470 $print_view = $this->getPrintView();
471 $modal_elements = $print_view->getModalElements($this->
ctrl->getLinkTarget(
475 $toolbar->addComponent($modal_elements->button);
476 $toolbar->addComponent($modal_elements->modal);
481 return $this->getPageObject()->getLanguage();
486 $toolbar = $this->toolbar;
487 $f = $this->wiki_gui->ui()->factory();
489 $this->
ctrl->setParameterByClass(self::class,
"wpg_id", $this->
getId());
490 $this->
ctrl->setParameterByClass(self::class,
"page",
null);
491 if ($this->ot->getContentTranslationActivated()) {
493 foreach ($this->ot->getLanguages() as $language) {
494 $lang_code = ($language->getLanguageCode() === $this->ot->getBaseLanguage())
496 : $language->getLanguageCode();
497 $exists = $this->wiki_pm->exists($this->
getId(), $lang_code);
498 $this->
ctrl->setParameterByClass(self::class,
"transl", $lang_code);
499 $action = ($lang_code !==
"-" && !$exists)
502 if ($action ===
"switchToLanguage") {
503 $this->
ctrl->setParameterByClass(self::class,
"transl",
null);
504 $this->
ctrl->setParameterByClass(self::class,
"totransl", $lang_code);
508 :
" (" . $this->
lng->txt(
"wiki_not_existing") .
")";
509 if ($lang_code === $this->getCurrentLanguage()) {
512 $actions[] =
$f->link()->standard(
513 $this->getLanguageLabelForCode($language->getLanguageCode()) . $append,
514 $this->
ctrl->getLinkTargetByClass(self::class, $action)
517 $this->
ctrl->setParameterByClass(self::class,
"transl", $this->requested_transl);
518 $this->
ctrl->setParameterByClass(self::class,
"totransl",
null);
519 if (count($actions) > 0) {
520 $dd =
$f->dropdown()->standard($actions)
521 ->withLabel($this->getLanguageLabelForCode($this->getCurrentLanguage()));
522 $toolbar->addComponent($dd);
530 $code = $this->ot->getBaseLanguage();
532 return $this->
lng->txt(
"language") .
": " . $this->
lng->txt(
"meta_l_" . $code);
537 $provider = new \ILIAS\Wiki\WikiPrintViewProviderGUI(
540 $this->getWikiPage()->getWikiRefId(),
544 return new \ILIAS\Export\PrintProcessGUI(
554 $ilUser = $this->user;
556 $this->getWikiPage()->increaseViewCnt();
561 $this->getWikiPage()->getWikiRefId(),
562 $this->getWikiPage()->getWikiId(),
571 $ilCtrl = $this->ctrl;
573 $title = $this->getPageObject()->getTitle();
574 $ilCtrl->setParameterByClass(
579 if ($this->getEnabledHref() && $this->getOutputMode() !== self::EDIT) {
582 $this->getWikiPage()->getWikiId(),
583 ($this->getOutputMode() ===
"offline"),
584 $this->getCurrentLanguage()
589 $ilCtrl->setParameterByClass(
592 $this->wiki_request->getFromPage()
597 if ($this->getOutputMode() ===
"print" && $this->wiki instanceof
ilObjWiki) {
599 $md = $mdgui->getKeyValueList();
601 $output = str_replace(
"<!--COPage-PageTop-->",
"<p>" . $md .
"</p>", $output);
617 $this->getWikiPage()->getWikiId(),
620 $this->wiki_request->getTranslation()
623 $tpl->setContent($table_gui->getHTML());
627 string $a_activate =
""
629 $ilTabs = $this->tabs_gui;
630 $ilCtrl = $this->ctrl;
631 $ilAccess = $this->access;
633 parent::getTabs($a_activate);
635 if ($ilAccess->checkAccess(
"statistics_read",
"", $this->requested_ref_id)) {
638 $this->
ctrl->getLinkTargetByClass(
639 array(
"ilwikipagegui",
"ilwikistatgui"),
648 "wiki_what_links_here",
649 $this->
ctrl->getLinkTargetByClass(
660 $ilCtrl = $this->ctrl;
665 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
666 $confirmation_gui->setHeaderText(
$lng->txt(
"wiki_page_deletion_confirmation"));
667 $confirmation_gui->setCancel(
$lng->txt(
"cancel"),
"cancelWikiPageDeletion");
668 $confirmation_gui->setConfirm(
$lng->txt(
"delete"),
"confirmWikiPageDeletion");
671 "tpl.wiki_page_deletion_confirmation.html",
674 "components/ILIAS/Wiki"
677 $dtpl->setVariable(
"PAGE_TITLE", $this->getWikiPage()->
getTitle());
680 $dtpl->setVariable(
"TXT_OTHER_PAGES",
$lng->txt(
"wiki_other_pages_linking"));
682 $this->getWikiPage()->getWikiId(),
683 $this->getWikiPage()->
getId()
685 if (count($pages) > 0) {
686 foreach ($pages as $page) {
687 $dtpl->setCurrentBlock(
"lpage");
688 $dtpl->setVariable(
"TXT_LINKING_PAGE", $page[
"title"]);
689 $dtpl->parseCurrentBlock();
692 $dtpl->setCurrentBlock(
"lpage");
693 $dtpl->setVariable(
"TXT_LINKING_PAGE",
"-");
694 $dtpl->parseCurrentBlock();
698 $dtpl->setVariable(
"TXT_CONTRIBUTORS",
$lng->txt(
"wiki_contributors"));
700 foreach ($contributors as $contributor) {
701 $dtpl->setCurrentBlock(
"contributor");
704 $contributor[
"lastname"] .
", " . $contributor[
"firstname"]
706 $dtpl->parseCurrentBlock();
710 $cnt_note_users = $this->notes->domain()->getUserCount(
711 $this->getPageObject()->getParentId(),
712 $this->getPageObject()->
getId(),
716 "TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
717 $lng->txt(
"wiki_number_users_notes_or_comments")
719 $dtpl->setVariable(
"TXT_NR_NOTES_COMMENTS", $cnt_note_users);
721 $confirmation_gui->addItem(
"",
"", $dtpl->get());
723 $tpl->setContent($confirmation_gui->getHTML());
729 $ilCtrl = $this->ctrl;
731 $ilCtrl->redirect($this,
"preview");
736 $ilCtrl = $this->ctrl;
739 $this->getPageObject()->delete();
741 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"wiki_page_deleted"),
true);
744 $ilCtrl->redirectByClass(
"ilobjwikigui",
"allPages");
753 $view = $this->getPrintView();
759 $this->printViewOrderList();
764 $ilTabs = $this->tabs_gui;
766 $pg_ids = $all_pages = array();
769 $ordering = $this->wiki_request->getPrintOrdering();
770 if (count($ordering) === 0) {
771 switch ($this->wiki_request->getSelectedPrintType()) {
773 foreach ($this->wiki_pm->getWikiPages($this->getLanguage()) as $p) {
774 $pg_ids[] = $p->getId();
779 $pg_ids = $this->wiki_request->getWikiPageIds();
780 if (count($pg_ids) === 0) {
781 $pg_ids = [$this->wiki_request->getWikiPageId()];
783 if (count($pg_ids) > 1) {
786 $wiki_page_id = array_pop($pg_ids);
788 $this->
ctrl->setParameterByClass(
793 $this->
ctrl->redirectByClass(
"ilObjWikiGUI",
"printView");
797 $this->
ctrl->setParameterByClass(
800 $this->wiki_request->getWikiPageId()
802 $this->
ctrl->redirectByClass(
"ilObjWikiGUI",
"printView");
809 $pg_ids = array_keys($ordering);
812 $ilTabs->clearTargets();
813 $ilTabs->setBackTarget(
814 $this->
lng->txt(
"back"),
815 $this->ctrl->getLinkTarget($this,
"preview")
818 if (!count($all_pages)) {
824 "printViewOrderList",
828 $this->tpl->setContent($tbl->getHTML());
838 $ilCtrl = $this->ctrl;
842 $this->getPageObject()->setBlocked(
true);
843 $this->getPageObject()->update();
845 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"wiki_page_blocked"),
true);
848 $ilCtrl->redirect($this,
"preview");
853 $ilCtrl = $this->ctrl;
857 $this->getPageObject()->setBlocked(
false);
858 $this->getPageObject()->update();
860 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"wiki_page_unblocked"),
true);
863 $ilCtrl->redirect($this,
"preview");
873 $ilAccess = $this->access;
876 if (($ilAccess->checkAccess(
879 $this->requested_ref_id
880 ) && !$this->getPageObject()->getBlocked())
881 || $ilAccess->checkAccess(
"write",
"", $this->requested_ref_id)) {
882 $this->
ctrl->setParameterByClass(ilWikiPageGUI::class,
"wpg_id", $this->wiki_request->getWikiPageId());
883 $this->initRenameForm();
884 $tpl->setContent($this->
form->getHTML());
891 $ilCtrl = $this->ctrl;
897 $ti->setMaxLength(200);
899 $ti->setValue($this->getPageObject()->
getTitle());
900 $ti->setRequired(
true);
901 $this->
form->addItem($ti);
903 $this->
form->addCommandButton(
"renamePage",
$lng->txt(
"wiki_rename"));
904 $this->
form->addCommandButton(
"preview",
$lng->txt(
"cancel"));
906 $this->
form->setTitle(
$lng->txt(
"wiki_rename_page"));
907 $this->
form->setFormAction($ilCtrl->getFormAction($this));
914 $ilCtrl = $this->ctrl;
915 $ilAccess = $this->access;
917 $this->initRenameForm();
918 if ($this->
form->checkInput()) {
919 if (($ilAccess->checkAccess(
"edit_content",
"", $this->requested_ref_id) && !$this->getPageObject()->getBlocked())
920 || $ilAccess->checkAccess(
"write",
"", $this->requested_ref_id)) {
921 $new_name = $this->
form->getInput(
"new_page_name");
925 $this->getPageObject()->getWikiId(),
933 if ($pg_id > 0 && $pg_id != $this->getPageObject()->
getId()) {
934 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"wiki_page_already_exists"));
936 $new_name = $this->getPageObject()->rename($new_name);
938 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_obj_modified"),
true);
939 $ilCtrl->redirect($this,
"preview");
944 $this->
form->setValuesByPost();
945 $tpl->setContent($this->
form->getHTML());
955 $ilCtrl = $this->ctrl;
957 $this->getPageObject()->setRating(
true);
958 $this->getPageObject()->update();
960 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_obj_modified"),
true);
961 $ilCtrl->redirect($this,
"preview");
967 $ilCtrl = $this->ctrl;
969 $this->getPageObject()->setRating(
false);
970 $this->getPageObject()->update();
972 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_obj_modified"),
true);
973 $ilCtrl->redirect($this,
"preview");
985 $note = $this->notes->domain()->getById($a_note_id);
986 $text = $note->getText();
988 $noti = $this->wiki_gui->notification();
1008 $ilCtrl = $this->ctrl;
1011 $page = $this->getWikiPage();
1014 $form->setFormAction($ilCtrl->getFormAction($this,
"updateAdvancedMetaData"));
1017 $form->setTitle(
$lng->txt(
"wiki_advmd_block_title") .
": " . $page->getTitle());
1026 $this->record_gui->setPropertyForm($form);
1027 $this->record_gui->parse();
1029 $form->addCommandButton(
"updateAdvancedMetaData",
$lng->txt(
"save"));
1030 $form->addCommandButton(
"preview",
$lng->txt(
"cancel"));
1038 $ilTabs = $this->tabs_gui;
1040 $ilCtrl = $this->ctrl;
1042 $ilAccess = $this->access;
1044 if (!$ilAccess->checkAccess(
"write",
"", $this->wiki_ref_id) &&
1045 !$ilAccess->checkAccess(
"edit_page_meta",
"", $this->wiki_ref_id)) {
1050 $ilTabs->clearTargets();
1051 $ilTabs->setBackTarget(
1053 $ilCtrl->getLinkTarget($this,
"preview")
1057 $a_form = $this->initAdvancedMetaDataForm();
1060 $tpl->setContent($a_form->getHTML());
1065 $ilCtrl = $this->ctrl;
1067 $ilAccess = $this->access;
1069 if (!$ilAccess->checkAccess(
"write",
"", $this->wiki_ref_id) &&
1070 !$ilAccess->checkAccess(
"edit_page_meta",
"", $this->wiki_ref_id)) {
1074 $form = $this->initAdvancedMetaDataForm();
1077 $form->checkInput();
1078 if (!$this->record_gui->importEditFormPostValues()) {
1079 $this->editAdvancedMetaData($form);
1083 if ($this->record_gui->writeEditForm()) {
1084 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"settings_saved"),
true);
1086 $ilCtrl->redirect($this,
"preview");
1091 $ilCtrl = $this->ctrl;
1093 $ilAccess = $this->access;
1095 if (!$ilAccess->checkAccess(
"write",
"", $this->wiki_ref_id) &&
1096 !$ilAccess->checkAccess(
"edit_page_meta",
"", $this->wiki_ref_id)) {
1100 $this->getPageObject()->hideAdvancedMetadata(
true);
1101 $this->getPageObject()->update();
1103 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"settings_saved"),
true);
1104 $ilCtrl->redirect($this,
"preview");
1109 $ilCtrl = $this->ctrl;
1111 $ilAccess = $this->access;
1113 if (!$ilAccess->checkAccess(
"write",
"", $this->wiki_ref_id) &&
1114 !$ilAccess->checkAccess(
"edit_page_meta",
"", $this->wiki_ref_id)) {
1118 $this->getPageObject()->hideAdvancedMetadata(
false);
1119 $this->getPageObject()->update();
1121 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"settings_saved"),
true);
1122 $ilCtrl->redirect($this,
"preview");
1129 $this->
ctrl->setParameterByClass(self::class,
"wpg_id", $this->
getId());
1130 self::initEditingJS($tpl);
1132 return parent::edit();
1142 $a_tpl->
addOnLoadCode(
"il.Wiki.Edit.txt.page_exists = '" .
$lng->txt(
"wiki_page_exists") .
"';");
1143 $a_tpl->
addOnLoadCode(
"il.Wiki.Edit.txt.new_page = '" .
$lng->txt(
"wiki_new_page") .
"';");
1153 $ilCtrl = $this->ctrl;
1156 $form->addCommandButton(
"addWikiLink",
$lng->txt(
"wiki_add_link"));
1157 $form->addCommandButton(
"searchWikiLink",
$lng->txt(
"search"));
1162 $tp->setRequired(
true);
1163 $tp->setInfo(
"...");
1164 $tp->setDataSource($ilCtrl->getLinkTarget($this,
"insertWikiLinkAC",
"",
true));
1165 $form->addItem($tp);
1170 $form->addItem($lt);
1174 echo $form->getHTML();
1185 $term = $this->wiki_request->getTerm();
1189 $entry =
new stdClass();
1190 $entry->value = $term;
1191 $entry->label = $term;
1198 foreach (
$res as $r) {
1199 if ($result[0]->value == $r) {
1205 $entry =
new stdClass();
1211 echo json_encode($result, JSON_THROW_ON_ERROR);
1222 $lng->loadLanguageModule(
"wiki");
1224 $tpl =
new ilTemplate(
"tpl.wiki_ac_search_result.html",
true,
true,
"components/ILIAS/Wiki");
1225 $term = $this->wiki_request->getTerm();
1230 foreach ($pages as $page) {
1239 foreach ($found as
$f) {
1240 $tpl->setCurrentBlock(
"item");
1241 $tpl->setVariable(
"WIKI_TITLE",
$f[
"title"]);
1242 $tpl->parseCurrentBlock();
1245 if (count($pages) === 0) {
1246 $tpl->setVariable(
"INFOTEXT", str_replace(
"$1", $term,
$lng->txt(
"wiki_no_page_found")));
1247 } elseif ($term ===
'') {
1248 $tpl->setVariable(
"INFOTEXT",
$lng->txt(
"wiki_no_search_term"));
1250 $tpl->setVariable(
"INFOTEXT", str_replace(
"$1", $term,
$lng->txt(
"wiki_pages_found")));
1253 $tpl->setVariable(
"TXT_BACK",
$lng->txt(
"back"));
1267 $ilCtrl = $this->ctrl;
1272 $ass_id = $this->wiki_request->getAssignmentId();
1273 $wiki_ass->submitWiki(
$ass_id, $this->
user->getId(), $this->getWikiRefId());
1275 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"wiki_finalized"),
true);
1276 $ilCtrl->redirectByClass(
"ilObjWikiGUI",
"gotoStartPage");
1281 $ilUser = $this->user;
1283 $ass_id = $this->wiki_request->getAssignmentId();
1286 $sub_manager = $this->exc_domain->submission(
$ass_id);
1287 $sub = $sub_manager->getSubmissionsOfUser($ilUser->getId())->current();
1288 $team_id = $this->exc_domain->team()->getTeamForMember(
1296 $ass->getTitle() .
" (Team " . $team_id .
").zip";
1298 $sub_manager->deliverFile(
1308 return $this->getNotesHTML(
1309 $this->getPageObject(),
1323 $this->tabs_gui->clearTargets();
1324 $this->tabs_gui->setBackTarget(
1325 $this->
lng->txt(
"back"),
1326 $this->ctrl->getLinkTarget($this,
"edit")
1329 $l = $this->request->getString(
"totransl");
1330 $this->
ctrl->setParameter($this,
"totransl", $l);
1331 $this->
lng->loadLanguageModule(
"meta");
1333 $r = $this->wiki_gui->ui()->renderer();
1334 $box = $this->wiki_gui->ui()->factory()->messageBox()->confirmation(
1335 $this->
lng->txt(
"cont_page_translation_does_not_exist") .
": " .
1336 $this->lng->txt(
"meta_l_" . $l)
1339 $form = $this->getTranslatePageFormAdapter();
1341 $content = $r->render($box) . $form->render();
1350 $this->tpl->setContent($content);
1355 $f = $this->wiki_gui->form(self::class,
"createPageTranslation")
1356 ->text(
"title", $this->
lng->txt(
"title"));
1361 public function createPageTranslation(): void
1363 $l = $this->request->getString(
"totransl");
1365 $form = $this->getTranslatePageFormAdapter();
1368 $p = $this->domain->page()->getWikiPage(
1369 $this->getWikiRefId(),
1370 $this->getPageObject()->
getId(),
1375 $p->copyPageToTranslation($l);
1379 $this->getPageObject()->getParentType(),
1380 $this->getPageObject()->
getId(),
1384 $p2->setWikiRefId($this->getWikiRefId());
1385 $p2->setTitle($form->getData(
"title"));
1387 $this->
ctrl->setParameter($this,
"transl", $l);
1390 $this->
ctrl->redirect($this,
"edit");
1395 return $this->wiki_pm->exists(
$id,
$lang);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Class handles translation mode for an object.
const IL_WIKI_WHAT_LINKS_HERE
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
Class ilCommonActionDispatcherGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
setScreenIdComponent(string $a_comp)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static hasOptOut(int $obj_id)
Is opt out (disable notification) allowed?
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
static hasNotification(int $type, int $user_id, int $id)
Check notification status for object and user.
static getSyntaxStylePath()
static _lookupName(int $a_user_id)
static renderSideBlock(int $a_wpg_id, int $a_wiki_ref_id, ?ilWikiPage $a_wp=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _performSearch(int $a_wiki_id, string $a_searchterm)
Search in Wiki.
static _lookupPublicNotes(int $a_wiki_id)
Lookup whether public notes are activated.
static _lookupRatingOverall(int $a_wiki_id)
Lookup whether rating is activated for whole object.
static prepareJsLinks(string $redraw_url, string $notes_url, string $tags_url, ?ilGlobalTemplateInterface $tpl=null)
Insert js/ajax links into template.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
Get page object instance.
setPresentationTitle(string $a_title="")
ilGlobalTemplateInterface $tpl
ILIAS COPage InternalGUIService $gui
setPageObject(ilPageObject $a_pg_obj)
__construct(string $a_parent_type, int $a_id, int $a_old_nr=0, bool $a_prevent_get_id=false, string $a_lang="", string $concrete_lang="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static _getInstance(int $a_usr_id)
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilWikiPage GUI class.
editAdvancedMetaData(?ilPropertyFormGUI $a_form=null)
initAdvancedMetaDataForm()
deactivateWikiPageRating()
static initEditingJS(ilGlobalTemplateInterface $a_tpl)
updateStatsRating(int $a_wiki_id, string $a_wiki_type, int $a_page_id, string $a_page_type)
confirmWikiPageDeletion()
activateWikiPageRating()
Rating /.
getTranslatePageFormAdapter()
setWikiPage(ilWikiPage $a_wikipage)
getTabs(string $a_activate="")
showPage()
display content of page
ILIAS HTTP Services $http
setWikiRefId(int $a_ref_id)
addLanguageSelectionToToolbar()
deleteWikiPageConfirmationScreen()
ILIAS Wiki WikiGUIRequest $wiki_request
insertWikiLink()
Returns form to insert a wiki link per ajax.
ilAdvancedMDRecordGUI $record_gui
addHeaderAction(bool $a_redraw=false)
checkLangPageAvailable(int $id, string $lang)
finalizeAssignment()
Finalize and submit blog to exercise.
observeNoteAction(int $a_wiki_id, int $a_page_id, string $a_type, string $a_action, int $a_note_id)
insertWikiLinkAC()
Auto complete for insert wiki link.
searchWikiLinkAC()
Search wiki link list.
ILIAS Wiki InternalDomainService $domain
ILIAS Notes Service $notes
ILIAS Exercise InternalDomainService $exc_domain
confirmPageTranslationCreation()
Confirm page translation creation.
ILIAS Wiki Page PageManager $wiki_pm
postOutputProcessing(string $a_output)
Finalizing output processing.
getLanguageLabelForCode(string $code)
setWiki(ilObjWiki $a_val)
ILIAS Wiki InternalGUIService $wiki_gui
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getPagesForSearch(int $a_wiki_id, string $a_term)
static getPageIdForTitle(int $a_wiki_id, string $a_title, string $lang="-")
Get wiki page object for id and title.
static getWikiPageContributors(int $a_page_id)
static getLinksToPage(int $a_wiki_id, int $a_page_id, string $lang="-")
static lookupTitle(int $a_page_id, string $lang="-")
static _wikiPageExists(int $a_wiki_id, string $a_title, string $lang="-")
static getAllWikiPages(int $a_wiki_id, string $lang="-")
TableGUI class for wiki pages table.
static check(string $a_perm, int $a_ref_id, string $a_cmd="")
Wiki statistics GUI class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static handleEvent(int $a_event, ilWikiPage $a_page_obj, ?int $a_user_id=null, ?array $a_additional_data=null)
Handle wiki page event.
static makeUrlTitle(string $a_par)
static replaceInternalLinks(string $s, int $a_wiki_id, bool $a_offline=false, string $lang="-")
This one is based on Mediawiki Parser->replaceInternalLinks since we display images in another way,...
static makeDbTitle(string $a_par)
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
setHeaderPageTitle(string $a_title)
Sets the title of the page (for browser window).
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
form( $class_path, string $cmd, string $submit_caption="")
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.