36 public const EDIT =
"edit";
40 protected \ILIAS\TestQuestionPool\Questions\PublicInterface
$questioninfo;
41 protected \ILIAS\COPage\Page\PageManager
$pm;
42 protected \ILIAS\COPage\Link\LinkManager
$link;
43 protected \ILIAS\COPage\InternalGUIService
$gui;
45 protected \ILIAS\COPage\Xsl\XslManager
$xsl;
47 protected \ILIAS\Notes\Service
$notes;
113 protected \ILIAS\DI\UIServices
$ui;
142 protected \ILIAS\COPage\Compare\PageCompare
$compare;
152 string $a_parent_type,
155 bool $a_prevent_get_id =
false,
157 string $concrete_lang =
"" 162 $this->tpl = $DIC->ui()->mainTemplate();
163 $this->
ctrl = $DIC->ctrl();
164 $this->
lng = $DIC->language();
165 $this->tabs_gui = $DIC->tabs();
166 $this->
access = $DIC->access();
167 $this->
user = $DIC->user();
168 $this->
help = $DIC[
"ilHelp"];
169 $this->
ui = $DIC->ui();
170 $this->
toolbar = $DIC->toolbar();
171 $this->component_factory = $DIC[
"component.factory"];
173 $this->request = $DIC
180 $this->questioninfo = $DIC->testQuestion();
182 $this->requested_old_nr = $this->request->getInt(
"old_nr");
183 $this->requested_transl = $this->request->getString(
"transl");
184 $this->requested_file_id = $this->request->getString(
"file_id");
185 $this->requested_ref_id = $this->request->getInt(
"ref_id");
186 $this->requested_pg_id = $this->request->getInt(
"pg_id");
191 if ($a_old_nr == 0 && !$a_prevent_get_id && $this->requested_old_nr > 0) {
196 if ($a_lang ==
"" && $this->requested_transl !=
'') {
211 $this->page_linker =
new ilPageLinker(get_class($this));
213 $this->output2template =
true;
215 $this->template_output_var =
"PAGE_CONTENT";
216 $this->page_back_title = $this->
lng->txt(
"page");
217 $this->
lng->loadLanguageModule(
"content");
218 $this->
lng->loadLanguageModule(
"copg");
220 $this->tool_context = $DIC->globalScreen()->tool()->context();
224 $this->
ctrl->saveParameter($this,
"transl");
227 $this->requested_user_id = $this->request->getInt(
"user");
228 $this->requested_q_id = $this->request->getInt(
"q_id");
229 $this->requested_history_mode = $this->request->getInt(
"history_mode");
235 $this->edit_repo = $int_service
240 $this->xsl = $int_service->domain()->xsl();
241 $this->compare = $int_service->domain()->compare();
242 $this->pc_definition = $DIC
248 $this->gui = $DIC->copage()->internal()->gui();
249 $this->
link = $DIC->copage()->internal()->domain()->link();
250 $this->pm = $DIC->copage()->internal()->domain()->page();
251 $this->editor_gui = $DIC->copage()->internal()->gui()->edit();
252 $this->notes = $DIC->notes();
257 $this->tpl = $main_tpl;
271 string $a_adv_subtype =
"-" 273 $this->adv_ref_id = $a_adv_ref_id;
274 $this->adv_type = $a_adv_type;
275 $this->adv_subtype = $a_adv_subtype;
283 if ($this->adv_type ===
null) {
300 $page->setConcreteLang($this->concrete_lang);
306 $this->parent_type = $a_val;
314 public function setId(
int $a_val): void
329 $this->old_nr = $a_val;
365 $this->page_config = $a_val;
375 $this->obj = $a_pg_obj;
387 string $a_mode = self::PRESENTATION
389 $this->output_mode = $a_mode;
399 $this->output2template = $a_output;
409 $this->presentation_title = $a_title;
429 $this->link_params = $l_params;
439 $this->link_frame = $l_frame;
469 $this->target_var = $a_variable;
484 $this->sourcecode_download_script = $script_name;
494 $this->tabs_gui = $a_tabs;
499 $this->page_back_title = $a_title;
504 $this->file_download_link = $a_download_link;
514 $this->fullscreen_link = $a_fullscreen_link;
524 $this->int_link_return = $a_return;
527 public function enableNotes(
bool $a_enabled,
int $a_parent_id): void
529 $this->notes_enabled = $a_enabled;
530 $this->notes_parent_id = $a_parent_id;
543 $this->offline_directory = $offdir;
557 $this->view_page_link = $a_link;
558 $this->view_page_target = $a_target;
573 return $this->
lng->txt(
"cont_presentation_view");
580 $this->act_obj = $a_obj;
581 $this->act_meth = $a_meth;
586 int $a_news_obj_id = 0,
587 string $a_news_obj_type =
"" 589 $this->enabled_news = $a_enabled;
590 $this->news_obj_id = $a_news_obj_id;
591 $this->news_obj_type = $a_news_obj_type;
603 $this->tab_hook = array(
"obj" => $a_object,
"func" => $a_function);
612 $this->editpreview = $a_editpreview;
622 $this->tabs_enabled = $a_enabledtabs;
632 $this->enabledpagefocus = $a_enabledpagefocus;
637 $this->open_place_holder = $a_val;
652 $this->prependinghtml = $a_prependinghtml;
662 $this->enableediting = $a_enableediting;
675 $this->rawpagecontent = $a_rawpagecontent;
685 $this->styleid = $a_styleid;
695 $this->compare_mode = $a_val;
710 $this->abstract_only = $a_val;
711 $this->abstract_pcid = $pcid;
721 $this->render_page_container = $a_val;
731 return $this->
lng->txt(
"inactive");
741 $this->enabled_href = $enable;
756 ?
object $a_observer_obj =
null,
757 string $a_observer_func =
"" 759 $this->use_meta_data =
true;
760 $this->meta_data_rep_obj = $a_rep_obj;
761 $this->meta_data_sub_obj_id = $a_sub_obj_id;
762 $this->meta_data_type = $a_type;
763 $this->meta_data_observer_obj = $a_observer_obj;
764 $this->meta_data_observer_func = $a_observer_func;
771 $file_download_link = $this->
ctrl->getLinkTarget($this,
"downloadFile");
780 $fullscreen_link = $this->
ctrl->getLinkTarget($this,
"displayMediaFullscreen",
"",
false,
false);
788 if ($this->sourcecode_download_script ==
"" && $this->
getOutputMode() !=
"offline") {
789 $l = $this->
ctrl->getLinkTarget($this,
"");
801 foreach ($this->component_factory->getActivePluginsInSlot(
"pgcp") as
$plugin) {
802 if (
$plugin->isValidParentType($this->getPageObject()->getParentType())) {
803 $xml .=
'<ComponentPlugin Name="' .
$plugin->getPluginName() .
809 $xml =
"<ComponentPlugins>" . $xml .
"</ComponentPlugins>";
821 $next_class = $this->
ctrl->getNextClass($this);
822 if ($next_class !==
"") {
823 $this->
ctrl->setReturn($this,
"edit");
825 $this->log->debug(
"next_class: " . $next_class);
826 if ($next_class ==
"" && $this->
ctrl->getCmd() ==
"edit") {
827 $this->tabs_gui->clearTargets();
833 switch ($next_class) {
834 case 'ilobjectmetadatagui':
836 $md_gui =
new ilObjectMetaDataGUI($this->meta_data_rep_obj, $this->meta_data_type, $this->meta_data_sub_obj_id);
837 if (is_object($this->meta_data_observer_obj)) {
838 $md_gui->addMDObserver(
839 $this->meta_data_observer_obj,
840 $this->meta_data_observer_func,
845 if ($this->adv_type !=
"") {
846 $md_gui->setAdvMdRecordObject($this->adv_ref_id, $this->adv_type, $this->adv_subtype);
848 $this->
ctrl->forwardCommand($md_gui);
851 case "ileditclipboardgui":
854 $clip_gui->setPageBackTitle($this->page_back_title);
855 $ret = $this->
ctrl->forwardCommand($clip_gui);
861 $html = $this->
edit();
862 $this->tabs_gui->setTabActive(
"edit");
865 case 'ilpublicuserprofilegui':
867 $ret = $this->
ctrl->forwardCommand($profile_gui);
870 case "ilpageeditorgui":
874 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
875 $this->
ctrl->redirect($this,
"preview");
878 $page_editor->setHeader($this->
getHeader());
879 $page_editor->setPageBackTitle($this->page_back_title);
880 $page_editor->setIntLinkReturn($this->int_link_return);
882 $ret = $this->
ctrl->forwardCommand($page_editor);
885 case 'ilnewsitemgui':
887 $news_item_gui->setEnableEdit(
true);
888 $news_item_gui->setContextObjId($this->news_obj_id);
889 $news_item_gui->setContextObjType($this->news_obj_type);
890 $news_item_gui->setContextSubObjId($this->obj->getId());
891 $news_item_gui->setContextSubObjType(
"pg");
893 $ret = $this->
ctrl->forwardCommand($news_item_gui);
896 case "ilpropertyformgui":
898 $this->
ctrl->forwardCommand($form);
901 case "ilinternallinkgui":
902 $this->
lng->loadLanguageModule(
"content");
905 $link_gui->filterLinkType(
"PageObject_FAQ");
906 $link_gui->filterLinkType(
"GlossaryItem");
907 $link_gui->filterLinkType(
"Media_Media");
908 $link_gui->filterLinkType(
"Media_FAQ");
910 $link_gui->setFilterWhiteList(
true);
911 $this->
ctrl->forwardCommand($link_gui);
914 case "ilquestioneditgui":
918 $edit_gui->setSelfAssessmentEditingMode(
true);
919 $ret = $this->
ctrl->forwardCommand($edit_gui);
920 $this->tpl->setContent($ret);
923 case 'ilassquestionfeedbackeditinggui':
931 $this->
lng->loadLanguageModule(
"assessment");
935 $this->questioninfo->getGeneralQuestionProperties(
936 $this->requested_q_id
940 $questionGUI->getObject()->setObjId(0);
941 $questionGUI->getObject()->setSelfAssessmentEditingMode(
true);
942 $questionGUI->getObject()->setPreventRteUsage($this->
getPageConfig()->getPreventRteUsage());
949 case 'ilLearninghistorygui':
956 $this->
ctrl->forwardCommand($hist_gui);
960 $cmd = $this->
ctrl->getCmd(
"preview");
963 $this->tabs_gui->addNonTabbedLink(
969 $ret = $this->$cmd();
970 if ($this->
getOutputMode() == self::PREVIEW && $cmd ==
"preview") {
976 return (
string) $ret;
984 $this->tabs_gui->clearTargets();
986 $this->tabs_gui->setBackTarget(
987 $this->
lng->txt(
"back"),
988 $this->
ctrl->getLinkTarget($this,
"edit")
991 $this->
ctrl->setParameterByClass(
"ilquestioneditgui",
"q_id", $this->requested_q_id);
992 $this->tabs_gui->addTab(
994 $this->
lng->txt(
"question"),
995 $this->
ctrl->getLinkTargetByClass(
"ilquestioneditgui",
"editQuestion")
998 $this->
ctrl->setParameterByClass(
"ilAssQuestionFeedbackEditingGUI",
"q_id", $this->requested_q_id);
999 $this->tabs_gui->addTab(
1001 $this->
lng->txt(
"feedback"),
1005 $this->tabs_gui->activateTab($a_active);
1018 $this->
ctrl->redirect($this,
"edit");
1027 $this->
ctrl->redirect($this,
"edit");
1038 $b = $ui->factory()->button()->standard(
1039 $lng->
txt(
"edit_page"),
1040 $this->
ctrl->getLinkTarget($this,
"edit")
1055 $paragraph_plugin_string =
'';
1056 $disable_auto_margins =
'';
1066 $main_tpl->addJavaScript(
"../components/ILIAS/COPage/js/ilCOPagePres.js");
1068 $main_tpl->addJavaScript(
"components/ILIAS/COPage/js/ilCOPagePres.js");
1081 $this->log->debug(
"ilPageObjectGUI, showPage() in edit mode.");
1083 $tpl =
new ilTemplate(
"tpl.page_edit_wysiwyg.html",
true,
true,
"components/ILIAS/COPage");
1088 $tpl->
setVariable(
"PAGE_CONTAINER_CLASS",
"ilc_page_cont_PageContainer");
1093 $this->
ctrl->getFormActionByClass(
"ilpageeditorgui",
"",
"",
true)
1097 $sel_js_mode =
"enable";
1104 if ($sel_js_mode ==
"enable") {
1108 $this->
ctrl->getLinkTargetByClass(
1109 array(
"ilpageeditorgui",
"ilinternallinkgui"),
1118 $this->editor_gui->init()->initUI($main_tpl);
1123 $tpl =
new ilTemplate(
"tpl.page.html",
true,
true,
"components/ILIAS/COPage");
1136 if ($c_old_nr > 0 || $this->
getCompareMode() || ($this->requested_history_mode == 1)) {
1141 $this->
ctrl->setParameter($this,
"history_mode",
"1");
1144 if (isset($hist_info[
"previous"])) {
1146 $tpl->
setVariable(
"TXT_PREV_REV", $this->
lng->txt(
"cont_previous_rev"));
1147 $this->
ctrl->setParameter($this,
"old_nr", $hist_info[
"previous"][
"nr"]);
1150 $this->
ctrl->getLinkTarget($this,
"preview")
1154 $tpl->
setVariable(
"TXT_PREV_REV", $this->
lng->txt(
"cont_previous_rev"));
1159 if ($c_old_nr > 0) {
1161 $tpl->
setVariable(
"TXT_NEXT_REV", $this->
lng->txt(
"cont_next_rev"));
1162 $this->
ctrl->setParameter($this,
"old_nr", $hist_info[
"next"][
"nr"] ?? 0);
1165 $this->
ctrl->getLinkTarget($this,
"preview")
1171 $tpl->
setVariable(
"TXT_LATEST_REV", $this->
lng->txt(
"cont_latest_rev"));
1172 $this->
ctrl->setParameter($this,
"old_nr",
"");
1175 $this->
ctrl->getLinkTarget($this,
"preview")
1180 $this->
ctrl->setParameter($this,
"history_mode",
"");
1185 $this->
ctrl->setParameter($this,
"old_nr", $c_old_nr);
1188 $this->
ctrl->getLinkTarget($this,
"rollbackConfirmation")
1190 $this->
ctrl->setParameter($this,
"old_nr",
"");
1193 $this->
lng->txt(
"cont_rollback")
1200 $tpl->
setVariable(
"TXT_REVISION", $this->
lng->txt(
"cont_revision"));
1202 "VAL_REVISION_DATE",
1216 $tpl->
setVariable(
"FORMACTION", $this->
ctrl->getFormActionByClass(
"ilpageeditorgui"));
1222 $this->obj->getParentType() .
":pg",
1223 $this->obj->getId(),
1224 $this->obj->getLanguage()
1226 $mob_links = array();
1227 foreach ($links as $link) {
1228 if ($link[
"type"] ==
"mob") {
1236 if (count($mob_links) > 0) {
1238 $tpl->
setVariable(
"TXT_LINKED_MOBS", $this->
lng->txt(
"cont_linked_mobs"));
1243 $tpl->
setVariable(
"TXT_EDIT_MEDIA", $this->
lng->txt(
"cont_edit_mob"));
1244 $tpl->
setVariable(
"TXT_COPY_TO_CLIPBOARD", $this->
lng->txt(
"cont_copy_to_clipboard"));
1255 if (count($snippets) > 0) {
1256 foreach ($snippets as $s) {
1260 $tpl->
setVariable(
"TXT_CONTENT_SNIPPETS_USED", $this->
lng->txt(
"cont_snippets_used"));
1265 $tpl->
setVariable(
"TXT_SHOW_INFO", $this->
lng->txt(
"cont_show_info"));
1274 $tpl->
setVariable(
"TXT_SCHEDULED_ACTIVATION", $this->
lng->txt(
"cont_scheduled_activation"));
1298 $builded = $this->obj->buildDom();
1303 if (!$this->obj->checkPCIds()) {
1304 $this->obj->insertPCIds();
1305 $this->obj->update(
true,
true);
1308 $this->obj->addFileSizes();
1309 $this->obj->addHierIDs();
1311 $this->obj->addFileSizes();
1318 if (!$this->link_xml_set) {
1330 $template_xml = $style->getTemplateXML();
1331 $disable_auto_margins =
"n";
1332 if ($style->lookupStyleSetting(
"disable_auto_margins")) {
1333 $disable_auto_margins =
"y";
1338 $append_footnotes =
"y";
1340 if (!$this->abstract_pcid) {
1341 $content =
"<dummy><PageObject><PageContent><Paragraph>" .
1342 $this->obj->getFirstParagraphText() . $link_xml .
1343 "</Paragraph></PageContent></PageObject></dummy>";
1345 $append_footnotes =
"n";
1346 $par = $this->obj->getParagraphForPCID($this->abstract_pcid);
1347 $content =
"<dummy><PageObject><PageContent><Paragraph Characteristic='" . $par->getCharacteristic() .
"'>" .
1348 $par->getText() . $link_xml .
1349 "</Paragraph></PageContent></PageObject>" . $this->obj->getMultimediaXML() .
"</dummy>";
1352 $content = $this->obj->getXMLFromDom(
1364 if ($builded !==
true) {
1369 $this->edit_repo->clearPageError();
1388 $enlarge_path =
"images/media/enlarge.svg";
1392 ?
"ilc_PrintPageTitle" 1397 $enable_split_new = ($this->obj->getParentType() ==
"lm")
1403 if (($this->obj->getParentType() ==
"lm") &&
1405 $this->obj->getParentId(),
1408 $enable_split_next =
"y";
1410 $enable_split_next =
"n";
1431 ? $this->
user->getPref(
"ilPageEditor_MediaMode")
1439 $current_ts = time();
1443 $enable_href =
false;
1447 $params = array(
'mode' => $this->
getOutputMode(),
'pg_title' => htmlentities($pg_title, ENT_QUOTES,
"UTF-8"),
1448 'enable_placeholder' => $cfg->getEnablePCType(
"PlaceHolder") ?
"y" :
"n",
1449 'pg_id' => $this->obj->getId(),
'pg_title_class' => $pg_title_class,
1450 'webspace_path' => $wb_path,
'enlarge_path' => $enlarge_path,
1451 'img_col' => $col_path,
1452 'img_row' => $row_path,
1453 'img_cell' => $cell_path,
1454 'img_item' => $item_path,
1455 'acc_save_url' =>
"./ilias.php?baseClass=ilaccordionpropertiesstoragegui&cmd=setOpenedTab" .
1456 "&user_id=" . $this->
user->getId(),
1457 'append_footnotes' => $append_footnotes,
1459 'enable_split_new' => $enable_split_new,
1460 'enable_split_next' => $enable_split_next,
1464 'img_path' => $img_path,
1465 'parent_id' => $this->obj->getParentId(),
1467 'encoded_download_script' => urlencode($this->sourcecode_download_script),
1468 'enable_rep_objects' => $cfg->getEnablePCType(
"Resources") ?
"y" :
"n",
1469 'enable_login_page' => $cfg->getEnablePCType(
"LoginPageElement") ?
"y" :
"n",
1471 'enable_tabs' => $cfg->getEnablePCType(
"Tabs") ?
"y" :
"n",
1472 'enable_sa_qst' => $cfg->getEnableSelfAssessment() ?
"y" :
"n",
1473 'enable_file_list' => $cfg->getEnablePCType(
"FileList") ?
"y" :
"n",
1474 'enable_content_includes' => $cfg->getEnablePCType(
"ContentInclude") ?
"y" :
"n",
1475 'enable_content_templates' => (count($this->
getPageObject()->getContentTemplates()) > 0) ?
"y" :
"n",
1476 'paste' => $paste ?
"y" :
"n",
1477 'media_mode' => $media_mode,
1478 'javascript' => $sel_js_mode,
1479 'paragraph_plugins' => $paragraph_plugin_string,
1480 'disable_auto_margins' => $disable_auto_margins,
1481 'page_toc' => $cfg->getEnablePageToc() ?
"y" :
"n",
1482 'enable_profile' => $cfg->getEnablePCType(
"Profile") ?
"y" :
"n",
1483 'enable_verification' => $cfg->getEnablePCType(
"Verification") ?
"y" :
"n",
1484 'enable_blog' => $cfg->getEnablePCType(
"Blog") ?
"y" :
"n",
1485 'enable_skills' => $cfg->getEnablePCType(
"Skills") ?
"y" :
"n",
1486 'enable_learning_history' => $cfg->getEnablePCType(
"LearningHistory") ?
"y" :
"n",
1487 'enable_qover' =>
"n",
1488 'enable_consultation_hours' => $cfg->getEnablePCType(
"ConsultationHours") ?
"y" :
"n",
1489 'enable_my_courses' => $cfg->getEnablePCType(
"MyCourses") ?
"y" :
"n",
1490 'enable_amd_page_list' => $cfg->getEnablePCType(
"AMDPageList") ?
"y" :
"n",
1491 'current_ts' => $current_ts,
1494 'activated_protection' =>
1496 'protection_text' => $this->
lng->txt(
"cont_sec_protected_text"),
1497 'enable_href' => $enable_href
1499 if ($this->link_frame !=
"") {
1508 $params[
"incl_elements_date"] = $this->obj->getLastUpdateOfIncludedElements();
1514 $md5 = md5(serialize(
$params) . $link_xml . $template_xml . $md5_adds);
1524 $md5 == $this->obj->getRenderMd5() &&
1525 ($this->obj->getLastChange() < $this->obj->getRenderedTime()) &&
1526 $this->obj->getRenderedTime() !=
"" &&
1527 $this->obj->old_nr == 0) {
1529 $output = $this->obj->getRenderedContent();
1531 $this->log->debug(
"Calling XSLT, content: " . substr($content, 0, 100));
1533 $output = $this->xsl->process($content,
$params);
1537 $output =
"<pre>" . $e->getMessage() .
"<br>" . htmlentities($content) .
"</pre>";
1543 && $this->obj->old_nr == 0) {
1544 $this->obj->writeRenderedContent($output, $md5);
1551 $this->
user->getPref(
"ilPageEditor_HTMLMode") !=
"disable")
1553 $output = str_replace(
"<",
"<", $output);
1554 $output = str_replace(
">",
">", $output);
1556 $output = str_replace(
"&",
"&", $output);
1580 $output = str_replace(
"\n",
"", $output);
1587 $output =
'<div class="copg-disabled-page"><div class="ilCopgDisabledText">' . $this->
getDisabledText() .
'</div>' . $output .
'</div>';
1591 $defs = $this->pc_definition->getPCDefinitions();
1592 foreach ($defs as $def) {
1593 $pc_class = $def[
"pc_class"];
1613 $up_pc = $this->request->getString(
"updated_pc_id_str");
1620 echo $tpl->
get(
"edit_page");
1633 return $output . $edit_init;
1636 return $tpl->
get() . $edit_init;
1645 while (is_int($start = strpos($output,
"<!--ParStart-->")) &&
1646 is_int($end = strpos($output,
"<!--ParEnd-->", $start))) {
1647 $output = substr($output, 0, $start) .
1650 array(
"{",
"}"),
1651 substr($output, $start + 15, $end - ($start + 15))
1653 substr($output, $end + 13);
1667 return array(
"deactivatePage" => $this->
lng->txt(
"cont_deactivate_page"),
1668 "activatePage" => $this->
lng->txt(
"cont_activate_page"));
1676 $media_mode = $this->request->getString(
"media_mode");
1677 $html_mode = $this->request->getString(
"html_mode");
1678 $js_mode = $this->request->getString(
"js_mode");
1679 if ($media_mode !=
"") {
1680 if ($media_mode ==
"disable") {
1681 $this->
user->writePref(
"ilPageEditor_MediaMode",
"disable");
1683 $this->
user->writePref(
"ilPageEditor_MediaMode",
"");
1686 if ($html_mode !=
"") {
1687 if ($html_mode ==
"disable") {
1688 $this->
user->writePref(
"ilPageEditor_HTMLMode",
"disable");
1690 $this->
user->writePref(
"ilPageEditor_HTMLMode",
"");
1693 if ($js_mode !=
"") {
1694 if ($js_mode ==
"disable") {
1695 $this->
user->writePref(
"ilPageEditor_JavaScript",
"disable");
1697 $this->
user->writePref(
"ilPageEditor_JavaScript",
"");
1701 $this->
ctrl->redirect($this,
"edit");
1710 bool $a_int_links =
false,
1711 bool $a_wiki_links =
false,
1712 bool $a_keywords =
false,
1714 $a_paragraph_styles =
true,
1715 $a_save_return =
true,
1718 $a_user_links =
false,
1719 ?\
ILIAS\COPage\Editor\Server\UIWrapper $ui_wrapper =
null 1723 $lng = $DIC->language();
1725 $ctrl = $DIC->ctrl();
1728 $ui->renderer()->renderAsync($ui->factory()->legacy()->content(
""));
1730 $style_service = $DIC->contentStyle()->internal();
1731 $style_access_manager = $style_service->domain()->access(
1733 $DIC->user()->getId()
1735 $char_manager = $style_service->domain()->characteristic(
1737 $style_access_manager
1742 $f =
static function (
string $type,
string $code) use ($char_manager, $lng):
string {
1743 $title = $char_manager->getPresentationTitle(
"text_inline", $type);
1744 if ($title === $type) {
1745 $title = $lng->
txt(
"cont_char_style_" . $code);
1752 if ($a_style_id === 0) {
1754 "Comment" => array(
"code" =>
"com",
"txt" =>
$f(
"Comment",
"com")),
1755 "Quotation" => array(
"code" =>
"quot",
"txt" =>
$f(
"Quotation",
"quot")),
1756 "Accent" => array(
"code" =>
"acc",
"txt" =>
$f(
"Accent",
"acc")),
1757 "Code" => array(
"code" =>
"code",
"txt" =>
$f(
"Code",
"code"))
1760 foreach (ilPCParagraphGUI::_getTextCharacteristics($a_style_id,
true) as
$c) {
1761 if (in_array($c, [
"Strong",
"Important",
"Emph"])) {
1764 if (!isset($chars[$c])) {
1765 $title = $char_manager->getPresentationTitle(
"text_inline", $c);
1768 $chars[
"Code"] = array(
"code" =>
"code",
"txt" =>
$f(
"Code",
"code"));
1771 $chars[
"Comment"] = array(
"code" =>
"com",
"txt" =>
$f(
"Comment",
"com"));
1774 $chars[
"Quotation"] = array(
"code" =>
"quot",
"txt" =>
$f(
"Quotation",
"quot"));
1777 $chars[
"Accent"] = array(
"code" =>
"acc",
"txt" =>
$f(
"Accent",
"acc"));
1780 $chars[
$c] = array(
"code" =>
"",
"txt" => $title);
1786 foreach ($chars as $key => $char) {
1789 "active_" . $char[
"code"],
1795 case "Code": $tag =
"code";
1798 $html =
'<' . $tag .
' class="ilc_' . $t .
'_' . $key .
'" style="font-size:90%; margin-top:2px; margin-bottom:2px; position:static;">' . $char[
"txt"] .
"</" . $tag .
">";
1799 $char_formats[] = [
"text" => $html,
"action" =>
"selection.format",
"data" => [
"format" => $key]];
1804 $numbered_list = $ui->renderer()->render(
1805 $ui->factory()->symbol()->glyph()->numberedlist(
null)
1808 $bullet_list = $ui->renderer()->render(
1809 $ui->factory()->symbol()->glyph()->bulletlist(
null)
1812 $indent = $ui->renderer()->render(
1813 $ui->factory()->symbol()->glyph()->listindent(
null)
1816 $outdent = $ui->renderer()->render(
1817 $ui->factory()->symbol()->glyph()->listoutdent(
null)
1824 if ($aset->get(
"use_physical")) {
1830 foreach ([
"str",
"emp",
"imp",
"sup",
"sub"] as $c) {
1838 $c_formats[] = [
"text" =>
'<span class="ilc_text_inline_Strong">' . $str .
'</span>',
1839 "action" =>
"selection.format",
1840 "data" => [
"format" =>
"Strong"],
1841 "aria-label" => $lng->
txt(
"cont_text_str")
1845 $c_formats[] = [
"text" =>
'<span class="ilc_text_inline_Emph">' . $emp .
'</span>',
1846 "action" =>
"selection.format",
1847 "data" => [
"format" =>
"Emph"],
1848 "aria-label" => $lng->
txt(
"cont_text_emp")
1852 $c_formats[] = [
"text" =>
'<span class="ilc_text_inline_Important">' . $imp .
'</span>',
1853 "action" =>
"selection.format",
1854 "data" => [
"format" =>
"Important"],
1855 "aria-label" => $lng->
txt(
"cont_text_imp")
1859 $c_formats[] = [
"text" =>
'x<sup>2</sup>',
1860 "action" =>
"selection.format",
1861 "data" => [
"format" =>
"Sup"],
1862 "aria-label" => $lng->
txt(
"cont_text_sup")
1866 $c_formats[] = [
"text" =>
'x<sub>2</sub>',
1867 "action" =>
"selection.format",
1868 "data" => [
"format" =>
"Sub"],
1869 "aria-label" => $lng->
txt(
"cont_text_sub")
1875 $c_formats[] = [
"text" =>
"<i>A</i>",
1876 "action" => $char_formats,
1877 "aria-label" => $lng->
txt(
"copg_more_character_formats")
1879 $c_formats[] = [
"text" =>
'<i><strong><u>T</u></strong><sub>x</sub></i>',
1880 "action" =>
"selection.removeFormat",
1882 "aria-label" => $lng->
txt(
"copg_remove_formats")
1885 "cont_char_format" => $c_formats,
1888 "text" => $bullet_list,
1889 "action" =>
"list.bullet",
1891 "aria-label" => $lng->
txt(
"cont_bullet_list")
1894 "text" => $numbered_list,
1895 "action" =>
"list.number",
1897 "aria-label" => $lng->
txt(
"cont_numbered_list")
1901 "action" =>
"list.outdent",
1903 "aria-label" => $lng->
txt(
"cont_list_outdent")
1907 "action" =>
"list.indent",
1909 "aria-label" => $lng->
txt(
"cont_list_indent")
1918 if (count($ulists) > 1) {
1920 foreach ($ulists as $c) {
1921 $la[] = [
"action" =>
"list.bulletStyle",
"text" =>
$c,
"data" => [
"format" =>
$c]];
1923 $menu[
"copg_list_styles"][] = [
"text" => $lng->
txt(
"copg_list_style"),
"action" => $la];
1925 if (count($olists) > 1) {
1927 foreach ($olists as $c) {
1928 $la[] = [
"action" =>
"list.numberStyle",
"text" =>
$c,
"data" => [
"format" =>
$c]];
1930 $menu[
"copg_list_styles"][] = [
"text" => $lng->
txt(
"copg_list_style"),
"action" => $la];
1932 if (count($ilists) > 1) {
1934 foreach ($ilists as $c) {
1935 $la[] = [
"action" =>
"list.itemStyle",
"text" =>
$c,
"data" => [
"format" =>
$c]];
1937 $menu[
"copg_list_styles"][] = [
"text" => $lng->
txt(
"copg_list_item_style"),
"action" => $la];
1944 if ($a_wiki_links) {
1945 $links[] = [
"text" => $lng->
txt(
"cont_wiki_link_dialog"),
"action" =>
"link.wikiSelection",
"data" => [
1947 $links[] = [
"text" =>
"[[" . $lng->
txt(
"cont_wiki_page") .
"]]",
"action" =>
"link.wiki",
"data" => []];
1950 $links[] = [
"text" => $lng->
txt(
"cont_text_iln_link"),
"action" =>
"link.internal",
"data" => []];
1957 $links[] = [
"text" => $lng->
txt(
"cont_text_xln"),
"action" =>
"link.external",
"data" => []];
1959 if ($a_user_links) {
1960 $links[] = [
"text" => $lng->
txt(
"cont_link_user"),
"action" =>
"link.user",
"data" => []];
1965 $menu[
"cont_more_functions"] = [];
1966 $menu[
"cont_more_functions"][] = [
"text" => $lng->
txt(
"cont_link") .
'<i class="mce-ico mce-i-link"></i>',
"action" => $links];
1969 $menu[
"cont_more_functions"][] = [
"text" => $lng->
txt(
"cont_keyword"),
"action" =>
"selection.keyword",
"data" => []];
1971 $mathJaxSetting =
new ilSetting(
"MathJax");
1977 if ($mathJaxSetting->get(
"enable") || defined(
"URL_TO_LATEX")) {
1978 $menu[
"cont_more_functions"][] = [
"text" =>
'Tex',
"action" =>
"selection.tex",
"data" => []];
1986 $menu[
"cont_more_functions"][] = [
"text" => $lng->
txt(
"cont_footnote"),
"action" =>
"selection.fn",
"data" => []];
1989 $menu[
"cont_more_functions"][] = [
"text" => $lng->
txt(
"cont_anchor"),
"action" =>
"selection.anchor",
"data" => []];
1992 $btpl =
new ilTemplate(
"tpl.tiny_menu.html",
true,
true,
"components/ILIAS/COPage");
1994 foreach ($menu as $section_title => $section) {
1995 foreach ($section as $item) {
1996 if (is_array($item[
"action"])) {
1998 foreach ($item[
"action"] as $i) {
1999 $buttons[] = $ui_wrapper->getButton(
2006 $i[
"aria-label"] ??
"" 2009 $dd = $ui->factory()->dropdown()->standard($buttons)->withLabel($item[
"text"])
2010 ->withAriaLabel($item[
"aria-label"] ??
"");
2011 $btpl->setCurrentBlock(
"button");
2012 $btpl->setVariable(
"BUTTON", $ui->renderer()->renderAsync($dd));
2014 $b = $ui_wrapper->getRenderedButton(
2021 $item[
"aria-label"] ??
"" 2023 $btpl->setCurrentBlock(
"button");
2024 $btpl->setVariable(
"BUTTON",
$b);
2026 $btpl->parseCurrentBlock();
2028 $btpl->setCurrentBlock(
"section");
2029 $btpl->setVariable(
"TXT_SECTION", $lng->
txt($section_title));
2030 $btpl->parseCurrentBlock();
2034 if ($a_paragraph_styles) {
2035 $sel = new \ParagraphStyleSelector($ui_wrapper, $a_style_id);
2036 $dd = $sel->getStyleSelector(
" ");
2037 $btpl->setCurrentBlock(
"par_edit");
2038 $btpl->setVariable(
"TXT_PAR_FORMAT", $lng->
txt(
"cont_par_format"));
2040 $btpl->setVariable(
"STYLE_SELECTOR", $ui->renderer()->renderAsync($dd));
2042 $btpl->parseCurrentBlock();
2046 $sel = new \SectionStyleSelector($ui_wrapper, $a_style_id);
2047 $dd = $sel->getStyleSelector(
" ", $type =
"par-action", $action =
"sec.class", $attr =
"class",
true);
2048 $btpl->setVariable(
"TXT_BLOCK", $lng->
txt(
"cont_sur_block_format"));
2049 $btpl->setVariable(
"BLOCK_STYLE_SELECTOR", $ui->renderer()->renderAsync($dd));
2052 $btpl->setVariable(
"TINY_HEADER", $lng->
txt(
"cont_text_editing"));
2055 $ui_wrapper->getRenderedButton($lng->
txt(
"cont_quit_text_editing"),
"par-action",
"save.return")
2064 $btpl->setVariable(
"TXT_SAVING", $lng->
txt(
"cont_saving"));
2067 return $btpl->get();
2073 $this->page_linker->setOffline($this->
getOutputMode() == self::OFFLINE);
2074 $this->
setLinkXml($this->page_linker->getLinkXML($this->getPageObject()->getInternalLinks()));
2079 $this->link_xml = $xml;
2080 $this->link_xml_set =
true;
2086 if ($this->profile_back_url !=
"") {
2093 return $this->
ctrl->getLinkTargetByClass(strtolower(get_class($this)),
"preview");
2098 $this->profile_back_url =
$url;
2105 $cm = $this->pm->content($this->
getPageObject()->getDomDoc());
2108 $this->requested_file_id
2119 $tpl =
new ilGlobalTemplate(
"tpl.fullscreen.html",
true,
true,
"components/ILIAS/LearningModule");
2126 $link_xml = $this->page_linker->getLinkXML($med_links);
2129 if ($this->request->getPageType() ===
"mep") {
2134 $pg_obj->buildDom();
2137 if ($this->requested_pg_id > 0) {
2138 $xml .= $pg_obj->getMediaAliasElement($this->request->getMobId());
2147 if ($a_fullscreen) {
2148 $mode =
"fullscreen";
2155 $params = array(
'mode' => $mode,
'enlarge_path' => $enlarge_path,
2156 'link_params' =>
"ref_id=" . $this->requested_ref_id,
'fullscreen_link' =>
"",
2158 'ref_id' => $this->requested_ref_id,
'webspace_path' => $wb_path);
2159 $output = $this->xsl->process($xml,
$params);
2181 $pg_obj->buildDom();
2182 $pg_obj->sendParagraph(
2183 $this->request->getString(
"par_id"),
2184 $this->request->getString(
"downloadtitle")
2193 while (is_int($pos = strpos($a_output,
"ilPageTocH", $cpos))) {
2198 $page_heads = array();
2199 foreach ($offsets as $os) {
2200 $level = (
int) substr($a_output, $os + 10, 1);
2201 if (in_array($level, array(1,2,3))) {
2202 $anchor = str_replace(
2205 substr($a_output, $os, strpos($a_output,
"-->", $os) - $os)
2209 $tag_start = stripos($a_output,
"<h" . $level .
" ", $os);
2210 $tag_end = stripos($a_output,
"</h" . $level .
">", $tag_start);
2211 $head = substr($a_output, $tag_start, $tag_end - $tag_start);
2214 $text_start = stripos($head,
">") + 1;
2215 $text_end = strripos($head,
"<!--", $text_start);
2216 $text = substr($head, $text_start, $text_end - $text_start);
2217 $page_heads[] = array(
"level" => $level,
"text" => $text,
2218 "anchor" => $anchor);
2221 if (count($page_heads) > 1) {
2222 $listing = $this->gui->listing();
2230 $page_toc_ph =
"<!--PageTocPH-->";
2231 foreach ($page_heads as $ind => $h) {
2237 if ($h[
"level"] == 2 && $c_par[1] > 0) {
2240 if ($h[
"level"] == 3 && $c_par[2] > 0) {
2244 $h[
"text"] = str_replace($page_toc_ph,
"", $h[
"text"]);
2247 $this->
ui->factory()->legacy()->content(
"<a href='#" . $h[
"anchor"] .
"' class='ilc_page_toc_PageTOCLink'>" . $h[
"text"] .
"</a>"),
2253 if ($h[
"level"] == 1) {
2257 if ($h[
"level"] == 2) {
2263 "tpl.page_toc.html",
2266 "components/ILIAS/COPage" 2268 $tpl->
setVariable(
"PAGE_TOC", $listing->autoNumbers(
true)->render());
2269 $tpl->
setVariable(
"TXT_PAGE_TOC", $this->
lng->txt(
"cont_page_toc"));
2273 $a_output = str_replace(
2274 "{{{{{PageTOC}}}}}",
2278 $numbers = $listing->getNumbers();
2280 if (count($numbers) > 0) {
2281 foreach ($numbers as $n) {
2282 $a_output = (strpos($a_output, $page_toc_ph) !==
false)
2283 ? substr_replace($a_output, $n .
" ", strpos($a_output, $page_toc_ph), strlen($page_toc_ph))
2288 $a_output = str_replace(
2289 "{{{{{PageTOC}}}}}",
2316 $a_output = str_replace(
2317 "{{{{{LV_show_adv}}}}}",
2318 $this->
lng->txt(
"cont_show_adv"),
2321 $a_output = str_replace(
2322 "{{{{{LV_hide_adv}}}}}",
2323 $this->
lng->txt(
"cont_hide_adv"),
2327 $a_output = str_replace(
2328 "{{{{{LV_show_adv}}}}}",
2332 $a_output = str_replace(
2333 "{{{{{LV_hide_adv}}}}}",
2363 if ($this->requested_history_mode) {
2366 $this->tabs_gui->activateTab(
"cont_preview");
2377 $collection = $this->tool_context->current()->getAdditionalData();
2389 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
2390 $this->
ctrl->redirect($this,
"preview");
2395 if ($ptype ==
"cont" && $this->requested_ref_id > 0) {
2399 $this->
help->setScreenId(
"edit_" . $ptype);
2409 $this->
lng->toJS(
"paste");
2410 $this->
lng->toJS(
"delete");
2411 $this->
lng->toJS(
"cont_delete_content");
2412 $this->
lng->toJS(
"copg_confirm_el_deletion");
2413 $this->
lng->toJS(
"cont_saving");
2414 $this->
lng->toJS(
"cont_ed_par");
2415 $this->
lng->toJS(
"cont_no_block");
2416 $this->
lng->toJS(
"copg_error");
2417 $this->
lng->toJS(
"cont_ed_click_to_add_pg");
2418 $this->
lng->toJS(
"cont_ed_new_item_after");
2419 $this->
lng->toJS(
"cont_ed_new_item_before");
2420 $this->
lng->toJS(
"cont_ed_item_up");
2421 $this->
lng->toJS(
"cont_ed_item_down");
2422 $this->
lng->toJS(
"cont_ed_delete_item");
2423 $this->
lng->toJS(
"copg_edit_iframe_title");
2424 $this->
lng->toJS(
"copg_par_format_selection");
2427 $this->tpl->addJavaScript(
"assets/js/AdvancedSelectionList.js");
2434 $info = $this->
lng->txt(
"content_no_edit_lock");
2436 $info .=
"</br>" . $this->
lng->txt(
"content_until") .
": " .
2438 $info .=
"</br>" . $this->
lng->txt(
"obj_usr") .
": " .
2441 $back_link = $this->
ui->factory()->link()->standard(
2442 $this->
lng->txt(
"back"),
2443 $this->
ctrl->getLinkTarget($this,
"finishEditing")
2446 $mbox = $this->
ui->factory()->messageBox()->info(
$info)
2447 ->withLinks([$back_link]);
2448 $rendered_mbox = $this->
ui->renderer()->render($mbox);
2450 if (!$this->
ctrl->isAsynch()) {
2451 $this->tpl->setContent($rendered_mbox);
2453 echo $rendered_mbox;
2475 $info = $this->
lng->txt(
"cont_got_lock_release");
2478 $mbox = $ui->factory()->messageBox()->info(
$info);
2480 return $ui->renderer()->render($mbox);
2485 $pl_pc_id = $this->request->getPlaceholderPCId();
2486 $this->obj->buildDom();
2487 $this->obj->addHierIDs();
2489 return $this->
edit();
2510 $this->tpl =
new ilGlobalTemplate(
"tpl.fullscreen.html",
true,
true,
"components/ILIAS/COPage");
2511 $this->tpl->setCurrentBlock(
"ContentStyle");
2512 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET", 0);
2513 $this->tpl->parseCurrentBlock();
2515 $this->tpl->setVariable(
2520 $this->tpl->setCurrentBlock(
"ilMedia");
2523 if ($this->requested_pg_id > 0) {
2525 $pg_obj->buildDom();
2530 $xml .= $pg_obj->getMediaAliasElement($this->request->getMobId());
2540 $mode =
"fullscreen";
2541 $params = array(
'mode' => $mode,
2543 'webspace_path' => $wb_path);
2544 $output = $this->xsl->process($xml,
$params);
2547 $this->tpl->setVariable(
"MEDIA_CONTENT", $output);
2557 if (is_array($a_error)) {
2558 $error_str =
"<strong>Error(s):</strong><br>";
2559 foreach ($a_error as $error) {
2560 $err_mess = implode(
" - ", $error);
2561 if (!is_int(strpos($err_mess,
":0:"))) {
2562 $error_str .= htmlentities($err_mess) .
"<br />";
2565 $this->tpl->setVariable(
"MESSAGE", $error_str);
2571 $this->tabs_gui->clearTargets();
2572 $this->tabs_gui->setBackTarget(
2573 $this->
lng->txt(
"back"),
2574 $this->
ctrl->getLinkTarget($this,
"edit")
2580 $this->tabs_gui->clearTargets();
2581 $this->tabs_gui->setBackTarget(
2582 $this->
lng->txt(
"back"),
2583 $this->
ctrl->getLinkTarget($this,
"history")
2598 $this->tpl->addJavaScript(
"assets/js/page_history.js");
2601 $table_gui->setId(
"hist_table");
2608 'sortkey' => 999999,
2610 $table_gui->setData($entries);
2611 return $table_gui->getHTML();
2626 $this->
ctrl->setParameter($this,
"rollback_nr", $this->requested_old_nr);
2627 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"rollback"));
2628 $c_gui->setHeaderText($this->
lng->txt(
"cont_rollback_confirmation"));
2629 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"history");
2630 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"rollback");
2632 $hentry = $this->obj->getHistoryEntry($this->requested_old_nr);
2636 $this->requested_old_nr,
2640 $this->tpl->setContent($c_gui->getHTML());
2652 $hentry = $this->obj->getHistoryEntry(
2653 $this->request->getString(
"rollback_nr")
2656 if ($hentry[
"content"] !=
"") {
2657 $this->obj->setXMLContent($hentry[
"content"]);
2658 $this->obj->buildDom(
true);
2659 if ($this->obj->update()) {
2660 $this->
ctrl->redirect($this,
"history");
2663 $this->
ctrl->redirect($this,
"history");
2668 $this->
help->setScreenIdComponent(
"copg");
2674 if ($this->use_meta_data) {
2676 $this->meta_data_rep_obj,
2677 $this->meta_data_type,
2678 $this->meta_data_sub_obj_id
2680 $mdtab = $mdgui->getTab();
2682 $this->tabs_gui->addTarget(
2686 "ilobjectmetadatagui" 2690 return (
string) $mdtab;
2693 public function getTabs(
string $a_activate =
""): void
2706 $this->tabs_gui->addTarget(
"pg", $this->
ctrl->getLinkTarget($this,
"preview"), array(
"",
"preview"));
2708 $this->tabs_gui->addTarget(
"cont_preview", $this->
ctrl->getLinkTarget($this,
"preview"), array(
"",
"preview"));
2711 if ($this->use_meta_data) {
2713 $this->meta_data_rep_obj,
2714 $this->meta_data_type,
2715 $this->meta_data_sub_obj_id
2717 $mdtab = $mdgui->getTab();
2719 $this->tabs_gui->addTarget(
2723 "ilobjectmetadatagui" 2731 if (is_array($this->tab_hook)) {
2732 $func = $this->tab_hook[
"func"];
2733 $this->tab_hook[
"obj"]->$func();
2746 $tpl =
new ilTemplate(
"tpl.page_compare.html",
true,
true,
"components/ILIAS/COPage");
2753 $compare = $this->compare->compare(
2760 $lpage = $compare[
"l_page"];
2762 $cfg->setPreventHTMLUnmasking(
true);
2771 $lhtml = str_replace(
"<br />",
"<br />", $lhtml);
2775 $rpage = $compare[
"r_page"];
2783 $rhtml = str_replace(
"<br />",
"<br />", $rhtml);
2787 $tpl->
setVariable(
"TXT_MODIFIED", $this->
lng->txt(
"cont_pc_modified"));
2788 $tpl->
setVariable(
"TXT_DELETED", $this->
lng->txt(
"cont_pc_deleted"));
2795 $a_html = str_replace(
"[ilDiffInsStart]",
'<span class="ilDiffIns">', $a_html);
2796 $a_html = str_replace(
"[ilDiffDelStart]",
'<span class="ilDiffDel">', $a_html);
2797 $a_html = str_replace(
"[ilDiffInsEnd]",
'</span>', $a_html);
2798 $a_html = str_replace(
"[ilDiffDelEnd]",
'</span>', $a_html);
2810 $atpl =
new ilTemplate(
"tpl.page_activation.php",
true,
true,
"components/ILIAS/COPage");
2813 $atpl->setVariable(
"FORM", $this->
form->getHTML());
2814 $this->tpl->setContent($atpl->get());
2823 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
2824 $this->
form->setTitle($this->
lng->txt(
"cont_page_activation"));
2828 $rad_op1 =
new ilRadioOption($this->
lng->txt(
"cont_activated"),
"activated");
2830 $rad->addOption($rad_op1);
2831 $rad_op2 =
new ilRadioOption($this->
lng->txt(
"cont_deactivated"),
"deactivated");
2832 $rad->addOption($rad_op2);
2833 $rad_op3 =
new ilRadioOption($this->
lng->txt(
"cont_scheduled_activation"),
"scheduled");
2836 $dt_prop->setRequired(
true);
2837 $dt_prop->setShowTime(
true);
2841 $dt_prop2->setShowTime(
true);
2842 $rad_op3->addSubItem($dt_prop2);
2846 $cb->setInfo($this->
lng->txt(
"cont_show_activation_info_info"));
2847 $rad_op3->addSubItem($cb);
2850 $rad->addOption($rad_op3);
2852 $this->
form->addCommandButton(
"saveActivation", $this->
lng->txt(
"save"));
2854 $this->
form->addItem($rad);
2862 $activation =
"deactivated";
2864 $activation =
"activated";
2867 $dt_prop = $this->
form->getItemByPostVar(
"start");
2869 $activation =
"scheduled";
2875 $dt_prop = $this->
form->getItemByPostVar(
"end");
2877 $activation =
"scheduled";
2884 $this->
form->getItemByPostVar(
"activation")->setValue($activation);
2885 $this->
form->getItemByPostVar(
"show_activation_info")->setChecked($this->
getPageObject()->getShowActivationInfo());
2895 if ($this->
form->checkInput()) {
2900 $this->request->getString(
"show_activation_info")
2902 $activation = $this->request->getString(
"activation");
2903 if ($activation ==
"deactivated") {
2906 if ($activation ==
"scheduled") {
2916 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
2917 $this->
ctrl->redirect($this,
"editActivation");
2919 $this->
form->setValuesByPost();
2920 $this->tpl->setContent($this->
form->getHTML());
2927 ?
object $a_content_object =
null,
2928 bool $a_enable_private_notes =
true,
2929 bool $a_enable_public_notes =
false,
2930 bool $a_enable_notes_deletion =
false,
2931 ?callable $a_callback =
null,
2932 bool $export =
false 2935 if (!$a_content_object) {
2936 throw new ilException(
"No content object given.");
2957 $comments_gui = $this->notes->gui()->getCommentsGUI(
2958 $a_content_object->getParentId(),
2959 $a_content_object->getId(),
2960 $a_content_object->getParentType()
2962 $comments_gui->setUseObjectTitleHeader(
false);
2965 if ($a_enable_private_notes) {
2966 $comments_gui->enablePrivateNotes();
2968 if ($a_enable_public_notes) {
2969 $comments_gui->enablePublicNotes();
2970 if ($a_enable_notes_deletion) {
2971 $comments_gui->enablePublicNotesDeletion(
true);
2975 $comments_gui->setExportMode();
2979 $comments_gui->addObserver($a_callback);
2982 $next_class = $this->
ctrl->getNextClass($this);
2983 if (in_array($next_class, [
"ilnotegui",
"ilcommentgui"])) {
2984 $html = $this->
ctrl->forwardCommand($comments_gui);
2986 $html = $comments_gui->getListHTML();
2997 $this->request->getString(
"type"),
2998 $this->request->getString(
"id"),
2999 $this->request->getString(
"answer")
3015 $this->tabs_gui->activateTab(
"edit");
3017 $this->tpl->setContent($form->
getHTML());
3027 $ac->setInternalLinkDefault(
"Media_Media", 0);
3028 $ac->setInternalLinkFilterTypes(array(
"PageObject_FAQ",
"GlossaryItem",
"Media_Media",
"Media_FAQ"));
3029 $val = $this->obj->getInitialOpenedContent();
3030 if (($val[
"id"] ??
'') !=
"" && ($val[
"type"] ??
'') !=
"") {
3031 $ac->setValue($val[
"type"] .
"|" . $val[
"id"] .
"|" . $val[
"target"]);
3038 $form->
setTitle($this->
lng->txt(
"cont_initial_attached_content"));
3046 $this->obj->saveInitialOpenedContent(
3047 $this->request->getString(
"opened_content_ajax_type"),
3048 $this->request->getInt(
"opened_content_ajax_id"),
3049 $this->request->getString(
"opened_content_ajax_target")
3052 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"));
3053 $this->
ctrl->redirect($this,
"edit");
3066 $l = $this->request->getString(
"totransl");
3072 $this->
ctrl->setParameter($this,
"transl", $l);
3073 $this->
ctrl->redirect($this,
"edit");
3087 $l = $this->request->getString(
"totransl");
3088 $this->
ctrl->setParameter($this,
"totransl", $l);
3089 $this->
lng->loadLanguageModule(
"meta");
3092 $cgui->setFormAction($this->
ctrl->getFormAction($this));
3093 $cgui->setHeaderText($this->
lng->txt(
"cont_page_translation_does_not_exist") .
": " .
3094 $this->
lng->txt(
"meta_l_" . $l));
3095 $cgui->setCancel($this->
lng->txt(
"cancel"),
"editMasterLanguage");
3096 $cgui->setConfirm($this->
lng->txt(
"confirm"),
"createPageTranslation");
3097 $this->tpl->setContent($cgui->getHTML());
3105 $this->
ctrl->setParameter($this,
"transl",
"-");
3106 $this->
ctrl->redirect($this,
"edit");
3114 $l = $this->request->getString(
"totransl");
3123 $p->copyPageToTranslation($l);
3124 $this->
ctrl->setParameter($this,
"transl", $l);
3125 $this->
ctrl->redirect($this,
"edit");
3134 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"cont_page_lock_released"),
true);
3140 $this->
ctrl->redirect($this,
"preview");
3162 foreach ($collector->getJavascriptFiles() as $js) {
3166 foreach ($collector->getCssFiles() as $css) {
3170 foreach ($collector->getOnloadCode() as $code) {
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.
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
This class represents an option in a radio group.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
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)
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
ILIAS COPage Page PageManager $pm
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 addJavaScript(?ilGlobalTemplate $main_tpl=null)
Add javascript files that are necessary to run accordion.
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.
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
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
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
touchBlock(string $block)
overwrites ITX::touchBlock.
special template class to simplify handling of ITX/PEAR
setOutputMode(string $a_mode=self::PRESENTATION)
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
ilObject $meta_data_rep_obj
setPageBackTitle(string $a_title)
Interface Observer Contains several chained tasks and infos about them.
replaceCurlyBrackets(string $output)
setPageLinker(\ILIAS\COPage\PageLinker $page_linker)
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
compareVersion()
Compares two revisions of the page.
getAdvMdRecordObject()
Get adv md record type.
static _getListCharacteristics(int $a_style_id, string $type)
int $requested_history_mode
User Interface for NewsItem entities.
setLanguage(string $a_val)
setCompareMode(bool $a_val)
setTemplateTargetVar(string $a_variable)
confirmPageTranslationCreation()
Confirm page translation creation.
setPageConfig(ilPageConfig $a_val)
static lookupTitle(int $a_page_id)
setEnabledPageFocus(bool $a_enabledpagefocus)
ILIAS COPage InternalGUIService $gui
presentation(string $a_mode=self::PRESENTATION)
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
EditSessionRepository $edit_repo
loadLanguageModule(string $a_module)
Load language module.
setOfflineDirectory(string $offdir)
setHeader(string $a_title="")
setQEditTabs(string $a_active)
Set question editing tabs.
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
getActivationFormValues()
Get values for activation form.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
saveActivation()
Save Activation.
switchToLanguage()
Switch to language.
insertResources(string $a_output)
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
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.
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.
previewHistory()
Preview history.
string $requested_file_id
setTabHook(object $a_object, string $a_function)
setTemplateOutput(bool $a_output=true)
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) ...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
determineSourcecodeDownloadScript()
GUI class for public user profile presentation.
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 _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 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:
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.
ILIAS COPage Link LinkManager $link
ilGlobalTemplateInterface $tpl
getEnablePCType(string $a_pc_type)
object $meta_data_observer_obj
determineFileDownloadLink()
static initjQuery(?ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
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)
ILIAS COPage Editor GUIService $editor_gui
download_paragraph()
download source code paragraph
ilComponentFactory $component_factory
static getBaseContentStylePath()
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
bool $enabledcontentincludes
setFullscreenLink(string $a_fullscreen_link)
getTabs(string $a_activate="")
ILIAS TestQuestionPool Questions PublicInterface $questioninfo
setSourcecodeDownloadScript(string $script_name)
setPresentationTitle(string $a_title="")
string $file_download_link
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)
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.
static isActivated()
Checks whether Map feature is activated.
setFileDownloadLink(string $a_download_link)
ILIAS Notes Service $notes
form( $class_path, string $cmd, string $submit_caption="")
bool $render_page_container
setQuestionHTML(array $question_html)
ILIAS COPage Compare PageCompare $compare
initialOpenedContent()
Initially opened content.
rollback()
Rollback to a previous version.
ilPageConfig $page_config
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
setTemplate(ilGlobalTemplateInterface $main_tpl)
setEditMode()
Set edit mode.
ILIAS COPage Xsl XslManager $xsl
onFeedbackEditingForwarding()
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.
getAdditionalPageActions()
Get additional page actions.
string $offline_directory
initPageObject()
Init page object.
showPage()
display content of page
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
link(string $caption, string $href, bool $new_viewport=false)
setIntLinkReturn(string $a_return)
Page component editing request.
insertPageToc(string $a_output)
language()
description: > Example for rendring a language glyph.
getSourcecodeDownloadScript()
setOldNr(int $a_val)
Set old nr (historic page)
processAnswer()
Process answer.
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 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.
static getCacheTriggerString(ilPageObject $a_page)
Get page cache update trigger string.
setPrependingHtml(string $a_prependinghtml)
ILIAS COPage PC PCDefinition $pc_definition
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.
checkLangPageAvailable(int $id, string $lang)
setLinkParams(string $l_params="")
setTabs(ilTabsGUI $a_tabs)
setEnableEditing(bool $a_enableediting)
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.
displayValidationError($a_error)
display validation error
getLinkTargetByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)