36 public const EDIT =
"edit";
106 protected \ILIAS\DI\UIServices
$ui;
144 string $a_parent_type,
147 bool $a_prevent_get_id =
false,
149 string $concrete_lang =
"" 154 $this->tpl = $DIC->ui()->mainTemplate();
155 $this->
ctrl = $DIC->ctrl();
156 $this->
lng = $DIC->language();
157 $this->tabs_gui = $DIC->tabs();
158 $this->
access = $DIC->access();
159 $this->
user = $DIC->user();
160 $this->
help = $DIC[
"ilHelp"];
161 $this->
ui = $DIC->ui();
162 $this->
toolbar = $DIC->toolbar();
163 $this->component_factory = $DIC[
"component.factory"];
165 $this->request = $DIC
172 $this->requested_old_nr = $this->request->getInt(
"old_nr");
173 $this->requested_transl = $this->request->getString(
"transl");
174 $this->requested_file_id = $this->request->getString(
"file_id");
175 $this->requested_ref_id = $this->request->getInt(
"ref_id");
176 $this->requested_pg_id = $this->request->getInt(
"pg_id");
181 if ($a_old_nr == 0 && !$a_prevent_get_id && $this->requested_old_nr > 0) {
186 if ($a_lang ==
"" && $this->requested_transl !=
'') {
201 $this->page_linker =
new ilPageLinker(get_class($this));
203 $this->output2template =
true;
205 $this->template_output_var =
"PAGE_CONTENT";
206 $this->change_comments =
false;
207 $this->page_back_title = $this->
lng->txt(
"page");
208 $this->
lng->loadLanguageModule(
"content");
209 $this->
lng->loadLanguageModule(
"copg");
211 $this->tool_context = $DIC->globalScreen()->tool()->context();
215 $this->
ctrl->saveParameter($this,
"transl");
218 $this->requested_user_id = $this->request->getInt(
"user");
219 $this->requested_q_id = $this->request->getInt(
"q_id");
220 $this->requested_history_mode = $this->request->getInt(
"history_mode");
222 $this->edit_repo = $DIC
233 $this->tpl = $main_tpl;
247 string $a_adv_subtype =
"-" 249 $this->adv_ref_id = $a_adv_ref_id;
250 $this->adv_type = $a_adv_type;
251 $this->adv_subtype = $a_adv_subtype;
259 if ($this->adv_type === null) {
276 $page->setConcreteLang($this->concrete_lang);
282 $this->parent_type = $a_val;
290 public function setId(
int $a_val): void
305 $this->old_nr = $a_val;
341 $this->page_config = $a_val;
351 $this->obj = $a_pg_obj;
363 string $a_mode = self::PRESENTATION
365 $this->output_mode = $a_mode;
375 $this->output2template = $a_output;
385 $this->presentation_title = $a_title;
395 $this->header = $a_title;
405 $this->link_params = $l_params;
415 $this->link_frame = $l_frame;
445 $this->target_var = $a_variable;
460 $this->sourcecode_download_script = $script_name;
470 $this->tabs_gui = $a_tabs;
475 $this->page_back_title = $a_title;
480 $this->file_download_link = $a_download_link;
490 $this->fullscreen_link = $a_fullscreen_link;
500 $this->int_link_return = $a_return;
505 $this->change_comments = $a_enabled;
513 public function enableNotes(
bool $a_enabled,
int $a_parent_id): void
515 $this->notes_enabled = $a_enabled;
516 $this->notes_parent_id = $a_parent_id;
529 $this->offline_directory = $offdir;
543 $this->view_page_link = $a_link;
544 $this->view_page_target = $a_target;
559 return $this->
lng->txt(
"cont_presentation_view");
566 $this->act_obj = $a_obj;
567 $this->act_meth = $a_meth;
572 int $a_news_obj_id = 0,
573 string $a_news_obj_type =
"" 575 $this->enabled_news = $a_enabled;
576 $this->news_obj_id = $a_news_obj_id;
577 $this->news_obj_type = $a_news_obj_type;
589 $this->tab_hook = array(
"obj" => $a_object,
"func" => $a_function);
598 $this->editpreview = $a_editpreview;
608 $this->tabs_enabled = $a_enabledtabs;
618 $this->enabledpagefocus = $a_enabledpagefocus;
623 $this->open_place_holder = $a_val;
638 $this->prependinghtml = $a_prependinghtml;
648 $this->enableediting = $a_enableediting;
661 $this->rawpagecontent = $a_rawpagecontent;
671 $this->styleid = $a_styleid;
681 $this->compare_mode = $a_val;
696 $this->abstract_only = $a_val;
697 $this->abstract_pcid = $pcid;
707 $this->render_page_container = $a_val;
717 return $this->
lng->txt(
"inactive");
727 $this->enabled_href = $enable;
742 object $a_observer_obj = null,
743 string $a_observer_func =
"" 745 $this->use_meta_data =
true;
746 $this->meta_data_rep_obj = $a_rep_obj;
747 $this->meta_data_sub_obj_id = $a_sub_obj_id;
748 $this->meta_data_type = $a_type;
749 $this->meta_data_observer_obj = $a_observer_obj;
750 $this->meta_data_observer_func = $a_observer_func;
757 $file_download_link = $this->
ctrl->getLinkTarget($this,
"downloadFile");
766 $fullscreen_link = $this->
ctrl->getLinkTarget($this,
"displayMediaFullscreen",
"",
false,
false);
774 if ($this->sourcecode_download_script ==
"" && $this->
getOutputMode() !=
"offline") {
775 $l = $this->
ctrl->getLinkTarget($this,
"");
787 foreach ($this->component_factory->getActivePluginsInSlot(
"pgcp") as
$plugin) {
788 if (
$plugin->isValidParentType($this->getPageObject()->getParentType())) {
789 $xml .=
'<ComponentPlugin Name="' .
$plugin->getPluginName() .
795 $xml =
"<ComponentPlugins>" .
$xml .
"</ComponentPlugins>";
807 $next_class = $this->
ctrl->getNextClass($this);
808 if ($next_class !==
"") {
809 $this->
ctrl->setReturn($this,
"edit");
811 $this->log->debug(
"next_class: " . $next_class);
812 if ($next_class ==
"" && $this->
ctrl->getCmd() ==
"edit") {
813 $this->tabs_gui->clearTargets();
819 switch ($next_class) {
820 case 'ilobjectmetadatagui':
822 $md_gui =
new ilObjectMetaDataGUI($this->meta_data_rep_obj, $this->meta_data_type, $this->meta_data_sub_obj_id);
823 if (is_object($this->meta_data_observer_obj)) {
824 $md_gui->addMDObserver(
825 $this->meta_data_observer_obj,
826 $this->meta_data_observer_func,
831 if ($this->adv_type !=
"") {
832 $md_gui->setAdvMdRecordObject($this->adv_ref_id, $this->adv_type, $this->adv_subtype);
834 $this->
ctrl->forwardCommand($md_gui);
837 case "ileditclipboardgui":
840 $clip_gui->setPageBackTitle($this->page_back_title);
841 $ret = $this->
ctrl->forwardCommand($clip_gui);
846 $html = $this->
edit();
847 $this->tabs_gui->setTabActive(
"edit");
850 case 'ilpublicuserprofilegui':
852 $ret = $this->
ctrl->forwardCommand($profile_gui);
855 case "ilpageeditorgui":
859 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
860 $this->
ctrl->redirect($this,
"preview");
863 $page_editor->setHeader($this->
getHeader());
864 $page_editor->setPageBackTitle($this->page_back_title);
865 $page_editor->setIntLinkReturn($this->int_link_return);
867 $ret = $this->
ctrl->forwardCommand($page_editor);
870 case 'ilnewsitemgui':
872 $news_item_gui->setEnableEdit(
true);
873 $news_item_gui->setContextObjId($this->news_obj_id);
874 $news_item_gui->setContextObjType($this->news_obj_type);
875 $news_item_gui->setContextSubObjId($this->obj->getId());
876 $news_item_gui->setContextSubObjType(
"pg");
878 $ret = $this->
ctrl->forwardCommand($news_item_gui);
881 case "ilpropertyformgui":
883 $this->
ctrl->forwardCommand($form);
886 case "ilinternallinkgui":
887 $this->
lng->loadLanguageModule(
"content");
890 $link_gui->filterLinkType(
"PageObject_FAQ");
891 $link_gui->filterLinkType(
"GlossaryItem");
892 $link_gui->filterLinkType(
"Media_Media");
893 $link_gui->filterLinkType(
"Media_FAQ");
895 $link_gui->setFilterWhiteList(
true);
896 $this->
ctrl->forwardCommand($link_gui);
899 case "ilquestioneditgui":
903 $edit_gui->setSelfAssessmentEditingMode(
true);
904 $ret = $this->
ctrl->forwardCommand($edit_gui);
905 $this->tpl->setContent($ret);
908 case 'ilassquestionfeedbackeditinggui':
916 $this->
lng->loadLanguageModule(
"assessment");
921 $this->requested_q_id
923 $this->requested_q_id
925 $questionGUI->object->setObjId(0);
926 $questionGUI->object->setSelfAssessmentEditingMode(
true);
927 $questionGUI->object->setPreventRteUsage($this->
getPageConfig()->getPreventRteUsage());
931 $this->
ctrl->forwardCommand($gui);
935 case 'ilLearninghistorygui':
941 $hist_gui->setUserId($user_id);
942 $this->
ctrl->forwardCommand($hist_gui);
946 $cmd = $this->
ctrl->getCmd(
"preview");
949 $this->tabs_gui->addNonTabbedLink(
956 $ret = $this->$cmd();
957 if ($this->
getOutputMode() == self::PREVIEW && $cmd ==
"preview") {
963 return (
string) $ret;
971 $this->tabs_gui->clearTargets();
973 $this->tabs_gui->setBackTarget(
974 $this->
lng->txt(
"back"),
975 $this->
ctrl->getLinkTarget($this,
"edit")
978 $this->
ctrl->setParameterByClass(
"ilquestioneditgui",
"q_id", $this->requested_q_id);
979 $this->tabs_gui->addTab(
981 $this->
lng->txt(
"question"),
982 $this->
ctrl->getLinkTargetByClass(
"ilquestioneditgui",
"editQuestion")
985 $this->
ctrl->setParameterByClass(
"ilAssQuestionFeedbackEditingGUI",
"q_id", $this->requested_q_id);
986 $this->tabs_gui->addTab(
988 $this->
lng->txt(
"feedback"),
992 $this->tabs_gui->activateTab($a_active);
1005 $this->
ctrl->redirect($this,
"edit");
1014 $this->
ctrl->redirect($this,
"edit");
1025 $b = $ui->factory()->button()->standard(
1026 $lng->
txt(
"edit_page"),
1027 $this->
ctrl->getLinkTarget($this,
"edit")
1042 $paragraph_plugin_string =
'';
1043 $disable_auto_margins =
'';
1052 $main_tpl->addJavaScript(
"./Services/COPage/js/ilCOPagePres.js");
1055 ilOverlayGUI::initJavascript();
1068 $this->log->debug(
"ilPageObjectGUI, showPage() in edit mode.");
1070 $tpl =
new ilTemplate(
"tpl.page_edit_wysiwyg.html",
true,
true,
"Services/COPage");
1077 $tpl->
setVariable(
"TXT_ADD_COMMENT", $this->
lng->txt(
"cont_add_change_comment"));
1082 $tpl->
setVariable(
"PAGE_CONTAINER_CLASS",
"ilc_page_cont_PageContainer");
1087 $this->
ctrl->getFormActionByClass(
"ilpageeditorgui",
"",
"",
true)
1091 $sel_js_mode =
"enable";
1095 $tpl->
setVariable(
"TXT_CONFIRM_DELETE", $this->
lng->txt(
"cont_confirm_delete"));
1099 if ($sel_js_mode ==
"enable") {
1104 $this->
ctrl->getLinkTargetByClass(
1105 array(
"ilpageeditorgui",
"ilinternallinkgui"),
1114 $editor_init = new \ILIAS\COPage\Editor\UI\Init();
1120 $tpl =
new ilTemplate(
"tpl.page.html",
true,
true,
"Services/COPage");
1134 if ($c_old_nr > 0 || $this->
getCompareMode() || ($this->requested_history_mode == 1)) {
1139 $this->
ctrl->setParameter($this,
"history_mode",
"1");
1142 if (isset($hist_info[
"previous"])) {
1144 $tpl->
setVariable(
"TXT_PREV_REV", $this->
lng->txt(
"cont_previous_rev"));
1145 $this->
ctrl->setParameter($this,
"old_nr", $hist_info[
"previous"][
"nr"]);
1148 $this->
ctrl->getLinkTarget($this,
"preview")
1152 $tpl->
setVariable(
"TXT_PREV_REV", $this->
lng->txt(
"cont_previous_rev"));
1157 if ($c_old_nr > 0) {
1159 $tpl->
setVariable(
"TXT_NEXT_REV", $this->
lng->txt(
"cont_next_rev"));
1160 $this->
ctrl->setParameter($this,
"old_nr", $hist_info[
"next"][
"nr"] ?? 0);
1163 $this->
ctrl->getLinkTarget($this,
"preview")
1169 $tpl->
setVariable(
"TXT_LATEST_REV", $this->
lng->txt(
"cont_latest_rev"));
1170 $this->
ctrl->setParameter($this,
"old_nr",
"");
1173 $this->
ctrl->getLinkTarget($this,
"preview")
1178 $this->
ctrl->setParameter($this,
"history_mode",
"");
1183 $this->
ctrl->setParameter($this,
"old_nr", $c_old_nr);
1186 $this->
ctrl->getLinkTarget($this,
"rollbackConfirmation")
1188 $this->
ctrl->setParameter($this,
"old_nr",
"");
1191 $this->
lng->txt(
"cont_rollback")
1198 $tpl->
setVariable(
"TXT_REVISION", $this->
lng->txt(
"cont_revision"));
1200 "VAL_REVISION_DATE",
1214 $tpl->
setVariable(
"FORMACTION", $this->
ctrl->getFormActionByClass(
"ilpageeditorgui"));
1220 $this->obj->getParentType() .
":pg",
1221 $this->obj->getId(),
1222 $this->obj->getLanguage()
1224 $mob_links = array();
1225 foreach ($links as $link) {
1226 if ($link[
"type"] ==
"mob") {
1234 if (count($mob_links) > 0) {
1236 $tpl->
setVariable(
"TXT_LINKED_MOBS", $this->
lng->txt(
"cont_linked_mobs"));
1241 $tpl->
setVariable(
"TXT_EDIT_MEDIA", $this->
lng->txt(
"cont_edit_mob"));
1242 $tpl->
setVariable(
"TXT_COPY_TO_CLIPBOARD", $this->
lng->txt(
"cont_copy_to_clipboard"));
1253 if (count($snippets) > 0) {
1254 foreach ($snippets as $s) {
1258 $tpl->
setVariable(
"TXT_CONTENT_SNIPPETS_USED", $this->
lng->txt(
"cont_snippets_used"));
1263 $tpl->
setVariable(
"TXT_SHOW_INFO", $this->
lng->txt(
"cont_show_info"));
1272 $tpl->
setVariable(
"TXT_SCHEDULED_ACTIVATION", $this->
lng->txt(
"cont_scheduled_activation"));
1295 $reload_tree = $this->request->getString(
"reloadTree");
1296 if ($reload_tree ==
"y") {
1300 $this->
ctrl->getLinkTargetByClass(
"ilobjlearningmodulegui",
"explorer",
"",
false,
false)
1306 $builded = $this->obj->buildDom();
1312 if (!$this->obj->checkPCIds()) {
1313 $this->obj->insertPCIds();
1314 $this->obj->update(
true,
true);
1317 $this->obj->addFileSizes();
1318 $this->obj->addHierIDs();
1320 $hids = $this->obj->getHierIds();
1321 $row1_ids = $this->obj->getFirstRowIds();
1322 $col1_ids = $this->obj->getFirstColumnIds();
1323 $litem_ids = $this->obj->getListItemIds();
1324 $fitem_ids = $this->obj->getFileItemIds();
1327 $hids = $this->obj->getHierIds();
1328 foreach ($hids as $hid) {
1330 $tpl->
setVariable(
"CONTEXTMENU",
"contextmenu_" . $hid);
1335 foreach ($col1_ids as $hid) {
1337 $tpl->
setVariable(
"CONTEXTMENU",
"contextmenu_r" . $hid);
1342 foreach ($row1_ids as $hid) {
1344 $tpl->
setVariable(
"CONTEXTMENU",
"contextmenu_c" . $hid);
1349 foreach ($litem_ids as $hid) {
1351 $tpl->
setVariable(
"CONTEXTMENU",
"contextmenu_i" . $hid);
1356 foreach ($fitem_ids as $hid) {
1358 $tpl->
setVariable(
"CONTEXTMENU",
"contextmenu_i" . $hid);
1362 $this->obj->addFileSizes();
1369 if (!$this->link_xml_set) {
1381 $template_xml = $style->getTemplateXML();
1382 $disable_auto_margins =
"n";
1383 if ($style->lookupStyleSetting(
"disable_auto_margins")) {
1384 $disable_auto_margins =
"y";
1389 $append_footnotes =
"y";
1391 if (!$this->abstract_pcid) {
1392 $content =
"<dummy><PageObject><PageContent><Paragraph>" .
1393 $this->obj->getFirstParagraphText() . $link_xml .
1394 "</Paragraph></PageContent></PageObject></dummy>";
1396 $append_footnotes =
"n";
1397 $par = $this->obj->getParagraphForPCID($this->abstract_pcid);
1398 $content =
"<dummy><PageObject><PageContent><Paragraph Characteristic='" . $par->getCharacteristic() .
"'>" .
1399 $par->getText() . $link_xml .
1400 "</Paragraph></PageContent></PageObject>" . $this->obj->getMultimediaXML() .
"</dummy>";
1403 $content = $this->obj->getXMLFromDom(
1414 if ($builded !==
true) {
1419 $this->edit_repo->clearPageError();
1438 $enlarge_path =
"images/enlarge.svg";
1442 ?
"ilc_PrintPageTitle" 1447 $enable_split_new = ($this->obj->getParentType() ==
"lm")
1453 if (($this->obj->getParentType() ==
"lm") &&
1455 $this->obj->getParentId(),
1458 $enable_split_next =
"y";
1460 $enable_split_next =
"n";
1481 ? $this->
user->getPref(
"ilPageEditor_MediaMode")
1491 $current_ts = time();
1495 $enable_href =
false;
1499 $params = array(
'mode' => $this->
getOutputMode(),
'pg_title' => htmlentities($pg_title, ENT_QUOTES,
"UTF-8"),
1500 'enable_placeholder' => $cfg->getEnablePCType(
"PlaceHolder") ?
"y" :
"n",
1501 'pg_id' => $this->obj->getId(),
'pg_title_class' => $pg_title_class,
1502 'webspace_path' => $wb_path,
'enlarge_path' => $enlarge_path,
1503 'img_col' => $col_path,
1504 'img_row' => $row_path,
1505 'img_cell' => $cell_path,
1506 'img_item' => $item_path,
1507 'acc_save_url' =>
"./ilias.php?baseClass=ilaccordionpropertiesstoragegui&cmd=setOpenedTab" .
1508 "&user_id=" . $this->
user->getId(),
1509 'append_footnotes' => $append_footnotes,
1511 'enable_split_new' => $enable_split_new,
1512 'enable_split_next' => $enable_split_next,
1516 'img_path' => $img_path,
1517 'parent_id' => $this->obj->getParentId(),
1519 'encoded_download_script' => urlencode($this->sourcecode_download_script),
1520 'enable_rep_objects' => $cfg->getEnablePCType(
"Resources") ?
"y" :
"n",
1521 'enable_login_page' => $cfg->getEnablePCType(
"LoginPageElement") ?
"y" :
"n",
1523 'enable_tabs' => $cfg->getEnablePCType(
"Tabs") ?
"y" :
"n",
1524 'enable_sa_qst' => $cfg->getEnableSelfAssessment() ?
"y" :
"n",
1525 'enable_file_list' => $cfg->getEnablePCType(
"FileList") ?
"y" :
"n",
1526 'enable_content_includes' => $cfg->getEnablePCType(
"ContentInclude") ?
"y" :
"n",
1527 'enable_content_templates' => (count($this->
getPageObject()->getContentTemplates()) > 0) ?
"y" :
"n",
1528 'paste' => $paste ?
"y" :
"n",
1529 'media_mode' => $media_mode,
1530 'javascript' => $sel_js_mode,
1531 'paragraph_plugins' => $paragraph_plugin_string,
1532 'disable_auto_margins' => $disable_auto_margins,
1533 'page_toc' => $cfg->getEnablePageToc() ?
"y" :
"n",
1534 'enable_profile' => $cfg->getEnablePCType(
"Profile") ?
"y" :
"n",
1535 'enable_verification' => $cfg->getEnablePCType(
"Verification") ?
"y" :
"n",
1536 'enable_blog' => $cfg->getEnablePCType(
"Blog") ?
"y" :
"n",
1537 'enable_skills' => $cfg->getEnablePCType(
"Skills") ?
"y" :
"n",
1538 'enable_learning_history' => $cfg->getEnablePCType(
"LearningHistory") ?
"y" :
"n",
1539 'enable_qover' => $cfg->getEnablePCType(
"QuestionOverview") ?
"y" :
"n",
1540 'enable_consultation_hours' => $cfg->getEnablePCType(
"ConsultationHours") ?
"y" :
"n",
1541 'enable_my_courses' => $cfg->getEnablePCType(
"MyCourses") ?
"y" :
"n",
1542 'enable_amd_page_list' => $cfg->getEnablePCType(
"AMDPageList") ?
"y" :
"n",
1543 'current_ts' => $current_ts,
1545 'flv_video_player' => $flv_video_player,
1547 'activated_protection' =>
1549 'protection_text' => $this->
lng->txt(
"cont_sec_protected_text"),
1550 'enable_href' => $enable_href
1552 if ($this->link_frame !=
"") {
1561 $params[
"incl_elements_date"] = $this->obj->getLastUpdateOfIncludedElements();
1567 $md5 = md5(serialize(
$params) . $link_xml . $template_xml . $md5_adds);
1577 $md5 == $this->obj->getRenderMd5() &&
1578 ($this->obj->getLastChange() < $this->obj->getRenderedTime()) &&
1579 $this->obj->getRenderedTime() !=
"" &&
1580 $this->obj->old_nr == 0) {
1582 $output = $this->obj->getRenderedContent();
1584 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
1585 $this->log->debug(
"Calling XSLT, content: " . substr($content, 0, 100));
1587 $args = array(
'/_xml' => $content,
'/_xsl' => $xsl );
1589 $output = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl", null, $args,
$params);
1593 $output =
"<pre>" . $e->getMessage() .
"<br>" . htmlentities($content) .
"</pre>";
1599 && $this->obj->old_nr == 0) {
1600 $this->obj->writeRenderedContent($output, $md5);
1608 $this->
user->getPref(
"ilPageEditor_HTMLMode") !=
"disable")
1610 $output = str_replace(
"<",
"<", $output);
1611 $output = str_replace(
">",
">", $output);
1613 $output = str_replace(
"&",
"&", $output);
1637 $output = str_replace(
"\n",
"", $output);
1644 $output =
'<div class="copg-disabled-page"><div class="ilCopgDisabledText">' . $this->
getDisabledText() .
'</div>' . $output .
'</div>';
1649 foreach ($defs as $def) {
1651 $pc_class = $def[
"pc_class"];
1671 $up_pc = $this->request->getString(
"updated_pc_id_str");
1678 echo $tpl->
get(
"edit_page");
1699 while (is_int($start = strpos($output,
"<!--ParStart-->")) &&
1700 is_int($end = strpos($output,
"<!--ParEnd-->", $start))) {
1701 $output = substr($output, 0, $start) .
1704 array(
"{",
"}"),
1705 substr($output, $start + 15, $end - ($start + 15))
1707 substr($output, $end + 13);
1721 return array(
"deactivatePage" => $this->
lng->txt(
"cont_deactivate_page"),
1722 "activatePage" => $this->
lng->txt(
"cont_activate_page"));
1730 $media_mode = $this->request->getString(
"media_mode");
1731 $html_mode = $this->request->getString(
"html_mode");
1732 $js_mode = $this->request->getString(
"js_mode");
1733 if ($media_mode !=
"") {
1734 if ($media_mode ==
"disable") {
1735 $this->
user->writePref(
"ilPageEditor_MediaMode",
"disable");
1737 $this->
user->writePref(
"ilPageEditor_MediaMode",
"");
1740 if ($html_mode !=
"") {
1741 if ($html_mode ==
"disable") {
1742 $this->
user->writePref(
"ilPageEditor_HTMLMode",
"disable");
1744 $this->
user->writePref(
"ilPageEditor_HTMLMode",
"");
1747 if ($js_mode !=
"") {
1748 if ($js_mode ==
"disable") {
1749 $this->
user->writePref(
"ilPageEditor_JavaScript",
"disable");
1751 $this->
user->writePref(
"ilPageEditor_JavaScript",
"");
1755 $this->
ctrl->redirect($this,
"edit");
1764 bool $a_int_links =
false,
1765 bool $a_wiki_links =
false,
1766 bool $a_keywords =
false,
1768 $a_paragraph_styles =
true,
1769 $a_save_return =
true,
1772 $a_user_links =
false,
1773 \
ILIAS\COPage\Editor\Server\UIWrapper $ui_wrapper = null
1777 $lng = $DIC->language();
1778 $ctrl = $DIC->ctrl();
1781 $style_service = $DIC->contentStyle()->internal();
1782 $style_access_manager = $style_service->domain()->access(
1784 $DIC->user()->getId()
1786 $char_manager = $style_service->domain()->characteristic(
1788 $style_access_manager
1793 $f =
static function (
string $type,
string $code) use ($char_manager, $lng):
string {
1794 $title = $char_manager->getPresentationTitle(
"text_inline", $type);
1795 if ($title === $type) {
1796 $title = $lng->
txt(
"cont_char_style_" . $code);
1803 if ($a_style_id === 0) {
1805 "Comment" => array(
"code" =>
"com",
"txt" =>
$f(
"Comment",
"com")),
1806 "Quotation" => array(
"code" =>
"quot",
"txt" =>
$f(
"Quotation",
"quot")),
1807 "Accent" => array(
"code" =>
"acc",
"txt" =>
$f(
"Accent",
"acc")),
1808 "Code" => array(
"code" =>
"code",
"txt" =>
$f(
"Code",
"code"))
1811 foreach (ilPCParagraphGUI::_getTextCharacteristics($a_style_id,
true) as
$c) {
1812 if (in_array($c, [
"Strong",
"Important",
"Emph"])) {
1815 if (!isset($chars[$c])) {
1816 $title = $char_manager->getPresentationTitle(
"text_inline", $c);
1819 $chars[
"Code"] = array(
"code" =>
"code",
"txt" =>
$f(
"Code",
"code"));
1822 $chars[
"Comment"] = array(
"code" =>
"com",
"txt" =>
$f(
"Comment",
"com"));
1825 $chars[
"Quotation"] = array(
"code" =>
"quot",
"txt" =>
$f(
"Quotation",
"quot"));
1828 $chars[
"Accent"] = array(
"code" =>
"acc",
"txt" =>
$f(
"Accent",
"acc"));
1831 $chars[
$c] = array(
"code" =>
"",
"txt" => $title);
1837 foreach ($chars as
$key => $char) {
1840 "active_" . $char[
"code"],
1846 case "Code": $tag =
"code";
break;
1848 $html =
'<' . $tag .
' class="ilc_' . $t .
'_' .
$key .
'" style="font-size:90%; margin-top:2px; margin-bottom:2px; position:static;">' . $char[
"txt"] .
"</" . $tag .
">";
1849 $char_formats[] = [
"text" => $html,
"action" =>
"selection.format",
"data" => [
"format" =>
$key]];
1854 $numbered_list =
'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 110-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 01-.5-.5V5h-.5a.5.5 0 010-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2H4.5a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 010-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 110-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 110-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"></path></svg>';
1856 $bullet_list =
'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1z" fill-rule="evenodd"></path></svg>';
1858 $indent =
'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"></path></svg>';
1860 $outdent =
'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm1.6-3.8a1 1 0 01-1.2 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 011.2 1.6L6.8 12l1.8 1.2z" fill-rule="evenodd"></path></svg>';
1866 if ($aset->get(
"use_physical")) {
1872 foreach ([
"str",
"emp",
"imp",
"sup",
"sub"] as $c) {
1880 $c_formats[] = [
"text" =>
'<span class="ilc_text_inline_Strong">' . $str .
'</span>',
1881 "action" =>
"selection.format",
1882 "data" => [
"format" =>
"Strong"],
1883 "aria-label" => $lng->
txt(
"cont_text_str")
1887 $c_formats[] = [
"text" =>
'<span class="ilc_text_inline_Emph">' . $emp .
'</span>',
1888 "action" =>
"selection.format",
1889 "data" => [
"format" =>
"Emph"],
1890 "aria-label" => $lng->
txt(
"cont_text_emp")
1894 $c_formats[] = [
"text" =>
'<span class="ilc_text_inline_Important">' . $imp .
'</span>',
1895 "action" =>
"selection.format",
1896 "data" => [
"format" =>
"Important"],
1897 "aria-label" => $lng->
txt(
"cont_text_imp")
1901 $c_formats[] = [
"text" =>
'x<sup>2</sup>',
1902 "action" =>
"selection.format",
1903 "data" => [
"format" =>
"Sup"],
1904 "aria-label" => $lng->
txt(
"cont_text_sup")
1908 $c_formats[] = [
"text" =>
'x<sub>2</sub>',
1909 "action" =>
"selection.format",
1910 "data" => [
"format" =>
"Sub"],
1911 "aria-label" => $lng->
txt(
"cont_text_sub")
1917 $c_formats[] = [
"text" =>
"<i>A</i>",
1918 "action" => $char_formats,
1919 "aria-label" => $lng->
txt(
"copg_more_character_formats")
1921 $c_formats[] = [
"text" =>
'<i><b><u>T</u></b><sub>x</sub></i>',
1922 "action" =>
"selection.removeFormat",
1924 "aria-label" => $lng->
txt(
"copg_remove_formats")
1927 "cont_char_format" => $c_formats,
1930 "text" => $bullet_list,
1931 "action" =>
"list.bullet",
1933 "aria-label" => $lng->
txt(
"cont_bullet_list")
1936 "text" => $numbered_list,
1937 "action" =>
"list.number",
1939 "aria-label" => $lng->
txt(
"cont_numbered_list")
1943 "action" =>
"list.outdent",
1945 "aria-label" => $lng->
txt(
"cont_list_outdent")
1949 "action" =>
"list.indent",
1951 "aria-label" => $lng->
txt(
"cont_list_indent")
1960 if ($a_wiki_links) {
1961 $links[] = [
"text" => $lng->
txt(
"cont_wiki_link_dialog"),
"action" =>
"link.wikiSelection",
"data" => [
1963 $links[] = [
"text" =>
"[[" . $lng->
txt(
"cont_wiki_page") .
"]]",
"action" =>
"link.wiki",
"data" => []];
1966 $links[] = [
"text" => $lng->
txt(
"cont_text_iln_link"),
"action" =>
"link.internal",
"data" => []];
1973 $links[] = [
"text" => $lng->
txt(
"cont_text_xln"),
"action" =>
"link.external",
"data" => []];
1975 if ($a_user_links) {
1976 $links[] = [
"text" => $lng->
txt(
"cont_link_user"),
"action" =>
"link.user",
"data" => []];
1981 $menu[
"cont_more_functions"] = [];
1982 $menu[
"cont_more_functions"][] = [
"text" => $lng->
txt(
"cont_link") .
'<i class="mce-ico mce-i-link"></i>',
"action" => $links];
1985 $menu[
"cont_more_functions"][] = [
"text" => $lng->
txt(
"cont_keyword"),
"action" =>
"selection.keyword",
"data" => []];
1994 $menu[
"cont_more_functions"][] = [
"text" =>
'Tex',
"action" =>
"selection.tex",
"data" => []];
2002 $menu[
"cont_more_functions"][] = [
"text" => $lng->
txt(
"cont_footnote"),
"action" =>
"selection.fn",
"data" => []];
2005 $menu[
"cont_more_functions"][] = [
"text" => $lng->
txt(
"cont_anchor"),
"action" =>
"selection.anchor",
"data" => []];
2008 $btpl =
new ilTemplate(
"tpl.tiny_menu.html",
true,
true,
"Services/COPage");
2010 foreach ($menu as $section_title => $section) {
2011 foreach ($section as $item) {
2012 if (is_array($item[
"action"])) {
2014 foreach ($item[
"action"] as
$i) {
2015 $buttons[] = $ui_wrapper->getButton(
2021 $i[
"aria-label"] ??
"" 2024 $dd = $ui->factory()->dropdown()->standard($buttons)->withLabel($item[
"text"])
2025 ->withAriaLabel($item[
"aria-label"] ??
"");
2026 $btpl->setCurrentBlock(
"button");
2027 $btpl->setVariable(
"BUTTON", $ui->renderer()->renderAsync($dd));
2029 $b = $ui_wrapper->getRenderedButton(
2035 $item[
"aria-label"] ??
"" 2037 $btpl->setCurrentBlock(
"button");
2038 $btpl->setVariable(
"BUTTON",
$b);
2040 $btpl->parseCurrentBlock();
2042 $btpl->setCurrentBlock(
"section");
2043 $btpl->setVariable(
"TXT_SECTION", $lng->
txt($section_title));
2044 $btpl->parseCurrentBlock();
2048 if ($a_paragraph_styles) {
2049 $sel = new \ILIAS\COPage\Editor\Components\Paragraph\ParagraphStyleSelector($ui_wrapper, $a_style_id);
2050 $dd = $sel->getStyleSelector(
"");
2051 $btpl->setCurrentBlock(
"par_edit");
2052 $btpl->setVariable(
"TXT_PAR_FORMAT", $lng->
txt(
"cont_par_format"));
2054 $btpl->setVariable(
"STYLE_SELECTOR", $ui->renderer()->render($dd));
2056 $btpl->parseCurrentBlock();
2060 $sel = new \ILIAS\COPage\Editor\Components\Section\SectionStyleSelector($ui_wrapper, $a_style_id);
2061 $dd = $sel->getStyleSelector(
"", $type =
"par-action", $action =
"sec.class", $attr =
"class",
true);
2062 $btpl->setVariable(
"TXT_BLOCK", $lng->
txt(
"cont_sur_block_format"));
2063 $btpl->setVariable(
"BLOCK_STYLE_SELECTOR", $ui->renderer()->render($dd));
2066 $btpl->setVariable(
"TINY_HEADER", $lng->
txt(
"cont_text_editing"));
2069 $ui_wrapper->getRenderedButton($lng->
txt(
"cont_quit_text_editing"),
"par-action",
"save.return")
2078 $btpl->setVariable(
"TXT_SAVING", $lng->
txt(
"cont_saving"));
2082 "ilAdvSelListAnchorElement_char_style_selection",
2083 $lng->
txt(
"cont_more_character_styles"),
2087 return $btpl->get();
2093 $this->page_linker->setOffline($this->
getOutputMode() == self::OFFLINE);
2094 $this->
setLinkXml($this->page_linker->getLinkXML($this->getPageObject()->getInternalLinks()));
2099 $this->link_xml =
$xml;
2100 $this->link_xml_set =
true;
2106 if ($this->profile_back_url !=
"") {
2113 return $this->
ctrl->getLinkTargetByClass(strtolower(get_class($this)),
"preview");
2118 $this->profile_back_url =
$url;
2125 $download_ok =
false;
2128 $pg_obj->buildDom();
2129 $int_links = $pg_obj->getInternalLinks();
2131 foreach ($int_links as $il) {
2132 if ($il[
"Target"] == str_replace(
"_file_",
"_dfile_", $req_file_id)) {
2133 $file = explode(
"_", $req_file_id);
2134 $file_id = (
int) $file[count($file) - 1];
2135 $download_ok =
true;
2138 if (in_array($req_file_id, $pg_obj->getAllFileObjIds())) {
2139 $file = explode(
"_", $req_file_id);
2140 $file_id = (
int) $file[count($file) - 1];
2141 $download_ok =
true;
2145 foreach ($pcs as $pc) {
2146 $files = ilObjFile::_getFilesOfObject(
"mep:pg", $pc[
"id"], 0);
2147 $file = explode(
"_", $req_file_id);
2148 $file_id = (
int) $file[count($file) - 1];
2149 if (in_array($file_id, $files)) {
2150 $download_ok =
true;
2155 $fileObj =
new ilObjFile($file_id,
false);
2156 $fileObj->sendFile();
2168 $tpl =
new ilGlobalTemplate(
"tpl.fullscreen.html",
true,
true,
"Modules/LearningModule");
2175 $link_xml = $this->page_linker->getLinkXML($med_links);
2178 if ($this->request->getPageType() ===
"mep") {
2183 $pg_obj->buildDom();
2186 if ($this->requested_pg_id > 0) {
2187 $xml .= $pg_obj->getMediaAliasElement($this->request->getMobId());
2195 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
2196 $args = array(
'/_xml' =>
$xml,
'/_xsl' => $xsl );
2200 if ($a_fullscreen) {
2201 $mode =
"fullscreen";
2208 $params = array(
'mode' => $mode,
'enlarge_path' => $enlarge_path,
2209 'link_params' =>
"ref_id=" . $this->requested_ref_id,
'fullscreen_link' =>
"",
2211 'ref_id' => $this->requested_ref_id,
'webspace_path' => $wb_path);
2212 $output = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl", null, $args,
$params);
2237 $pg_obj->send_paragraph(
2238 $this->request->getString(
"par_id"),
2239 $this->request->getString(
"downloadtitle")
2248 while (is_int($pos = strpos($a_output,
"ilPageTocH", $cpos))) {
2253 $page_heads = array();
2254 foreach ($offsets as $os) {
2255 $level = (
int) substr($a_output, $os + 10, 1);
2256 if (in_array($level, array(1,2,3))) {
2257 $anchor = str_replace(
2260 substr($a_output, $os, strpos($a_output,
"-->", $os) - $os)
2264 $tag_start = stripos($a_output,
"<h" . $level .
" ", $os);
2265 $tag_end = stripos($a_output,
"</h" . $level .
">", $tag_start);
2266 $head = substr($a_output, $tag_start, $tag_end - $tag_start);
2269 $text_start = stripos($head,
">") + 1;
2270 $text_end = strripos($head,
"<!--", $text_start);
2271 $text = substr($head, $text_start, $text_end - $text_start);
2272 $page_heads[] = array(
"level" => $level,
"text" => $text,
2273 "anchor" => $anchor);
2276 if (count($page_heads) > 1) {
2278 $list->setAutoNumbering(
true);
2279 $list->setListClass(
"ilc_page_toc_PageTOCList");
2280 $list->setItemClass(
"ilc_page_toc_PageTOCItem");
2285 $page_toc_ph =
"<!--PageTocPH-->";
2286 foreach ($page_heads as $ind => $h) {
2292 if ($h[
"level"] == 2 && $c_par[1] > 0) {
2295 if ($h[
"level"] == 3 && $c_par[2] > 0) {
2299 $h[
"text"] = str_replace($page_toc_ph,
"", $h[
"text"]);
2303 "<a href='#" . $h[
"anchor"] .
"' class='ilc_page_toc_PageTOCLink'>" . $h[
"text"] .
"</a>",
2309 if ($h[
"level"] == 1) {
2313 if ($h[
"level"] == 2) {
2319 "tpl.page_toc.html",
2325 $tpl->
setVariable(
"TXT_PAGE_TOC", $this->
lng->txt(
"cont_page_toc"));
2329 $a_output = str_replace(
2330 "{{{{{PageTOC}}}}}",
2334 $numbers = $list->getNumbers();
2336 if (count($numbers) > 0) {
2337 foreach ($numbers as $n) {
2338 $a_output = (strpos($a_output, $page_toc_ph) !==
false)
2339 ? substr_replace($a_output, $n .
" ", strpos($a_output, $page_toc_ph), strlen($page_toc_ph))
2344 $a_output = str_replace(
2345 "{{{{{PageTOC}}}}}",
2372 $a_output = str_replace(
2373 "{{{{{LV_show_adv}}}}}",
2374 $this->
lng->txt(
"cont_show_adv"),
2377 $a_output = str_replace(
2378 "{{{{{LV_hide_adv}}}}}",
2379 $this->
lng->txt(
"cont_hide_adv"),
2383 $a_output = str_replace(
2384 "{{{{{LV_show_adv}}}}}",
2388 $a_output = str_replace(
2389 "{{{{{LV_hide_adv}}}}}",
2420 $this->tabs_gui->activateTab(
"cont_preview");
2429 $collection = $this->tool_context->current()->getAdditionalData();
2441 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
2442 $this->
ctrl->redirect($this,
"preview");
2447 if ($ptype ==
"cont" && $this->requested_ref_id > 0) {
2451 $this->
help->setScreenId(
"edit_" . $ptype);
2461 $this->
lng->toJS(
"paste");
2462 $this->
lng->toJS(
"delete");
2463 $this->
lng->toJS(
"cont_delete_content");
2464 $this->
lng->toJS(
"copg_confirm_el_deletion");
2465 $this->
lng->toJS(
"cont_saving");
2466 $this->
lng->toJS(
"cont_ed_par");
2467 $this->
lng->toJS(
"cont_no_block");
2468 $this->
lng->toJS(
"copg_error");
2469 $this->
lng->toJS(
"cont_ed_click_to_add_pg");
2470 $this->
lng->toJS(
"cont_ed_new_item_after");
2471 $this->
lng->toJS(
"cont_ed_new_item_before");
2472 $this->
lng->toJS(
"cont_ed_item_up");
2473 $this->
lng->toJS(
"cont_ed_item_down");
2474 $this->
lng->toJS(
"cont_ed_delete_item");
2475 $this->
lng->toJS(
"copg_edit_iframe_title");
2476 $this->
lng->toJS(
"copg_par_format_selection");
2479 $this->tpl->addJavaScript(
"./Services/UIComponent/AdvancedSelectionList/js/AdvancedSelectionList.js");
2486 $info = $this->
lng->txt(
"content_no_edit_lock");
2488 $info .=
"</br>" . $this->
lng->txt(
"content_until") .
": " .
2490 $info .=
"</br>" . $this->
lng->txt(
"obj_usr") .
": " .
2493 $back_link = $this->
ui->factory()->link()->standard(
2494 $this->
lng->txt(
"back"),
2495 $this->
ctrl->getLinkTarget($this,
"finishEditing")
2498 $mbox = $this->
ui->factory()->messageBox()->info($info)
2499 ->withLinks([$back_link]);
2500 $rendered_mbox = $this->
ui->renderer()->render($mbox);
2502 if (!$this->
ctrl->isAsynch()) {
2503 $this->tpl->setContent($rendered_mbox);
2505 echo $rendered_mbox;
2527 $info = $this->
lng->txt(
"cont_got_lock_release");
2530 $mbox = $ui->factory()->messageBox()->info($info);
2532 return $ui->renderer()->render($mbox);
2537 $pl_pc_id = $this->request->getPlaceholderPCId();
2538 $this->obj->buildDom();
2539 $this->obj->addHierIDs();
2541 return $this->
edit();
2562 $this->tpl =
new ilGlobalTemplate(
"tpl.fullscreen.html",
true,
true,
"Services/COPage");
2563 $this->tpl->setCurrentBlock(
"ContentStyle");
2564 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", 0);
2565 $this->tpl->parseCurrentBlock();
2567 $this->tpl->setVariable(
2572 $this->tpl->setCurrentBlock(
"ilMedia");
2575 if ($this->requested_pg_id > 0) {
2577 $pg_obj->buildDom();
2582 $xml .= $pg_obj->getMediaAliasElement($this->request->getMobId());
2592 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
2593 $args = array(
'/_xml' =>
$xml,
'/_xsl' => $xsl );
2597 $mode =
"fullscreen";
2598 $params = array(
'mode' => $mode,
2600 'webspace_path' => $wb_path);
2601 $output = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl", null, $args,
$params);
2606 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
2616 if (is_array($a_error)) {
2617 $error_str =
"<b>Error(s):</b><br>";
2618 foreach ($a_error as $error) {
2619 $err_mess = implode(
" - ", $error);
2620 if (!is_int(strpos($err_mess,
":0:"))) {
2621 $error_str .= htmlentities($err_mess) .
"<br />";
2624 $this->tpl->setVariable(
"MESSAGE", $error_str);
2630 $this->tabs_gui->clearTargets();
2631 $this->tabs_gui->setBackTarget(
2632 $this->
lng->txt(
"back"),
2633 $this->
ctrl->getLinkTarget($this,
"edit")
2648 $this->tpl->addJavaScript(
"./Services/COPage/js/page_history.js");
2651 $table_gui->setId(
"hist_table");
2658 'sortkey' => 999999,
2660 $table_gui->setData($entries);
2661 return $table_gui->getHTML();
2676 $this->
ctrl->setParameter($this,
"rollback_nr", $this->requested_old_nr);
2677 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"rollback"));
2678 $c_gui->setHeaderText($this->
lng->txt(
"cont_rollback_confirmation"));
2679 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"history");
2680 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"rollback");
2682 $hentry = $this->obj->getHistoryEntry($this->requested_old_nr);
2686 $this->requested_old_nr,
2690 $this->tpl->setContent($c_gui->getHTML());
2702 $hentry = $this->obj->getHistoryEntry(
2703 $this->request->getString(
"rollback_nr")
2706 if ($hentry[
"content"] !=
"") {
2707 $this->obj->setXMLContent($hentry[
"content"]);
2708 $this->obj->buildDom(
true);
2709 if ($this->obj->update()) {
2710 $this->
ctrl->redirect($this,
"history");
2713 $this->
ctrl->redirect($this,
"history");
2718 $this->
help->setScreenIdComponent(
"copg");
2721 public function getTabs(
string $a_activate =
""): void
2734 $this->tabs_gui->addTarget(
"pg", $this->
ctrl->getLinkTarget($this,
"preview"), array(
"",
"preview"));
2736 $this->tabs_gui->addTarget(
"cont_preview", $this->
ctrl->getLinkTarget($this,
"preview"), array(
"",
"preview"));
2739 if ($this->use_meta_data) {
2741 $this->meta_data_rep_obj,
2742 $this->meta_data_type,
2743 $this->meta_data_sub_obj_id
2745 $mdtab = $mdgui->getTab();
2747 $this->tabs_gui->addTarget(
2751 "ilobjectmetadatagui" 2771 if ($this->
getPageConfig()->getEnableScheduledActivation()) {
2772 $this->tabs_gui->addTarget(
2774 $this->
ctrl->getLinkTarget($this,
"editActivation"),
2781 $this->tabs_gui->addTarget(
2783 $this->
ctrl->getLinkTargetByClass(
"ilnewsitemgui",
"editNews"),
2790 if (is_array($this->tab_hook)) {
2791 $func = $this->tab_hook[
"func"];
2792 $this->tab_hook[
"obj"]->$func();
2805 $tpl =
new ilTemplate(
"tpl.page_compare.html",
true,
true,
"Services/COPage");
2806 $compare = $this->obj->compareVersion(
2807 $this->request->getInt(
"left"),
2808 $this->request->getInt(
"right")
2812 $lpage = $compare[
"l_page"];
2814 $cfg->setPreventHTMLUnmasking(
true);
2823 $lhtml = str_replace(
"<br />",
"<br />", $lhtml);
2827 $rpage = $compare[
"r_page"];
2835 $rhtml = str_replace(
"<br />",
"<br />", $rhtml);
2839 $tpl->
setVariable(
"TXT_MODIFIED", $this->
lng->txt(
"cont_pc_modified"));
2840 $tpl->
setVariable(
"TXT_DELETED", $this->
lng->txt(
"cont_pc_deleted"));
2847 $a_html = str_replace(
"[ilDiffInsStart]",
'<span class="ilDiffIns">', $a_html);
2848 $a_html = str_replace(
"[ilDiffDelStart]",
'<span class="ilDiffDel">', $a_html);
2849 $a_html = str_replace(
"[ilDiffInsEnd]",
'</span>', $a_html);
2850 $a_html = str_replace(
"[ilDiffDelEnd]",
'</span>', $a_html);
2862 $atpl =
new ilTemplate(
"tpl.page_activation.php",
true,
true,
"Services/COPage");
2865 $atpl->setVariable(
"FORM", $this->
form->getHTML());
2866 $atpl->setCurrentBlock(
"updater");
2867 $atpl->setVariable(
"UPDATER_FRAME", $this->exp_frame);
2868 $atpl->setVariable(
"EXP_ID_UPDATER", $this->exp_id);
2869 $atpl->setVariable(
"HREF_UPDATER", $this->exp_target_script);
2870 $atpl->parseCurrentBlock();
2871 $this->tpl->setContent($atpl->get());
2880 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
2881 $this->
form->setTitle($this->
lng->txt(
"cont_page_activation"));
2885 $rad_op1 =
new ilRadioOption($this->
lng->txt(
"cont_activated"),
"activated");
2887 $rad->addOption($rad_op1);
2888 $rad_op2 =
new ilRadioOption($this->
lng->txt(
"cont_deactivated"),
"deactivated");
2889 $rad->addOption($rad_op2);
2890 $rad_op3 =
new ilRadioOption($this->
lng->txt(
"cont_scheduled_activation"),
"scheduled");
2893 $dt_prop->setRequired(
true);
2894 $dt_prop->setShowTime(
true);
2898 $dt_prop2->setShowTime(
true);
2899 $rad_op3->addSubItem($dt_prop2);
2903 $cb->
setInfo($this->
lng->txt(
"cont_show_activation_info_info"));
2904 $rad_op3->addSubItem($cb);
2907 $rad->addOption($rad_op3);
2909 $this->
form->addCommandButton(
"saveActivation", $this->
lng->txt(
"save"));
2911 $this->
form->addItem($rad);
2919 $activation =
"deactivated";
2921 $activation =
"activated";
2924 $dt_prop = $this->
form->getItemByPostVar(
"start");
2926 $activation =
"scheduled";
2932 $dt_prop = $this->
form->getItemByPostVar(
"end");
2934 $activation =
"scheduled";
2941 $this->
form->getItemByPostVar(
"activation")->setValue($activation);
2942 $this->
form->getItemByPostVar(
"show_activation_info")->setChecked($this->
getPageObject()->getShowActivationInfo());
2952 if ($this->
form->checkInput()) {
2957 $this->request->getString(
"show_activation_info")
2959 $activation = $this->request->getString(
"activation");
2960 if ($activation ==
"deactivated") {
2963 if ($activation ==
"scheduled") {
2973 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
2974 $this->
ctrl->redirect($this,
"editActivation");
2976 $this->
form->setValuesByPost();
2977 $this->tpl->setContent($this->
form->getHTML());
2984 object $a_content_object = null,
2985 bool $a_enable_private_notes =
true,
2986 bool $a_enable_public_notes =
false,
2987 bool $a_enable_notes_deletion =
false,
2988 callable $a_callback = null,
2989 bool $export =
false 2992 if (!$a_content_object) {
2994 $this->notes_parent_id,
2995 $this->obj->getId(),
2999 $a_enable_private_notes =
true;
3000 $a_enable_public_notes =
true;
3001 $a_enable_notes_deletion =
false;
3007 $a_content_object->getParentId(),
3008 $a_content_object->getId(),
3009 $a_content_object->getParentType()
3014 if ($a_enable_private_notes) {
3015 $notes_gui->enablePrivateNotes();
3017 if ($a_enable_public_notes) {
3018 $notes_gui->enablePublicNotes();
3019 if ($a_enable_notes_deletion) {
3020 $notes_gui->enablePublicNotesDeletion(
true);
3024 $notes_gui->setExportMode();
3028 $notes_gui->addObserver($a_callback);
3031 $next_class = $this->
ctrl->getNextClass($this);
3032 if ($next_class ==
"ilnotegui") {
3033 $html = $this->
ctrl->forwardCommand($notes_gui);
3035 $html = $notes_gui->getCommentsHTML();
3046 $this->request->getString(
"type"),
3047 $this->request->getString(
"id"),
3048 $this->request->getString(
"answer")
3064 $this->tabs_gui->activateTab(
"edit");
3066 $this->tpl->setContent($form->
getHTML());
3076 $ac->setInternalLinkDefault(
"Media_Media", 0);
3077 $ac->setInternalLinkFilterTypes(array(
"PageObject_FAQ",
"GlossaryItem",
"Media_Media",
"Media_FAQ"));
3078 $val = $this->obj->getInitialOpenedContent();
3079 if (($val[
"id"] ??
'') !=
"" && ($val[
"type"] ??
'') !=
"") {
3080 $ac->setValue($val[
"type"] .
"|" . $val[
"id"] .
"|" . $val[
"target"]);
3087 $form->
setTitle($this->
lng->txt(
"cont_initial_attached_content"));
3095 $this->obj->saveInitialOpenedContent(
3096 $this->request->getString(
"opened_content_ajax_type"),
3097 $this->request->getInt(
"opened_content_ajax_id"),
3098 $this->request->getString(
"opened_content_ajax_target")
3101 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"));
3102 $this->
ctrl->redirect($this,
"edit");
3115 $l = $this->request->getString(
"totransl");
3121 $this->
ctrl->setParameter($this,
"transl", $l);
3122 $this->
ctrl->redirect($this,
"edit");
3130 $l = $this->request->getString(
"totransl");
3131 $this->
ctrl->setParameter($this,
"totransl", $l);
3132 $this->
lng->loadLanguageModule(
"meta");
3135 $cgui->setFormAction($this->
ctrl->getFormAction($this));
3136 $cgui->setHeaderText($this->
lng->txt(
"cont_page_translation_does_not_exist") .
": " .
3137 $this->
lng->txt(
"meta_l_" . $l));
3138 $cgui->setCancel($this->
lng->txt(
"cancel"),
"editMasterLanguage");
3139 $cgui->setConfirm($this->
lng->txt(
"confirm"),
"createPageTranslation");
3140 $this->tpl->setContent($cgui->getHTML());
3148 $this->
ctrl->setParameter($this,
"transl",
"-");
3149 $this->
ctrl->redirect($this,
"edit");
3157 $l = $this->request->getString(
"totransl");
3165 $p->copyPageToTranslation($l);
3166 $this->
ctrl->setParameter($this,
"transl", $l);
3167 $this->
ctrl->redirect($this,
"edit");
3176 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"cont_page_lock_released"),
true);
3182 $this->
ctrl->redirect($this,
"preview");
3204 foreach ($collector->getJavascriptFiles() as $js) {
3208 foreach ($collector->getCssFiles() as $css) {
3212 foreach ($collector->getOnloadCode() as $code) {
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
static getWebspaceDir(string $mode="filesystem")
get webspace directory
string $template_output_var
setLinkFrame(string $l_frame="")
setEditPreview(bool $a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
history()
Get history table as HTML.
releasePageLock()
Release page lock.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getTinyMenu(string $a_par_type, bool $a_int_links=false, bool $a_wiki_links=false, bool $a_keywords=false, $a_style_id=0, $a_paragraph_styles=true, $a_save_return=true, $a_anchors=false, $a_save_new=true, $a_user_links=false, \ILIAS\COPage\Editor\Server\UIWrapper $ui_wrapper=null)
Get Tiny Menu.
string $exp_target_script
const SEC_PROTECT_PROTECTED
setOpenPlaceHolder(string $a_val)
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupSettingByParentType(string $a_par_type, string $a_name, string $a_default='0')
Lookup setting by parent type.
saveInitialOpenedContent()
setActivationListener(object $a_obj, string $a_meth)
string $open_place_holder
static getInitHTML(string $a_url)
Get initialisation HTML to use internal link editing.
rollbackConfirmation()
Rollback confirmation.
setEditorToolContext()
Set editor tool context.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initActivationForm()
Init activation form.
static getPlaceHolderStylePath()
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
postOutputProcessing(string $a_output)
Finalizing output processing.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Editing session repository.
static _getQuestionType(int $question_id)
string $meta_data_observer_func
editMasterLanguage()
Edit master language.
ILIAS COPage PageLinker $page_linker
static getLogger(string $a_component_id)
Get component logger.
static collectContentIncludes(ilPageObject $a_page, DOMDocument $a_domdoc)
get all content includes that are used within the page
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="ilpublicuserprofilegui")
Default behaviour is:
enableNotes(bool $a_enabled, int $a_parent_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
setViewPageLink(string $a_link, string $a_target="")
set link for "view page" button
static initDateTimePicker()
setParentType(string $a_val)
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
special template class to simplify handling of ITX/PEAR
setOutputMode(string $a_mode=self::PRESENTATION)
touchBlock(string $block)
overwrites ITX::touchBlock.
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
ilObject $meta_data_rep_obj
setPageBackTitle(string $a_title)
Class ChatMainBarProvider .
replaceCurlyBrackets(string $output)
setPageLinker(\ILIAS\COPage\PageLinker $page_linker)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
compareVersion()
Compares two revisions of the page.
static initJS(ilGlobalTemplateInterface $a_main_tpl=null)
getAdvMdRecordObject()
Get adv md record type.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(strpos($jquery_path, './')===0) elseif(strpos($jquery_path, '.')===0) $mathJaxSetting
int $requested_history_mode
User Interface for NewsItem entities.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
setLanguage(string $a_val)
setCompareMode(bool $a_val)
setTemplateTargetVar(string $a_variable)
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
static getPCDefinitions()
confirmPageTranslationCreation()
Confirm page translation creation.
setPageConfig(ilPageConfig $a_val)
static lookupTitle(int $a_page_id)
setEnabledPageFocus(bool $a_enabledpagefocus)
presentation(string $a_mode=self::PRESENTATION)
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
EditSessionRepository $edit_repo
setOfflineDirectory(string $offdir)
setHeader(string $a_title="")
setQEditTabs(string $a_active)
Set question editing tabs.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
showEditToolbar()
Show edit toolbar.
executeCommand()
execute command
static getUsagesOfPage(int $a_usage_id, string $a_usage_type, int $a_hist_nr=0, bool $a_all_hist_nrs=false, string $a_lang="-")
Get page content usages for page.
getActivationFormValues()
Get values for activation form.
saveActivation()
Save Activation.
switchToLanguage()
Switch to language.
insertResources(string $a_output)
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
static saveQuestionAnswer(string $a_type, int $a_id, string $a_answer)
static hasSuccessorPage(int $a_cont_obj_id, int $a_page_id)
checks if page has a successor page
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setStyleId(int $a_styleid)
replaceDiffTags(string $a_html)
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
const CMD_SHOW
command constants
previewHistory()
Preview history.
string $requested_file_id
setTabHook(object $a_object, string $a_function)
setTemplateOutput(bool $a_output=true)
isEnabledChangeComments()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static insertResourcesIntoPageContent(string $a_content)
Insert resources (see also ilContainerContentGUI::determinePageEmbeddedBlocks for presentation) ...
static addJavaScript(ilGlobalTemplate $main_tpl=null)
Add javascript files that are necessary to run accordion.
determineSourcecodeDownloadScript()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setAdvMdRecordObject(int $a_adv_ref_id, string $a_adv_type, string $a_adv_subtype="-")
Set object, that defines the adv md records being used.
addResourcesToTemplate(ilGlobalTemplateInterface $tpl)
Add resources to template.
determineFullscreenLink()
static getCharStyleSelector(string $a_par_type, bool $a_use_callback=true, int $a_style_id=0)
Get character style selector.
setUseObjectTitleHeader(bool $a_val)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
int $meta_data_sub_obj_id
string $presentation_title
static addCss()
Add required css.
static _lookupTitle(int $obj_id)
__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="")
setRenderPageContainer(bool $a_val)
setRawPageContent(bool $a_rawpagecontent)
Set Get raw page content only.
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
setEnabledHref(bool $enable)
getComponentPluginsXML()
Put information about activated plugins into XML.
ilGlobalTemplateInterface $tpl
getEnablePCType(string $a_pc_type)
object $meta_data_observer_obj
determineFileDownloadLink()
setPageObject(ilPageObject $a_pg_obj)
setAbstractOnly(bool $a_val, string $pcid="")
Get only abstract (first text paragraph)
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
enableChangeComments(bool $a_enabled)
download_paragraph()
download source code paragraph
ilComponentFactory $component_factory
bool $enabledcontentincludes
static initjQueryUI(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components.txt for included components)
setFullscreenLink(string $a_fullscreen_link)
getTabs(string $a_activate="")
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.
setSourcecodeDownloadScript(string $script_name)
setPresentationTitle(string $a_title="")
string $file_download_link
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
form( $class_path, string $cmd)
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
editActivation()
Edit activation (only, if scheduled page activation is activated in administration) ...
displayMedia(bool $a_fullscreen=false)
getActivationCaptions()
Get captions for activation action menu entries.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
static isActivated()
Checks whether Map feature is activated.
setFileDownloadLink(string $a_download_link)
bool $render_page_container
setQuestionHTML(array $question_html)
initialOpenedContent()
Initially opened content.
rollback()
Rollback to a previous version.
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.
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
static getInstance()
Singleton: get instance for use in ILIAS requests with a config loaded from the settings.
ilPageConfig $page_config
setTemplate(ilGlobalTemplateInterface $main_tpl)
setEditMode()
Set edit mode.
onFeedbackEditingForwarding()
getAdditionalPageActions()
Get additional page actions.
string $offline_directory
static getFlashVideoPlayerFilename(bool $a_fullpath=false)
initPageObject()
Init page object.
showPage()
display content of page
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.
setIntLinkReturn(string $a_return)
Page component editing request.
insertPageToc(string $a_output)
getSourcecodeDownloadScript()
setOldNr(int $a_val)
Set old nr (historic page)
processAnswer()
Process answer.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
string $sourcecode_download_script
static _lookupType(int $id, bool $reference=false)
setProfileBackUrl(string $url)
setEnabledTabs(bool $a_enabledtabs)
setEnabledNews(bool $a_enabled, int $a_news_obj_id=0, string $a_news_obj_type="")
static getCacheTriggerString(ilPageObject $a_page)
Get page cache update trigger string.
setPrependingHtml(string $a_prependinghtml)
isPageContainerToBeRendered()
createPageTranslation()
Create page translation.
showMediaFullscreen(int $a_style_id=0)
show fullscreen view of media object
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
Get page object instance.
setEnablePCType(string $a_pc_type, bool $a_val)
insertAdvTrigger(string $a_output)
Insert adv content trigger.
static initMediaElementJs(ilGlobalTemplateInterface $a_tpl=null)
Init mediaelement.js scripts.
setLinkParams(string $l_params="")
setTabs(ilTabsGUI $a_tabs)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setEnableEditing(bool $a_enableediting)
displayValidationError($a_error)
display validation error
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.