37 public const EDIT =
"edit";
41 protected \ILIAS\TestQuestionPool\Questions\PublicInterface
$questioninfo;
42 protected \ILIAS\COPage\Page\PageManager
$pm;
43 protected \ILIAS\COPage\Link\LinkManager
$link;
44 protected \ILIAS\COPage\InternalGUIService
$gui;
46 protected \ILIAS\COPage\Xsl\XslManager
$xsl;
48 protected \ILIAS\Notes\Service
$notes;
114 protected \ILIAS\DI\UIServices
$ui;
143 protected \ILIAS\COPage\Compare\PageCompare
$compare;
153 string $a_parent_type,
156 bool $a_prevent_get_id =
false,
163 $this->tpl =
$DIC->ui()->mainTemplate();
164 $this->
ctrl = $DIC->ctrl();
165 $this->
lng = $DIC->language();
166 $this->tabs_gui =
$DIC->tabs();
167 $this->
access = $DIC->access();
168 $this->
user = $DIC->user();
169 $this->
help = $DIC[
"ilHelp"];
170 $this->
ui = $DIC->ui();
171 $this->
toolbar = $DIC->toolbar();
172 $this->component_factory =
$DIC[
"component.factory"];
174 $this->request =
$DIC
181 $this->questioninfo =
$DIC->testQuestion();
183 $this->requested_old_nr = $this->request->getInt(
"old_nr");
184 $this->requested_transl = $this->request->getString(
"transl");
185 $this->requested_file_id = $this->request->getString(
"file_id");
186 $this->requested_ref_id = $this->request->getInt(
"ref_id");
187 $this->requested_pg_id = $this->request->getInt(
"pg_id");
192 if ($a_old_nr == 0 && !$a_prevent_get_id && $this->requested_old_nr > 0) {
197 if ($a_lang ==
"" && $this->requested_transl !=
'') {
212 $this->page_linker =
new ilPageLinker(get_class($this));
214 $this->output2template =
true;
216 $this->template_output_var =
"PAGE_CONTENT";
217 $this->page_back_title = $this->
lng->txt(
"page");
218 $this->
lng->loadLanguageModule(
"content");
219 $this->
lng->loadLanguageModule(
"copg");
221 $this->tool_context =
$DIC->globalScreen()->tool()->context();
225 $this->
ctrl->saveParameter($this,
"transl");
228 $this->requested_user_id = $this->request->getInt(
"user");
229 $this->requested_q_id = $this->request->getInt(
"q_id");
230 $this->requested_history_mode = $this->request->getInt(
"history_mode");
236 $this->edit_repo = $int_service
241 $this->xsl = $int_service->domain()->xsl();
242 $this->compare = $int_service->domain()->compare();
243 $this->pc_definition =
$DIC
249 $this->gui =
$DIC->copage()->internal()->gui();
250 $this->
link = $DIC->copage()->internal()->domain()->link();
251 $this->pm =
$DIC->copage()->internal()->domain()->page();
252 $this->editor_gui =
$DIC->copage()->internal()->gui()->edit();
253 $this->notes =
$DIC->notes();
258 $this->tpl = $main_tpl;
272 string $a_adv_subtype =
"-"
274 $this->adv_ref_id = $a_adv_ref_id;
275 $this->adv_type = $a_adv_type;
276 $this->adv_subtype = $a_adv_subtype;
284 if ($this->adv_type ===
null) {
287 return [$this->adv_ref_id, $this->adv_type, $this->adv_subtype];
296 $this->getParentType(),
301 $page->setConcreteLang($this->concrete_lang);
302 $this->setPageObject($page);
307 $this->parent_type = $a_val;
312 return $this->parent_type;
315 public function setId(
int $a_val): void
330 $this->old_nr = $a_val;
335 return $this->old_nr;
349 return $this->language;
356 $this->getPageConfig()->setEnablePCType($a_pc_type, $a_val);
361 return $this->getPageConfig()->getEnablePCType($a_pc_type);
366 $this->page_config = $a_val;
371 return $this->page_config;
376 $this->obj = $a_pg_obj;
388 string $a_mode = self::PRESENTATION
390 $this->output_mode = $a_mode;
395 return $this->output_mode;
400 $this->output2template = $a_output;
405 return $this->output2template;
410 $this->presentation_title = $a_title;
415 return $this->presentation_title;
425 return $this->header;
430 $this->link_params = $l_params;
435 return $this->link_params;
440 $this->link_frame = $l_frame;
445 return $this->link_frame;
450 $this->page_linker = $page_linker;
455 return $this->link_xml;
460 $this->getPageConfig()->setQuestionHTML($question_html);
465 return $this->getPageConfig()->getQuestionHTML();
470 $this->target_var = $a_variable;
475 return $this->target_var;
480 return $this->template_output_var;
485 $this->sourcecode_download_script = $script_name;
490 return $this->sourcecode_download_script;
495 $this->tabs_gui = $a_tabs;
500 $this->page_back_title = $a_title;
505 $this->file_download_link = $a_download_link;
510 return $this->file_download_link;
515 $this->fullscreen_link = $a_fullscreen_link;
520 return $this->fullscreen_link;
525 $this->int_link_return = $a_return;
528 public function enableNotes(
bool $a_enabled,
int $a_parent_id): void
530 $this->notes_enabled = $a_enabled;
531 $this->notes_parent_id = $a_parent_id;
536 return $this->notes_enabled;
544 $this->offline_directory = $offdir;
549 return $this->offline_directory;
558 $this->view_page_link = $a_link;
559 $this->view_page_target = $a_target;
564 return $this->view_page_link;
569 return $this->view_page_target;
574 return $this->
lng->txt(
"cont_presentation_view");
581 $this->act_obj = $a_obj;
582 $this->act_meth = $a_meth;
587 int $a_news_obj_id = 0,
588 string $a_news_obj_type =
""
590 $this->enabled_news = $a_enabled;
591 $this->news_obj_id = $a_news_obj_id;
592 $this->news_obj_type = $a_news_obj_type;
597 return $this->enabled_news;
604 $this->tab_hook = array(
"obj" => $a_object,
"func" => $a_function);
613 $this->editpreview = $a_editpreview;
618 return $this->editpreview;
623 $this->tabs_enabled = $a_enabledtabs;
628 return $this->tabs_enabled;
633 $this->enabledpagefocus = $a_enabledpagefocus;
638 $this->open_place_holder = $a_val;
643 return $this->open_place_holder;
648 return $this->enabledpagefocus;
653 $this->prependinghtml = $a_prependinghtml;
658 return $this->prependinghtml;
663 $this->enableediting = $a_enableediting;
668 return $this->enableediting;
676 $this->rawpagecontent = $a_rawpagecontent;
681 return $this->rawpagecontent;
686 $this->styleid = $a_styleid;
691 return $this->styleid;
696 $this->compare_mode = $a_val;
701 return $this->compare_mode;
711 $this->abstract_only = $a_val;
712 $this->abstract_pcid = $pcid;
717 return $this->abstract_only;
722 $this->render_page_container = $a_val;
727 return $this->render_page_container;
732 return $this->
lng->txt(
"inactive");
737 return $this->enabled_href;
742 $this->enabled_href = $enable;
757 ?
object $a_observer_obj =
null,
758 string $a_observer_func =
""
760 $this->use_meta_data =
true;
761 $this->meta_data_rep_obj = $a_rep_obj;
762 $this->meta_data_sub_obj_id = $a_sub_obj_id;
763 $this->meta_data_type = $a_type;
764 $this->meta_data_observer_obj = $a_observer_obj;
765 $this->meta_data_observer_func = $a_observer_func;
770 $file_download_link = $this->getFileDownloadLink();
771 if ($this->getFileDownloadLink() ==
"" && $this->getOutputMode() !=
"offline") {
772 $file_download_link = $this->
ctrl->getLinkTarget($this,
"downloadFile");
774 return $file_download_link;
779 $fullscreen_link = $this->getFullscreenLink();
780 if ($this->getFullscreenLink() ==
"" && $this->getOutputMode() !=
"offline") {
781 $fullscreen_link = $this->
ctrl->getLinkTarget($this,
"displayMediaFullscreen",
"",
false,
false);
783 return $fullscreen_link;
788 $l = $this->sourcecode_download_script;
789 if ($this->sourcecode_download_script ==
"" && $this->getOutputMode() !=
"offline") {
790 $l = $this->
ctrl->getLinkTarget($this,
"");
801 if ($this->getOutputMode() ==
"edit") {
802 foreach ($this->component_factory->getActivePluginsInSlot(
"pgcp") as
$plugin) {
803 if (
$plugin->isValidParentType($this->getPageObject()->getParentType())) {
804 $xml .=
'<ComponentPlugin Name="' .
$plugin->getPluginName() .
810 $xml =
"<ComponentPlugins>" . $xml .
"</ComponentPlugins>";
822 $next_class = $this->
ctrl->getNextClass($this);
823 if ($next_class !==
"") {
824 $this->
ctrl->setReturn($this,
"edit");
826 $this->log->debug(
"next_class: " . $next_class);
827 if ($next_class ==
"" && $this->
ctrl->getCmd() ==
"edit") {
828 $this->tabs_gui->clearTargets();
834 switch ($next_class) {
835 case 'ilobjectmetadatagui':
836 $this->setBackToEditTabs();
837 $md_gui =
new ilObjectMetaDataGUI($this->meta_data_rep_obj, $this->meta_data_type, $this->meta_data_sub_obj_id);
838 if (is_object($this->meta_data_observer_obj)) {
839 $md_gui->addMDObserver(
840 $this->meta_data_observer_obj,
841 $this->meta_data_observer_func,
846 if ($this->adv_type !=
"") {
847 $md_gui->setAdvMdRecordObject($this->adv_ref_id, $this->adv_type, $this->adv_subtype);
849 $this->
ctrl->forwardCommand($md_gui);
852 case "ileditclipboardgui":
853 $this->setBackToEditTabs();
855 $clip_gui->setPageBackTitle($this->page_back_title);
856 $ret = $this->
ctrl->forwardCommand($clip_gui);
862 $html = $this->edit();
863 $this->tabs_gui->setTabActive(
"edit");
866 case strtolower(PublicProfileGUI::class):
868 $ret = $this->
ctrl->forwardCommand($profile_gui);
871 case "ilpageeditorgui":
872 $this->setEditorToolContext();
874 if (!$this->getEnableEditing()) {
875 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
876 $this->
ctrl->redirect($this,
"preview");
879 $page_editor->setHeader($this->getHeader());
880 $page_editor->setPageBackTitle($this->page_back_title);
881 $page_editor->setIntLinkReturn($this->int_link_return);
883 $ret = $this->
ctrl->forwardCommand($page_editor);
886 case 'ilnewsitemgui':
888 $news_item_gui->setEnableEdit(
true);
889 $news_item_gui->setContextObjId($this->news_obj_id);
890 $news_item_gui->setContextObjType($this->news_obj_type);
891 $news_item_gui->setContextSubObjId($this->obj->getId());
892 $news_item_gui->setContextSubObjType(
"pg");
894 $ret = $this->
ctrl->forwardCommand($news_item_gui);
897 case "ilpropertyformgui":
898 $form = $this->initOpenedContentForm();
899 $this->
ctrl->forwardCommand($form);
902 case "ilinternallinkgui":
903 $this->
lng->loadLanguageModule(
"content");
906 $link_gui->filterLinkType(
"PageObject_FAQ");
907 $link_gui->filterLinkType(
"GlossaryItem");
908 $link_gui->filterLinkType(
"Media_Media");
909 $link_gui->filterLinkType(
"Media_FAQ");
911 $link_gui->setFilterWhiteList(
true);
912 $this->
ctrl->forwardCommand($link_gui);
915 case "ilquestioneditgui":
916 $this->setQEditTabs(
"question");
918 $edit_gui->setPageConfig($this->getPageConfig());
919 $edit_gui->setSelfAssessmentEditingMode(
true);
920 $ret = $this->
ctrl->forwardCommand($edit_gui);
921 $this->tpl->setContent($ret);
924 case 'ilassquestionfeedbackeditinggui':
926 $this->onFeedbackEditingForwarding();
929 $this->setQEditTabs(
"feedback");
932 $this->
lng->loadLanguageModule(
"assessment");
936 $this->questioninfo->getGeneralQuestionProperties(
937 $this->requested_q_id
939 $this->requested_q_id
941 $questionGUI->getObject()->setObjId(0);
942 $questionGUI->getObject()->setSelfAssessmentEditingMode(
true);
943 $questionGUI->getObject()->setPreventRteUsage($this->getPageConfig()->getPreventRteUsage());
950 case 'ilLearninghistorygui':
952 if ($this->getPageObject()->getParentType() ==
"prtf") {
957 $this->
ctrl->forwardCommand($hist_gui);
961 $cmd = $this->
ctrl->getCmd(
"preview");
963 if ($this->getViewPageLink() !=
"" && $cmd !=
"edit") {
964 $this->tabs_gui->addNonTabbedLink(
966 $this->getViewPageText(),
967 $this->getViewPageLink()
970 $ret = $this->$cmd();
971 if ($this->getOutputMode() == self::PREVIEW && $cmd ==
"preview") {
972 $this->showEditToolbar();
977 return (
string) $ret;
985 $this->tabs_gui->clearTargets();
987 $this->tabs_gui->setBackTarget(
988 $this->
lng->txt(
"back"),
989 $this->ctrl->getLinkTarget($this,
"edit")
992 $this->
ctrl->setParameterByClass(
"ilquestioneditgui",
"q_id", $this->requested_q_id);
993 $this->tabs_gui->addTab(
995 $this->
lng->txt(
"question"),
996 $this->ctrl->getLinkTargetByClass(
"ilquestioneditgui",
"editQuestion")
999 $this->
ctrl->setParameterByClass(
"ilAssQuestionFeedbackEditingGUI",
"q_id", $this->requested_q_id);
1000 $this->tabs_gui->addTab(
1002 $this->
lng->txt(
"feedback"),
1006 $this->tabs_gui->activateTab($a_active);
1015 $this->getPageObject()->setActivationStart(
null);
1016 $this->getPageObject()->setActivationEnd(
null);
1017 $this->getPageObject()->setActive(
false);
1018 $this->getPageObject()->update();
1019 $this->
ctrl->redirect($this,
"edit");
1024 $this->getPageObject()->setActivationStart(
null);
1025 $this->getPageObject()->setActivationEnd(
null);
1026 $this->getPageObject()->setActive(
true);
1027 $this->getPageObject()->update();
1028 $this->
ctrl->redirect($this,
"edit");
1038 if ($this->getEnableEditing()) {
1039 $b = $ui->factory()->button()->standard(
1040 $lng->txt(
"edit_page"),
1041 $this->ctrl->getLinkTarget($this,
"edit")
1052 $main_tpl = $this->tpl;
1056 $paragraph_plugin_string =
'';
1057 $disable_auto_margins =
'';
1067 $main_tpl->addJavaScript(
"../components/ILIAS/COPage/js/ilCOPagePres.js");
1069 $main_tpl->addJavaScript(
"components/ILIAS/COPage/js/ilCOPagePres.js");
1074 if ($this->getOutputMode() ==
"edit") {
1075 $this->initEditing();
1076 if (!$this->getPageObject()->getEditLock()) {
1080 $this->getPageObject()->buildDom();
1082 $this->log->debug(
"ilPageObjectGUI, showPage() in edit mode.");
1084 $tpl =
new ilTemplate(
"tpl.page_edit_wysiwyg.html",
true,
true,
"components/ILIAS/COPage");
1088 if ($this->getPageConfig()->getUsePageContainer()) {
1089 $tpl->
setVariable(
"PAGE_CONTAINER_CLASS",
"ilc_page_cont_PageContainer");
1094 $this->
ctrl->getFormActionByClass(
"ilpageeditorgui",
"",
"",
true)
1098 $sel_js_mode =
"enable";
1101 $tpl->
setVariable(
"PREPENDING_HTML", $this->getPrependingHtml());
1105 if ($sel_js_mode ==
"enable") {
1109 $this->
ctrl->getLinkTargetByClass(
1110 array(
"ilpageeditorgui",
"ilinternallinkgui"),
1119 $this->editor_gui->init()->initUI($main_tpl);
1124 $tpl =
new ilTemplate(
"tpl.page.html",
true,
true,
"components/ILIAS/COPage");
1125 if ($this->getEnabledPageFocus()) {
1129 if ($this->isPageContainerToBeRendered()) {
1136 $c_old_nr = $this->getPageObject()->old_nr;
1137 if ($c_old_nr > 0 || $this->getCompareMode() || ($this->requested_history_mode == 1)) {
1139 $this->getPageObject()->getHistoryInfo($c_old_nr);
1141 if (!$this->getCompareMode()) {
1142 $this->
ctrl->setParameter($this,
"history_mode",
"1");
1145 if (isset($hist_info[
"previous"])) {
1147 $tpl->
setVariable(
"TXT_PREV_REV", $this->
lng->txt(
"cont_previous_rev"));
1148 $this->
ctrl->setParameter($this,
"old_nr", $hist_info[
"previous"][
"nr"]);
1151 $this->
ctrl->getLinkTarget($this,
"preview")
1155 $tpl->
setVariable(
"TXT_PREV_REV", $this->
lng->txt(
"cont_previous_rev"));
1160 if ($c_old_nr > 0) {
1162 $tpl->
setVariable(
"TXT_NEXT_REV", $this->
lng->txt(
"cont_next_rev"));
1163 $this->
ctrl->setParameter($this,
"old_nr", $hist_info[
"next"][
"nr"] ?? 0);
1166 $this->
ctrl->getLinkTarget($this,
"preview")
1172 $tpl->
setVariable(
"TXT_LATEST_REV", $this->
lng->txt(
"cont_latest_rev"));
1173 $this->
ctrl->setParameter($this,
"old_nr",
"");
1176 $this->
ctrl->getLinkTarget($this,
"preview")
1181 $this->
ctrl->setParameter($this,
"history_mode",
"");
1186 $this->
ctrl->setParameter($this,
"old_nr", $c_old_nr);
1189 $this->
ctrl->getLinkTarget($this,
"rollbackConfirmation")
1191 $this->
ctrl->setParameter($this,
"old_nr",
"");
1194 $this->
lng->txt(
"cont_rollback")
1201 $tpl->
setVariable(
"TXT_REVISION", $this->
lng->txt(
"cont_revision"));
1203 "VAL_REVISION_DATE",
1213 if ($this->getOutputMode() != self::PRESENTATION &&
1214 $this->getOutputMode() != self::OFFLINE &&
1215 $this->getOutputMode() != self::PREVIEW &&
1216 $this->getOutputMode() != self::PRINTING) {
1217 $tpl->
setVariable(
"FORMACTION", $this->
ctrl->getFormActionByClass(
"ilpageeditorgui"));
1221 if ($this->getOutputMode() ==
"edit") {
1223 $this->obj->getParentType() .
":pg",
1224 $this->obj->getId(),
1225 $this->obj->getLanguage()
1227 $mob_links = array();
1228 foreach ($links as $link) {
1229 if ($link[
"type"] ==
"mob") {
1237 if (count($mob_links) > 0) {
1239 $tpl->
setVariable(
"TXT_LINKED_MOBS", $this->
lng->txt(
"cont_linked_mobs"));
1244 $tpl->
setVariable(
"TXT_EDIT_MEDIA", $this->
lng->txt(
"cont_edit_mob"));
1245 $tpl->
setVariable(
"TXT_COPY_TO_CLIPBOARD", $this->
lng->txt(
"cont_copy_to_clipboard"));
1251 $this->getPageObject()->buildDom();
1253 $this->getPageObject(),
1254 $this->getPageObject()->getDomDoc()
1256 if (count($snippets) > 0) {
1257 foreach ($snippets as $s) {
1261 $tpl->
setVariable(
"TXT_CONTENT_SNIPPETS_USED", $this->
lng->txt(
"cont_snippets_used"));
1266 $tpl->
setVariable(
"TXT_SHOW_INFO", $this->
lng->txt(
"cont_show_info"));
1271 if (!$this->getPageObject()->getActive() &&
1272 $this->getPageObject()->getActivationStart() !=
"" &&
1273 $this->getPageConfig()->getEnableScheduledActivation()) {
1275 $tpl->
setVariable(
"TXT_SCHEDULED_ACTIVATION", $this->
lng->txt(
"cont_scheduled_activation"));
1280 $this->getPageObject()->getActivationStart(),
1289 $this->getPageObject()->getActivationEnd(),
1299 $builded = $this->obj->buildDom();
1302 if ($this->getOutputMode() ==
"edit") {
1304 if (!$this->obj->checkPCIds()) {
1305 $this->obj->insertPCIds();
1306 $this->obj->update(
true,
true);
1309 $this->obj->addFileSizes();
1310 $this->obj->addHierIDs();
1312 $this->obj->addFileSizes();
1319 if (!$this->link_xml_set) {
1320 $this->setDefaultLinkXml();
1325 $link_xml = $this->getLinkXML();
1328 if ($this->getStyleId() > 0) {
1331 $template_xml = $style->getTemplateXML();
1332 $disable_auto_margins =
"n";
1333 if ($style->lookupStyleSetting(
"disable_auto_margins")) {
1334 $disable_auto_margins =
"y";
1339 $append_footnotes =
"y";
1340 if ($this->getAbstractOnly()) {
1341 if (!$this->abstract_pcid) {
1342 $content =
"<dummy><PageObject><PageContent><Paragraph>" .
1343 $this->obj->getFirstParagraphText() . $link_xml .
1344 "</Paragraph></PageContent></PageObject></dummy>";
1346 $append_footnotes =
"n";
1347 $par = $this->obj->getParagraphForPCID($this->abstract_pcid);
1348 $content =
"<dummy><PageObject><PageContent><Paragraph Characteristic='" . $par->getCharacteristic() .
"'>" .
1349 $par->getText() . $link_xml .
1350 "</Paragraph></PageContent></PageObject>" . $this->obj->getMultimediaXML() .
"</dummy>";
1353 $content = $this->obj->getXMLFromDom(
1357 $link_xml . $template_xml . $this->getComponentPluginsXML(),
1359 $this->getStyleId(),
1360 $this->getOutputMode() ===
"offline"
1365 if ($builded !==
true) {
1366 $this->displayValidationError($builded);
1368 $this->displayValidationError((
string) $this->edit_repo->getPageError());
1370 $this->edit_repo->clearPageError();
1373 $pg_title = $this->getPresentationTitle();
1378 if ($this->getOutputMode() ==
"edit") {
1385 if ($this->getOutputMode() !=
"offline") {
1389 $enlarge_path =
"images/media/enlarge.svg";
1392 $pg_title_class = ($this->getOutputMode() ==
"print")
1393 ?
"ilc_PrintPageTitle"
1398 $enable_split_new = ($this->obj->getParentType() ==
"lm")
1404 if (($this->obj->getParentType() ==
"lm") &&
1406 $this->obj->getParentId(),
1409 $enable_split_next =
"y";
1411 $enable_split_next =
"n";
1414 $img_path =
ilUtil::getImagePath(
"",
false, $this->getOutputMode(), $this->getOutputMode() ==
"offline");
1417 if ($this->getPageConfig()->getEnablePCType(
"Tabs")) {
1425 $file_download_link = $this->determineFileDownloadLink();
1426 $fullscreen_link = $this->determineFullscreenLink();
1427 $this->sourcecode_download_script = $this->determineSourcecodeDownloadScript();
1431 $media_mode = ($this->getOutputMode() ==
"edit")
1432 ? $this->
user->getPref(
"ilPageEditor_MediaMode")
1436 $this->getOutputMode() ==
"edit");
1438 $cfg = $this->getPageConfig();
1440 $current_ts = time();
1442 $enable_href = $this->getEnabledHref();
1443 if ($this->getOutputMode() == self::EDIT) {
1444 $enable_href =
false;
1448 $params = array(
'mode' => $this->getOutputMode(),
'pg_title' => htmlentities($pg_title, ENT_QUOTES,
"UTF-8"),
1449 'enable_placeholder' => $cfg->getEnablePCType(
"PlaceHolder") ?
"y" :
"n",
1450 'pg_id' => $this->obj->getId(),
'pg_title_class' => $pg_title_class,
1451 'webspace_path' => $wb_path,
'enlarge_path' => $enlarge_path,
1452 'img_col' => $col_path,
1453 'img_row' => $row_path,
1454 'img_cell' => $cell_path,
1455 'img_item' => $item_path,
1456 'acc_save_url' =>
"./ilias.php?baseClass=ilaccordionpropertiesstoragegui&cmd=setOpenedTab" .
1457 "&user_id=" . $this->user->getId(),
1458 'append_footnotes' => $append_footnotes,
1459 'compare_mode' => $this->getCompareMode() ?
"y" :
"n",
1460 'enable_split_new' => $enable_split_new,
1461 'enable_split_next' => $enable_split_next,
1462 'link_params' => $this->link_params,
1463 'file_download_link' => $file_download_link,
1464 'fullscreen_link' => $fullscreen_link,
1465 'img_path' => $img_path,
1466 'parent_id' => $this->obj->getParentId(),
1467 'download_script' => $this->sourcecode_download_script,
1468 'encoded_download_script' => urlencode($this->sourcecode_download_script),
1469 'enable_rep_objects' => $cfg->getEnablePCType(
"Resources") ?
"y" :
"n",
1470 'enable_login_page' => $cfg->getEnablePCType(
"LoginPageElement") ?
"y" :
"n",
1472 'enable_tabs' => $cfg->getEnablePCType(
"Tabs") ?
"y" :
"n",
1473 'enable_sa_qst' => $cfg->getEnableSelfAssessment() ?
"y" :
"n",
1474 'enable_file_list' => $cfg->getEnablePCType(
"FileList") ?
"y" :
"n",
1475 'enable_content_includes' => $cfg->getEnablePCType(
"ContentInclude") ?
"y" :
"n",
1476 'enable_content_templates' => (count($this->getPageObject()->getContentTemplates()) > 0) ?
"y" :
"n",
1477 'paste' => $paste ?
"y" :
"n",
1478 'media_mode' => $media_mode,
1479 'javascript' => $sel_js_mode,
1480 'paragraph_plugins' => $paragraph_plugin_string,
1481 'disable_auto_margins' => $disable_auto_margins,
1482 'page_toc' => $cfg->getEnablePageToc() ?
"y" :
"n",
1483 'enable_profile' => $cfg->getEnablePCType(
"Profile") ?
"y" :
"n",
1484 'enable_verification' => $cfg->getEnablePCType(
"Verification") ?
"y" :
"n",
1485 'enable_blog' => $cfg->getEnablePCType(
"Blog") ?
"y" :
"n",
1486 'enable_skills' => $cfg->getEnablePCType(
"Skills") ?
"y" :
"n",
1487 'enable_learning_history' => $cfg->getEnablePCType(
"LearningHistory") ?
"y" :
"n",
1488 'enable_qover' =>
"n",
1489 'enable_consultation_hours' => $cfg->getEnablePCType(
"ConsultationHours") ?
"y" :
"n",
1490 'enable_my_courses' => $cfg->getEnablePCType(
"MyCourses") ?
"y" :
"n",
1491 'enable_amd_page_list' => $cfg->getEnablePCType(
"AMDPageList") ?
"y" :
"n",
1492 'current_ts' => $current_ts,
1494 'page_perma_link' => $this->getPagePermaLink(),
1495 'activated_protection' =>
1497 'protection_text' => $this->lng->txt(
"cont_sec_protected_text"),
1498 'enable_href' => $enable_href
1500 if ($this->link_frame !=
"") {
1501 $params[
"pg_frame"] = $this->link_frame;
1509 $params[
"incl_elements_date"] = $this->obj->getLastUpdateOfIncludedElements();
1515 $md5 = md5(serialize(
$params) . $link_xml . $template_xml . $md5_adds);
1522 if (($this->getOutputMode() ==
"preview" || $this->getOutputMode() ==
"presentation") &&
1523 !$this->getCompareMode() &&
1524 !$this->getAbstractOnly() &&
1525 $md5 == $this->obj->getRenderMd5() &&
1526 ($this->obj->getLastChange() < $this->obj->getRenderedTime()) &&
1527 $this->obj->getRenderedTime() !=
"" &&
1528 $this->obj->old_nr == 0) {
1530 $output = $this->obj->getRenderedContent();
1532 $this->log->debug(
"Calling XSLT, content: " . substr($content, 0, 100));
1534 $output = $this->xsl->process($content,
$params);
1535 }
catch (Exception
$e) {
1537 if ($this->getOutputMode() ==
"edit") {
1538 $output =
"<pre>" .
$e->getMessage() .
"<br>" . htmlentities($content) .
"</pre>";
1542 if (($this->getOutputMode() ==
"presentation" || $this->getOutputMode() ==
"preview")
1543 && !$this->getAbstractOnly()
1544 && $this->obj->old_nr == 0) {
1545 $this->obj->writeRenderedContent($output, $md5);
1551 if (($this->getOutputMode() !=
"edit" ||
1552 $this->
user->getPref(
"ilPageEditor_HTMLMode") !=
"disable")
1553 && !$this->getPageConfig()->getPreventHTMLUnmasking()) {
1554 $output = str_replace(
"<",
"<", $output);
1555 $output = str_replace(
">",
">", $output);
1557 $output = str_replace(
"&",
"&", $output);
1563 $output = $this->insertResources($output);
1566 if ($this->getPageConfig()->getEnablePageToc()) {
1567 $output = $this->insertPageToc($output);
1571 $output = $this->insertAdvTrigger($output);
1576 $output = $this->replaceCurlyBrackets($output);
1579 $output = str_replace(
"\n",
"", $output);
1582 $output = $this->postOutputProcessing($output);
1584 if ($this->getOutputMode() ==
"edit" &&
1585 !$this->getPageObject()->getActive($this->getPageConfig()->getEnableScheduledActivation())) {
1586 $output =
'<div class="copg-disabled-page"><div class="ilCopgDisabledText">' . $this->getDisabledText() .
'</div>' . $output .
'</div>';
1590 $defs = $this->pc_definition->getPCDefinitions();
1591 foreach ($defs as $def) {
1592 $pc_class = $def[
"pc_class"];
1593 $pc_obj =
new $pc_class($this->getPageObject());
1594 $pc_obj->setSourcecodeDownloadScript($this->determineSourcecodeDownloadScript());
1595 $pc_obj->setFileDownloadLink($this->determineFileDownloadLink());
1596 $pc_obj->setFullscreenLink($this->determineFullscreenLink());
1597 $pc_obj->setProfileBackUrl($this->getProfileBackUrl());
1600 $output = $pc_obj->modifyPageContentPostXsl($output, $this->getOutputMode(), $this->getAbstractOnly());
1604 $this->addResourcesToTemplate($main_tpl);
1607 $output = $this->
ui->renderer()->render($this->
ui->factory()->legacy()->latexContent($output));
1612 if ($this->
ctrl->isAsynch() && !$this->getRawPageContent() &&
1613 $this->getOutputMode() ==
"edit") {
1615 $up_pc = $this->request->getString(
"updated_pc_id_str");
1619 $tpl->
setVariable($this->getTemplateOutputVar(), $output);
1622 echo $tpl->
get(
"edit_page");
1626 if ($this->getOutputMode() ===
"edit") {
1627 $edit_init = $this->editor_gui->init()->getInitHtml($this->getOpenPlaceHolder());
1629 if ($this->outputToTemplate()) {
1630 $tpl->
setVariable($this->getTemplateOutputVar(), $output);
1631 $this->tpl->setVariable($this->getTemplateTargetVar(), $tpl->
get() . $edit_init);
1634 if ($this->getRawPageContent()) {
1635 return $output . $edit_init;
1637 $tpl->
setVariable($this->getTemplateOutputVar(), $output);
1638 return $tpl->
get() . $edit_init;
1647 while (is_int($start = strpos($output,
"<!--ParStart-->")) &&
1648 is_int($end = strpos($output,
"<!--ParEnd-->", $start))) {
1649 $output = substr($output, 0, $start) .
1652 array(
"{",
"}"),
1653 substr($output, $start + 15, $end - ($start + 15))
1655 substr($output, $end + 13);
1669 return array(
"deactivatePage" => $this->
lng->txt(
"cont_deactivate_page"),
1670 "activatePage" => $this->lng->txt(
"cont_activate_page"));
1678 $media_mode = $this->request->getString(
"media_mode");
1679 $html_mode = $this->request->getString(
"html_mode");
1680 $js_mode = $this->request->getString(
"js_mode");
1681 if ($media_mode !=
"") {
1682 if ($media_mode ==
"disable") {
1683 $this->
user->writePref(
"ilPageEditor_MediaMode",
"disable");
1685 $this->
user->writePref(
"ilPageEditor_MediaMode",
"");
1688 if ($html_mode !=
"") {
1689 if ($html_mode ==
"disable") {
1690 $this->
user->writePref(
"ilPageEditor_HTMLMode",
"disable");
1692 $this->
user->writePref(
"ilPageEditor_HTMLMode",
"");
1695 if ($js_mode !=
"") {
1696 if ($js_mode ==
"disable") {
1697 $this->
user->writePref(
"ilPageEditor_JavaScript",
"disable");
1699 $this->
user->writePref(
"ilPageEditor_JavaScript",
"");
1703 $this->
ctrl->redirect($this,
"edit");
1708 $this->page_linker->setProfileBackUrl($this->getProfileBackUrl());
1709 $this->page_linker->setOffline($this->getOutputMode() == self::OFFLINE);
1710 $this->setLinkXml($this->page_linker->getLinkXML($this->getPageObject()->getInternalLinks()));
1715 $this->link_xml = $xml;
1716 $this->link_xml_set =
true;
1722 if ($this->profile_back_url !=
"") {
1723 return $this->profile_back_url;
1725 if ($this->getOutputMode() === self::OFFLINE ||
1726 $this->getOutputMode() === self::PRINTING) {
1729 return $this->
ctrl->getLinkTargetByClass(strtolower(get_class($this)),
"preview");
1734 $this->profile_back_url =
$url;
1740 $this->getPageObject()->buildDom();
1741 $cm = $this->pm->content($this->getPageObject()->getDomDoc());
1743 $this->getPageObject(),
1744 $this->requested_file_id
1750 $this->displayMedia(
true);
1755 $tpl =
new ilGlobalTemplate(
"tpl.fullscreen.html",
true,
true,
"components/ILIAS/LearningModule");
1761 $link_xml = $this->page_linker->getLinkXML($med_links);
1764 if ($this->request->getPageType() ===
"mep") {
1767 $pg_obj = $this->getPageObject();
1769 $pg_obj->buildDom();
1772 if ($this->requested_pg_id > 0) {
1773 $xml .= $pg_obj->getMediaAliasElement($this->request->getMobId());
1782 if ($a_fullscreen) {
1783 $mode =
"fullscreen";
1790 $params = array(
'mode' => $mode,
'enlarge_path' => $enlarge_path,
1791 'link_params' =>
"ref_id=" . $this->requested_ref_id,
'fullscreen_link' =>
"",
1793 'ref_id' => $this->requested_ref_id,
'webspace_path' => $wb_path);
1794 $output = $this->xsl->process($xml,
$params);
1805 $this->gui->toolbar()->setItems([]);
1812 $tpl =
new ilGlobalTemplate(
"tpl.fullscreen.html",
true,
true,
"components/ILIAS/COPage");
1813 $this->setTemplate($tpl);
1814 $this->addResourcesToTemplate($tpl);
1817 $this->setTemplateOutput(
false);
1818 $this->setHeader(
"");
1819 $ret = $this->showPage();
1820 $tpl->
setVariable(
"MEDIA_CONTENT",
"<div>" . $ret .
"</div>");
1831 $pg_obj = $this->getPageObject();
1832 $pg_obj->buildDom();
1833 $pg_obj->sendParagraph(
1834 $this->request->getString(
"par_id"),
1835 $this->request->getString(
"downloadtitle")
1844 while (is_int($pos = strpos($a_output,
"ilPageTocH", $cpos))) {
1849 $page_heads = array();
1850 foreach ($offsets as $os) {
1851 $level = (
int) substr($a_output, $os + 10, 1);
1852 if (in_array($level, array(1,2,3))) {
1853 $anchor = str_replace(
1856 substr($a_output, $os, strpos($a_output,
"-->", $os) - $os)
1860 $tag_start = stripos($a_output,
"<h" . $level .
" ", $os);
1861 $tag_end = stripos($a_output,
"</h" . $level .
">", $tag_start);
1862 $head = substr($a_output, $tag_start, $tag_end - $tag_start);
1865 $text_start = stripos($head,
">") + 1;
1866 $text_end = strripos($head,
"<!--", $text_start);
1867 $text = substr($head, $text_start, $text_end - $text_start);
1868 $page_heads[] = array(
"level" => $level,
"text" =>
$text,
1869 "anchor" => $anchor);
1872 if (count($page_heads) > 1) {
1873 $listing = $this->gui->listing();
1881 $page_toc_ph =
"<!--PageTocPH-->";
1882 foreach ($page_heads as $ind => $h) {
1888 if ($h[
"level"] == 2 && $c_par[1] > 0) {
1891 if ($h[
"level"] == 3 && $c_par[2] > 0) {
1895 $h[
"text"] = str_replace($page_toc_ph,
"", $h[
"text"]);
1898 $this->
ui->factory()->legacy()->content(
"<a href='#" . $h[
"anchor"] .
"' class='ilc_page_toc_PageTOCLink'>" . $h[
"text"] .
"</a>"),
1904 if ($h[
"level"] == 1) {
1908 if ($h[
"level"] == 2) {
1914 "tpl.page_toc.html",
1917 "components/ILIAS/COPage"
1919 $tpl->
setVariable(
"PAGE_TOC", $listing->autoNumbers(
true)->render());
1920 $tpl->
setVariable(
"TXT_PAGE_TOC", $this->
lng->txt(
"cont_page_toc"));
1924 $a_output = str_replace(
1925 "{{{{{PageTOC}}}}}",
1929 $numbers = $listing->getNumbers();
1931 if (count($numbers) > 0) {
1932 foreach ($numbers as $n) {
1933 $a_output = (strpos($a_output, $page_toc_ph) !==
false)
1934 ? substr_replace($a_output, $n .
" ", strpos($a_output, $page_toc_ph), strlen($page_toc_ph))
1939 $a_output = str_replace(
1940 "{{{{{PageTOC}}}}}",
1952 if ($this->getEnablePCType(
"Resources") &&
1953 ($this->getOutputMode() ==
"edit" || $this->getOutputMode() ==
"preview")) {
1966 if (!$this->getAbstractOnly()) {
1967 $a_output = str_replace(
1968 "{{{{{LV_show_adv}}}}}",
1969 $this->
lng->txt(
"cont_show_adv"),
1972 $a_output = str_replace(
1973 "{{{{{LV_hide_adv}}}}}",
1974 $this->
lng->txt(
"cont_hide_adv"),
1978 $a_output = str_replace(
1979 "{{{{{LV_show_adv}}}}}",
1983 $a_output = str_replace(
1984 "{{{{{LV_hide_adv}}}}}",
2014 if ($this->requested_history_mode) {
2015 $this->setBackToHistoryTabs();
2017 $this->tabs_gui->activateTab(
"cont_preview");
2019 $this->setOutputMode(self::PREVIEW);
2020 return $this->showPage();
2028 $collection = $this->tool_context->current()->getAdditionalData();
2039 if (!$this->getEnableEditing()) {
2040 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
2041 $this->
ctrl->redirect($this,
"preview");
2045 $ptype = $this->getParentType();
2046 if ($ptype ==
"cont" && $this->requested_ref_id > 0) {
2049 $this->setScreenIdComponent();
2050 $this->
help->setScreenId(
"edit_" . $ptype);
2053 if (!$this->getPageObject()->getEditLock()) {
2054 $this->showEditLockInfo();
2057 $this->setEditorToolContext();
2060 $this->
lng->toJS(
"paste");
2061 $this->
lng->toJS(
"delete");
2062 $this->
lng->toJS(
"cont_delete_content");
2063 $this->
lng->toJS(
"copg_confirm_el_deletion");
2064 $this->
lng->toJS(
"cont_saving");
2065 $this->
lng->toJS(
"cont_ed_par");
2066 $this->
lng->toJS(
"cont_no_block");
2067 $this->
lng->toJS(
"copg_error");
2068 $this->
lng->toJS(
"cont_ed_click_to_add_pg");
2069 $this->
lng->toJS(
"cont_ed_new_item_after");
2070 $this->
lng->toJS(
"cont_ed_new_item_before");
2071 $this->
lng->toJS(
"cont_ed_item_up");
2072 $this->
lng->toJS(
"cont_ed_item_down");
2073 $this->
lng->toJS(
"cont_ed_delete_item");
2074 $this->
lng->toJS(
"copg_edit_iframe_title");
2075 $this->
lng->toJS(
"copg_par_format_selection");
2082 $info = $this->
lng->txt(
"content_no_edit_lock");
2083 $lock = $this->getPageObject()->getEditLockInfo();
2084 $info .=
"</br>" . $this->
lng->txt(
"content_until") .
": " .
2086 $info .=
"</br>" . $this->
lng->txt(
"obj_usr") .
": " .
2089 $back_link = $this->
ui->factory()->link()->standard(
2090 $this->
lng->txt(
"back"),
2091 $this->ctrl->getLinkTarget($this,
"finishEditing")
2094 $mbox = $this->
ui->factory()->messageBox()->info(
$info)
2095 ->withLinks([$back_link]);
2096 $rendered_mbox = $this->
ui->renderer()->render($mbox);
2098 if (!$this->
ctrl->isAsynch()) {
2099 $this->tpl->setContent($rendered_mbox);
2101 echo $rendered_mbox;
2108 $this->setOutputMode(self::EDIT);
2109 $html = $this->showPage();
2111 if ($this->isEnabledNotes()) {
2112 $html .=
"<br /><br />" . $this->getNotesHTML();
2122 $lock = $this->getPageObject()->getEditLockInfo();
2123 $info = $this->
lng->txt(
"cont_got_lock_release");
2126 $mbox = $ui->factory()->messageBox()->info(
$info);
2128 return $ui->renderer()->render($mbox);
2133 $pl_pc_id = $this->request->getPlaceholderPCId();
2134 $this->obj->buildDom();
2135 $this->obj->addHierIDs();
2136 $this->setOpenPlaceHolder($pl_pc_id);
2137 return $this->edit();
2142 $this->setOutputMode($a_mode);
2144 return $this->showPage();
2149 $this->getTabs(
"preview");
2150 return $this->showPage();
2158 $this->tpl =
new ilGlobalTemplate(
"tpl.fullscreen.html",
true,
true,
"components/ILIAS/COPage");
2159 $this->tpl->setCurrentBlock(
"ContentStyle");
2160 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", 0);
2161 $this->tpl->parseCurrentBlock();
2163 $this->tpl->setVariable(
2168 $this->tpl->setCurrentBlock(
"ilMedia");
2171 if ($this->requested_pg_id > 0) {
2173 $pg_obj->buildDom();
2178 $xml .= $pg_obj->getMediaAliasElement($this->request->getMobId());
2188 $mode =
"fullscreen";
2189 $params = array(
'mode' => $mode,
2191 'webspace_path' => $wb_path);
2192 $output = $this->xsl->process($xml,
$params);
2195 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
2205 if (is_array($a_error)) {
2206 $error_str =
"<strong>Error(s):</strong><br>";
2207 foreach ($a_error as $error) {
2208 $err_mess = implode(
" - ", $error);
2209 if (!is_int(strpos($err_mess,
":0:"))) {
2210 $error_str .= htmlentities($err_mess) .
"<br />";
2213 $this->tpl->setVariable(
"MESSAGE", $error_str);
2219 $this->tabs_gui->clearTargets();
2220 $this->tabs_gui->setBackTarget(
2221 $this->
lng->txt(
"back"),
2222 $this->ctrl->getLinkTarget($this,
"edit")
2228 $this->tabs_gui->clearTargets();
2229 $this->tabs_gui->setBackTarget(
2230 $this->
lng->txt(
"back"),
2231 $this->ctrl->getLinkTarget($this,
"history")
2240 if (!$this->getEnableEditing()) {
2244 $this->setBackToEditTabs();
2246 $this->tpl->addJavaScript(
"assets/js/page_history.js");
2249 $table_gui->setId(
"hist_table");
2250 $entries = $this->getPageObject()->getHistoryEntries();
2251 $entries[] = array(
'page_id' => $this->getPageObject()->
getId(),
2252 'parent_type' => $this->getPageObject()->getParentType(),
2253 'hdate' => $this->getPageObject()->getLastChange(),
2254 'parent_id' => $this->getPageObject()->getParentId(),
2256 'sortkey' => 999999,
2257 'user' => $this->getPageObject()->last_change_user);
2258 $table_gui->setData($entries);
2259 return $table_gui->getHTML();
2267 if (!$this->getEnableEditing()) {
2274 $this->
ctrl->setParameter($this,
"rollback_nr", $this->requested_old_nr);
2275 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"rollback"));
2276 $c_gui->setHeaderText($this->
lng->txt(
"cont_rollback_confirmation"));
2277 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"history");
2278 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"rollback");
2280 $hentry = $this->obj->getHistoryEntry($this->requested_old_nr);
2284 $this->requested_old_nr,
2288 $this->tpl->setContent($c_gui->getHTML());
2296 if (!$this->getEnableEditing()) {
2300 $hentry = $this->obj->getHistoryEntry(
2301 $this->request->getString(
"rollback_nr")
2304 if ($hentry[
"content"] !=
"") {
2305 $this->obj->setXMLContent($hentry[
"content"]);
2306 $this->obj->buildDom(
true);
2307 if ($this->obj->update()) {
2308 $this->
ctrl->redirect($this,
"history");
2311 $this->
ctrl->redirect($this,
"history");
2316 $this->
help->setScreenIdComponent(
"copg");
2322 if ($this->use_meta_data) {
2324 $this->meta_data_rep_obj,
2325 $this->meta_data_type,
2326 $this->meta_data_sub_obj_id
2328 $mdtab = $mdgui->getTab();
2330 $this->tabs_gui->addTarget(
2334 "ilobjectmetadatagui"
2338 return (
string) $mdtab;
2341 public function getTabs(
string $a_activate =
""): void
2343 if (in_array($this->getOutputMode(), [self::OFFLINE])) {
2346 $this->setScreenIdComponent();
2348 if (!$this->getEnabledTabs()) {
2353 if (!$this->getEditPreview()) {
2354 $this->tabs_gui->addTarget(
"pg", $this->
ctrl->getLinkTarget($this,
"preview"), array(
"",
"preview"));
2356 $this->tabs_gui->addTarget(
"cont_preview", $this->
ctrl->getLinkTarget($this,
"preview"), array(
"",
"preview"));
2359 if ($this->use_meta_data) {
2361 $this->meta_data_rep_obj,
2362 $this->meta_data_type,
2363 $this->meta_data_sub_obj_id
2365 $mdtab = $mdgui->getTab();
2367 $this->tabs_gui->addTarget(
2371 "ilobjectmetadatagui"
2379 if (is_array($this->tab_hook)) {
2380 $func = $this->tab_hook[
"func"];
2381 $this->tab_hook[
"obj"]->$func();
2390 if (!$this->getEnableEditing()) {
2394 $tpl =
new ilTemplate(
"tpl.page_compare.html",
true,
true,
"components/ILIAS/COPage");
2395 $this->setBackToHistoryTabs();
2401 $compare = $this->compare->compare(
2402 $this->getPageObject(),
2408 $lpage = $compare[
"l_page"];
2409 $cfg = $this->getPageConfig();
2410 $cfg->setPreventHTMLUnmasking(
true);
2412 $this->setOutputMode(self::PREVIEW);
2413 $this->setPageObject($lpage);
2414 $this->setPresentationTitle($this->getPresentationTitle());
2415 $this->setCompareMode(
true);
2417 $lhtml = $this->showPage();
2418 $lhtml = $this->replaceDiffTags($lhtml);
2419 $lhtml = str_replace(
"<br />",
"<br />", $lhtml);
2423 $rpage = $compare[
"r_page"];
2424 $this->setPageObject($rpage);
2425 $this->setPresentationTitle($this->getPresentationTitle());
2426 $this->setCompareMode(
true);
2427 $this->setOutputMode(self::PREVIEW);
2429 $rhtml = $this->showPage();
2430 $rhtml = $this->replaceDiffTags($rhtml);
2431 $rhtml = str_replace(
"<br />",
"<br />", $rhtml);
2435 $tpl->
setVariable(
"TXT_MODIFIED", $this->
lng->txt(
"cont_pc_modified"));
2436 $tpl->
setVariable(
"TXT_DELETED", $this->
lng->txt(
"cont_pc_deleted"));
2443 $a_html = str_replace(
"[ilDiffInsStart]",
'<span class="ilDiffIns">', $a_html);
2444 $a_html = str_replace(
"[ilDiffDelStart]",
'<span class="ilDiffDel">', $a_html);
2445 $a_html = str_replace(
"[ilDiffInsEnd]",
'</span>', $a_html);
2446 $a_html = str_replace(
"[ilDiffDelEnd]",
'</span>', $a_html);
2456 $this->setBackToEditTabs();
2458 $atpl =
new ilTemplate(
"tpl.page_activation.php",
true,
true,
"components/ILIAS/COPage");
2459 $this->initActivationForm();
2460 $this->getActivationFormValues();
2461 $atpl->setVariable(
"FORM", $this->
form->getHTML());
2462 $this->tpl->setContent($atpl->get());
2471 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
2472 $this->
form->setTitle($this->
lng->txt(
"cont_page_activation"));
2476 $rad_op1 =
new ilRadioOption($this->
lng->txt(
"cont_activated"),
"activated");
2478 $rad->addOption($rad_op1);
2479 $rad_op2 =
new ilRadioOption($this->
lng->txt(
"cont_deactivated"),
"deactivated");
2480 $rad->addOption($rad_op2);
2481 $rad_op3 =
new ilRadioOption($this->
lng->txt(
"cont_scheduled_activation"),
"scheduled");
2484 $dt_prop->setRequired(
true);
2485 $dt_prop->setShowTime(
true);
2486 $rad_op3->addSubItem($dt_prop);
2488 $dt_prop2->setRequired(
true);
2489 $dt_prop2->setShowTime(
true);
2490 $rad_op3->addSubItem($dt_prop2);
2494 $cb->setInfo($this->
lng->txt(
"cont_show_activation_info_info"));
2495 $rad_op3->addSubItem($cb);
2498 $rad->addOption($rad_op3);
2500 $this->
form->addCommandButton(
"saveActivation", $this->
lng->txt(
"save"));
2502 $this->
form->addItem($rad);
2510 $activation =
"deactivated";
2511 if ($this->getPageObject()->getActive()) {
2512 $activation =
"activated";
2515 $dt_prop = $this->
form->getItemByPostVar(
"start");
2516 if ($this->getPageObject()->getActivationStart() !=
"") {
2517 $activation =
"scheduled";
2519 $this->getPageObject()->getActivationStart(),
2523 $dt_prop = $this->
form->getItemByPostVar(
"end");
2524 if ($this->getPageObject()->getActivationEnd() !=
"") {
2525 $activation =
"scheduled";
2527 $this->getPageObject()->getActivationEnd(),
2532 $this->
form->getItemByPostVar(
"activation")->setValue($activation);
2533 $this->
form->getItemByPostVar(
"show_activation_info")->setChecked($this->getPageObject()->getShowActivationInfo());
2541 $this->initActivationForm();
2543 if ($this->
form->checkInput()) {
2544 $this->getPageObject()->setActive(
true);
2545 $this->getPageObject()->setActivationStart(
null);
2546 $this->getPageObject()->setActivationEnd(
null);
2547 $this->getPageObject()->setShowActivationInfo(
2548 $this->request->getString(
"show_activation_info")
2550 $activation = $this->request->getString(
"activation");
2551 if ($activation ==
"deactivated") {
2552 $this->getPageObject()->setActive(
false);
2554 if ($activation ==
"scheduled") {
2555 $this->getPageObject()->setActive(
false);
2556 $this->getPageObject()->setActivationStart(
2559 $this->getPageObject()->setActivationEnd(
2563 $this->getPageObject()->update();
2564 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
2565 $this->
ctrl->redirect($this,
"editActivation");
2567 $this->
form->setValuesByPost();
2568 $this->tpl->setContent($this->
form->getHTML());
2575 ?
object $a_content_object =
null,
2576 bool $a_enable_private_notes =
true,
2577 bool $a_enable_public_notes =
false,
2578 bool $a_enable_notes_deletion =
false,
2579 ?callable $a_callback =
null,
2580 bool $export =
false
2583 if (!$a_content_object) {
2584 throw new ilException(
"No content object given.");
2605 $comments_gui = $this->notes->gui()->getCommentsGUI(
2606 $a_content_object->getParentId(),
2607 $a_content_object->getId(),
2608 $a_content_object->getParentType()
2610 $comments_gui->setUseObjectTitleHeader(
false);
2613 if ($a_enable_private_notes) {
2614 $comments_gui->enablePrivateNotes();
2616 if ($a_enable_public_notes) {
2617 $comments_gui->enablePublicNotes();
2618 if ($a_enable_notes_deletion) {
2619 $comments_gui->enablePublicNotesDeletion(
true);
2623 $comments_gui->setExportMode();
2627 $comments_gui->addObserver($a_callback);
2630 $next_class = $this->
ctrl->getNextClass($this);
2631 if (in_array($next_class, [
"ilnotegui",
"ilcommentgui"])) {
2632 $html = $this->
ctrl->forwardCommand($comments_gui);
2634 $html = $comments_gui->getListHTML();
2645 $this->request->getString(
"type"),
2646 $this->request->getString(
"id"),
2647 $this->request->getString(
"answer")
2663 $this->tabs_gui->activateTab(
"edit");
2664 $form = $this->initOpenedContentForm();
2665 $this->tpl->setContent($form->
getHTML());
2675 $ac->setInternalLinkDefault(
"Media_Media", 0);
2676 $ac->setInternalLinkFilterTypes(array(
"PageObject_FAQ",
"GlossaryItem",
"Media_Media",
"Media_FAQ"));
2677 $val = $this->obj->getInitialOpenedContent();
2678 if (($val[
"id"] ??
'') !=
"" && ($val[
"type"] ??
'') !=
"") {
2679 $ac->setValue($val[
"type"] .
"|" . $val[
"id"] .
"|" . $val[
"target"]);
2686 $form->
setTitle($this->
lng->txt(
"cont_initial_attached_content"));
2694 $this->obj->saveInitialOpenedContent(
2695 $this->request->getString(
"opened_content_ajax_type"),
2696 $this->request->getInt(
"opened_content_ajax_id"),
2697 $this->request->getString(
"opened_content_ajax_target")
2700 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"));
2701 $this->
ctrl->redirect($this,
"edit");
2714 $l = $this->request->getString(
"totransl");
2715 $p = $this->getPageObject();
2716 if (!$this->checkLangPageAvailable($p->getId(), $l)) {
2717 $this->confirmPageTranslationCreation();
2720 $this->
ctrl->setParameter($this,
"transl", $l);
2721 $this->
ctrl->redirect($this,
"edit");
2726 $p = $this->getPageObject();
2735 $l = $this->request->getString(
"totransl");
2736 $this->
ctrl->setParameter($this,
"totransl", $l);
2737 $this->
lng->loadLanguageModule(
"meta");
2740 $cgui->setFormAction($this->
ctrl->getFormAction($this));
2741 $cgui->setHeaderText($this->
lng->txt(
"cont_page_translation_does_not_exist") .
": " .
2742 $this->lng->txt(
"meta_l_" . $l));
2743 $cgui->setCancel($this->
lng->txt(
"cancel"),
"editMasterLanguage");
2744 $cgui->setConfirm($this->
lng->txt(
"confirm"),
"createPageTranslation");
2745 $this->tpl->setContent($cgui->getHTML());
2753 $this->
ctrl->setParameter($this,
"transl",
"-");
2754 $this->
ctrl->redirect($this,
"edit");
2762 $l = $this->request->getString(
"totransl");
2765 $this->getPageObject()->getParentType(),
2766 $this->getPageObject()->
getId(),
2771 $p->copyPageToTranslation($l);
2772 $this->
ctrl->setParameter($this,
"transl", $l);
2773 $this->
ctrl->redirect($this,
"edit");
2781 $this->getPageObject()->releasePageLock();
2782 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"cont_page_lock_released"),
true);
2783 $this->finishEditing();
2788 $this->
ctrl->redirect($this,
"preview");
2794 $this->getRenderPageContainer() || ($this->getOutputMode() == self::PREVIEW && $this->getPageConfig()->getUsePageContainer())
2808 $collector = new \ILIAS\COPage\ResourcesCollector($this->getOutputMode(), $this->getPageObject());
2810 foreach ($collector->getJavascriptFiles() as $js) {
2814 foreach ($collector->getCssFiles() as $css) {
2818 foreach ($collector->getOnloadCode() as $code) {
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Editing session repository.
Page component editing request.
GUI class for public user profile presentation.
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
static addCss()
Add required css.
static addJavaScript(?ilGlobalTemplate $main_tpl=null)
Add javascript files that are necessary to run accordion.
static initDateTimePicker()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Base class for ILIAS Exception handling.
static getWebspaceDir(string $mode="filesystem")
get webspace directory
special template class to simplify handling of ITX/PEAR
static getInitHTML(string $a_url)
Get initialisation HTML to use internal link editing.
static _getTargetsOfSource(string $a_source_type, int $a_source_id, string $a_source_lang="-")
Get all targets of a source object (e.g., a page)
Learning history main GUI class.
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
static isActivated()
Checks whether Map feature is activated.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupTitle(int $a_page_id)
User Interface for NewsItem entities.
static hasSuccessorPage(int $a_cont_obj_id, int $a_page_id)
checks if page has a successor page
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
static getBaseContentStylePath()
Class ilObject Basic functions for all objects.
static _lookupType(int $id, bool $reference=false)
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static _lookupTitle(int $obj_id)
static collectContentIncludes(ilPageObject $a_page, DOMDocument $a_domdoc)
get all content includes that are used within the page
static insertResourcesIntoPageContent(string $a_content)
Insert resources (see also ilContainerContentGUI::determinePageEmbeddedBlocks for presentation)
static getCacheTriggerString(ilPageObject $a_page)
Get page cache update trigger string.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const SEC_PROTECT_PROTECTED
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
setLinkFrame(string $l_frame="")
setTabs(ilTabsGUI $a_tabs)
bool $enabledcontentincludes
string $file_download_link
onFeedbackEditingForwarding()
setLanguage(string $a_val)
setParentType(string $a_val)
setViewPageLink(string $a_link, string $a_target="")
set link for "view page" button
rollback()
Rollback to a previous version.
setAdvMdRecordObject(int $a_adv_ref_id, string $a_adv_type, string $a_adv_subtype="-")
Set object, that defines the adv md records being used.
string $sourcecode_download_script
EditSessionRepository $edit_repo
determineSourcecodeDownloadScript()
ILIAS TestQuestionPool Questions PublicInterface $questioninfo
setStyleId(int $a_styleid)
processAnswer()
Process answer.
showPage()
display content of page
setEnabledHref(bool $enable)
displayValidationError($a_error)
display validation error
setEditMode()
Set edit mode.
saveActivation()
Save Activation.
showEditToolbar()
Show edit toolbar.
displayMedia(bool $a_fullscreen=false)
setPresentationTitle(string $a_title="")
ILIAS COPage Link LinkManager $link
isPageContainerToBeRendered()
string $open_place_holder
releasePageLock()
Release page lock.
getActivationFormValues()
Get values for activation form.
enableNotes(bool $a_enabled, int $a_parent_id)
setEnabledPageFocus(bool $a_enabledpagefocus)
setIntLinkReturn(string $a_return)
setPageConfig(ilPageConfig $a_val)
int $meta_data_sub_obj_id
setPageLinker(\ILIAS\COPage\PageLinker $page_linker)
initialOpenedContent()
Initially opened content.
activateMetaDataEditor(ilObject $a_rep_obj, string $a_type, int $a_sub_obj_id, ?object $a_observer_obj=null, string $a_observer_func="")
Activate meda data editor.
confirmPageTranslationCreation()
Confirm page translation creation.
editActivation()
Edit activation (only, if scheduled page activation is activated in administration)
setPrependingHtml(string $a_prependinghtml)
setEnabledNews(bool $a_enabled, int $a_news_obj_id=0, string $a_news_obj_type="")
setHeader(string $a_title="")
determineFullscreenLink()
ILIAS COPage PC PCDefinition $pc_definition
getEnablePCType(string $a_pc_type)
string $meta_data_observer_func
insertResources(string $a_output)
object $meta_data_observer_obj
addResourcesToTemplate(ilGlobalTemplateInterface $tpl)
Add resources to template.
compareVersion()
Compares two revisions of the page.
ILIAS COPage Compare PageCompare $compare
presentation(string $a_mode=self::PRESENTATION)
setAbstractOnly(bool $a_val, string $pcid="")
Get only abstract (first text paragraph)
setPageBackTitle(string $a_title)
setRawPageContent(bool $a_rawpagecontent)
Set Get raw page content only.
bool $render_page_container
setOldNr(int $a_val)
Set old nr (historic page)
string $template_output_var
setEnabledTabs(bool $a_enabledtabs)
determineFileDownloadLink()
replaceCurlyBrackets(string $output)
setEnablePCType(string $a_pc_type, bool $a_val)
replaceDiffTags(string $a_html)
editMasterLanguage()
Edit master language.
setRenderPageContainer(bool $a_val)
previewHistory()
Preview history.
setOutputMode(string $a_mode=self::PRESENTATION)
setOpenPlaceHolder(string $a_val)
ilObject $meta_data_rep_obj
showMediaFullscreen(int $a_style_id=0)
show fullscreen view of media object
setLinkParams(string $l_params="")
createPageTranslation()
Create page translation.
setTemplateOutput(bool $a_output=true)
string $offline_directory
getNotesHTML(?object $a_content_object=null, bool $a_enable_private_notes=true, bool $a_enable_public_notes=false, bool $a_enable_notes_deletion=false, ?callable $a_callback=null, bool $export=false)
Get html for public and/or private notes.
string $presentation_title
string $requested_file_id
getAdditionalPageActions()
Get additional page actions.
ilGlobalTemplateInterface $tpl
ILIAS COPage InternalGUIService $gui
history()
Get history table as HTML.
ILIAS COPage Editor GUIService $editor_gui
saveInitialOpenedContent()
setEnableEditing(bool $a_enableediting)
ILIAS COPage PageLinker $page_linker
rollbackConfirmation()
Rollback confirmation.
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
executeCommand()
execute command
initPageObject()
Init page object.
switchToLanguage()
Switch to language.
ILIAS Notes Service $notes
setProfileBackUrl(string $url)
getComponentPluginsXML()
Put information about activated plugins into XML.
ILIAS COPage Xsl XslManager $xsl
int $requested_history_mode
getTabs(string $a_activate="")
ilPageConfig $page_config
setOfflineDirectory(string $offdir)
insertPageToc(string $a_output)
ilComponentFactory $component_factory
setSourcecodeDownloadScript(string $script_name)
setPageObject(ilPageObject $a_pg_obj)
setEditPreview(bool $a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
setEditorToolContext()
Set editor tool context.
getActivationCaptions()
Get captions for activation action menu entries.
initActivationForm()
Init activation form.
__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="")
setQuestionHTML(array $question_html)
setFullscreenLink(string $a_fullscreen_link)
setFileDownloadLink(string $a_download_link)
setActivationListener(object $a_obj, string $a_meth)
string $exp_target_script
setTemplate(ilGlobalTemplateInterface $main_tpl)
setTabHook(object $a_object, string $a_function)
checkLangPageAvailable(int $id, string $lang)
download_paragraph()
download source code paragraph
setCompareMode(bool $a_val)
getAdvMdRecordObject()
Get adv md record type.
postOutputProcessing(string $a_output)
Finalizing output processing.
setQEditTabs(string $a_active)
Set question editing tabs.
getSourcecodeDownloadScript()
insertAdvTrigger(string $a_output)
Insert adv content trigger.
ILIAS COPage Page PageManager $pm
setTemplateTargetVar(string $a_variable)
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static saveQuestionAnswer(string $a_type, int $a_id, string $a_answer)
This class represents an option in a radio group.
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
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)
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
static initjQuery(?ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
setVariable(string $variable, $value='')
Sets the given variable to the given value.
touchBlock(string $block)
overwrites ITX::touchBlock.
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.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
form(?array $class_path, string $cmd, string $submit_caption="")
link(string $caption, string $href, bool $new_viewport=false)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
if(!file_exists('../ilias.ini.php'))