32 protected \ILIAS\DI\UIServices
$ui;
33 protected \ilLanguage
$lng;
44 $this->
ui = $DIC->ui();
45 $this->
lng = $DIC->language();
47 $this->
user = $DIC->user();
48 $this->
ctrl = $DIC->ctrl();
49 $this->component_factory =
$DIC[
"component.factory"];
59 switch (
$query[
"action"]) {
63 case "component.edit.form":
73 $f = $this->
ui->factory();
74 $dd =
$f->dropdown()->standard([
75 $f->link()->standard(
"label",
"#")
77 $r = $this->
ui->renderer();
79 $o->dropdown = $r->render($dd);
98 count($this->
user->getPCClipboardContent()) > 0;
110 "./Services/COPage/css/tiny_extra.css";
111 $config->text_formats = \ilPCParagraphGUI::_getTextCharacteristics($this->page_gui->getStyleId());
112 $config->text_block_formats = [];
113 foreach ([
"text_block",
"heading1",
"heading2",
"heading3"] as
$type) {
114 $dummy_pc = new \ilPCParagraphGUI($this->page_gui->getPageObject(),
null,
"");
115 $dummy_pc->setStyleId($this->page_gui->getStyleId());
116 $dummy_pc->getCharacteristicsOfCurrentStyle([
$type]);
117 foreach ($dummy_pc->getCharacteristics() as $char =>
$txt) {
121 $config->editPlaceholders = $this->page_gui->getPageConfig()->getEnablePCType(
"PlaceHolder");
135 $config = $this->page_gui->getPageConfig();
136 foreach (
$config->getEnabledTopPCTypes() as $def) {
137 $commands[$def[
"pc_type"]] =
$lng->
txt(
"cont_ed_insert_" . $def[
"pc_type"]);
141 if (count($this->page_gui->getPageObject()->getContentTemplates()) > 0) {
142 $commands[
"templ"] =
$lng->
txt(
"cont_ed_insert_templ");
146 foreach ($this->component_factory->getActivePluginsInSlot(
"pgcp") as
$plugin) {
147 if (
$plugin->isValidParentType($this->page_gui->getPageObject()->getParentType())) {
148 $commands[
"plug_" .
$plugin->getPluginName()] =
162 $tpl = new \ilTemplate(
"tpl.page_edit_help.html",
true,
true,
"Services/COPage/Editor");
163 $tpl->setCurrentBlock(
"help");
164 $tpl->setVariable(
"TXT_ADD_EL",
$lng->
txt(
"cont_add_elements"));
167 $tpl->setVariable(
"TXT_DRAG",
$lng->
txt(
"cont_drag_and_drop_elements"));
168 $tpl->setVariable(
"TXT_EDIT",
$lng->
txt(
"cont_click_edit"));
169 $tpl->setVariable(
"TXT_SEL",
$lng->
txt(
"cont_shift_click_to_select"));
170 $tpl->parseCurrentBlock();
182 $tpl = new \ilTemplate(
"tpl.page_edit_help.html",
true,
true,
"Services/COPage/Editor");
183 $tpl->setCurrentBlock(
"multi-help");
184 $tpl->setVariable(
"TXT_SEL",
$lng->
txt(
"cont_click_multi_select"));
185 $tpl->parseCurrentBlock();
196 $tpl = new \ilTemplate(
"tpl.top_actions.html",
true,
true,
"Services/COPage/Editor");
199 $tpl->setVariable(
"DROPDOWN", $ui->renderer()->renderAsync($dd));
201 if ($this->page_gui->getPageObject()->getEffectiveEditLockTime() > 0) {
202 $mess = $this->page_gui->getBlockingInfoMessage();
203 $tpl->setVariable(
"MESSAGE", $mess);
204 $b =
$ui->factory()->button()->standard(
205 $lng->
txt(
"cont_finish_editing"),
209 $b =
$ui->factory()->button()->standard(
210 $lng->
txt(
"cont_finish_editing"),
215 $tpl->setVariable(
"QUIT_BUTTON", $ui->renderer()->renderAsync(
$b));
217 $html = $this->ui_wrapper->getRenderedViewControl(
219 [
"Page",
"switch.single",
$lng->
txt(
"cont_edit_comp")],
220 [
"Page",
"switch.multi",
$lng->
txt(
"cont_edit_multi")]
223 $tpl->setVariable(
"SWITCH", $html);
233 $config = $this->page_gui->getPageConfig();
234 $page = $this->page_gui->getPageObject();
239 $sel_media_mode = (
$user->
getPref(
"ilPageEditor_MediaMode") !=
"disable");
240 $sel_html_mode = (
$user->
getPref(
"ilPageEditor_HTMLMode") !=
"disable");
244 if (
$config->getEnableActivation()) {
245 $captions = $this->page_gui->getActivationCaptions();
247 if ($page->getActive()) {
248 $items[] =
$ui->factory()->link()->standard(
249 $captions[
"deactivatePage"],
253 $items[] =
$ui->factory()->link()->standard(
254 $captions[
"activatePage"],
261 if (
$config->getUseAttachedContent()) {
262 $items[] =
$ui->factory()->link()->standard(
263 $lng->
txt(
"cont_initial_attached_content"),
276 if ($sel_media_mode) {
278 $items[] =
$ui->factory()->link()->standard(
279 $lng->
txt(
"cont_deactivate_media"),
284 $items[] =
$ui->factory()->link()->standard(
285 $lng->
txt(
"cont_activate_media"),
292 if (!
$config->getPreventHTMLUnmasking()) {
293 if ($sel_html_mode) {
295 $items[] =
$ui->factory()->link()->standard(
296 $lng->
txt(
"cont_deactivate_html"),
301 $items[] =
$ui->factory()->link()->standard(
302 $lng->
txt(
"cont_activate_html"),
309 $lm_set = new \ilSetting(
"lm");
310 if ($this->page_gui->getEnableEditing() && $this->user->getId() !=
ANONYMOUS_USER_ID) {
313 if (
$lm_set->get(
"page_history", 1)) {
314 $items[] =
$ui->factory()->link()->standard(
320 if (
$config->getEnableScheduledActivation()) {
321 $items[] =
$ui->factory()->link()->standard(
328 $items[] =
$ui->factory()->link()->standard(
334 if ($this->page_gui->use_meta_data) {
335 $mdgui = new \ilObjectMetaDataGUI(
336 $this->page_gui->meta_data_rep_obj,
337 $this->page_gui->meta_data_type,
338 $this->page_gui->meta_data_sub_obj_id
340 $mdtab = $mdgui->getTab();
342 $items[] =
$ui->factory()->link()->standard(
350 if ($this->page_gui->getEnabledNews()) {
351 $items[] =
$ui->factory()->link()->standard(
359 foreach ($this->page_gui->getAdditionalPageActions() as $item) {
363 return $ui->factory()->dropdown()->standard($items);
371 $config = $this->page_gui->getPageConfig();
372 $page = $this->page_gui->getPageObject();
381 if (
$config->getMultiLangSupport()) {
384 if ($ot->getContentActivated()) {
387 if ($page->getLanguage() !=
"-") {
388 $l = $ot->getMasterLanguage();
389 $items[] =
$ui->factory()->link()->standard(
390 $lng->
txt(
"cont_edit_language_version") .
": " .
396 foreach ($ot->getLanguages() as $al =>
$lang) {
397 if ($page->getLanguage() != $al &&
398 $al != $ot->getMasterLanguage()) {
400 $items[] =
$ui->factory()->link()->standard(
401 $lng->
txt(
"cont_edit_language_version") .
": " .
418 $config = $this->page_gui->getPageConfig();
419 $page = $this->page_gui->getPageObject();
424 if (
$config->getMultiLangSupport()) {
427 if ($ot->getContentActivated()) {
430 $ml_gui = new \ilPageMultiLangGUI(
431 $page->getParentType(),
434 $info = $ml_gui->getMultiLangInfo($page->getLanguage());
435 $info =
$ui->renderer()->renderAsync(
$ui->factory()->messageBox()->info($info));
451 "all" =>
"select_all",
452 "none" =>
"cont_select_none",
455 "activate" =>
"cont_ed_enable",
456 "characteristic" =>
"cont_assign_characteristic"
460 return $this->ui_wrapper->getRenderedButtonGroups($groups);
470 $html = $this->ui_wrapper->getRenderedInfoBox(
$lng->
txt(
"cont_sel_el_use_paste"));
480 $html = $this->ui_wrapper->getRenderedFailureBox();
487 $html = $this->ui_wrapper->getRenderedModalFailureBox();
496 $tpl = new \ilTemplate(
"tpl.format_selection.html",
true,
true,
"Services/COPage/Editor");
497 $tpl->setVariable(
"TXT_PAR",
$lng->
txt(
"cont_choose_characteristic_text"));
498 $tpl->setVariable(
"TXT_SECTION",
$lng->
txt(
"cont_choose_characteristic_section"));
499 $tpl->setVariable(
"TXT_MEDIA",
$lng->
txt(
"cont_media"));
502 $tpl->setVariable(
"PAR_SELECTOR",
$ui->renderer()->renderAsync($par_sel->getStyleSelector(
"",
"format",
"format.paragraph",
"format")));
505 $tpl->setVariable(
"SEC_SELECTOR",
$ui->renderer()->renderAsync($sec_sel->getStyleSelector(
"",
"format",
"format.section",
"format")));
508 $tpl->setVariable(
"MEDIA_SELECTOR",
$ui->renderer()->renderAsync($med_sel->getStyleSelector(
"",
"format",
"format.media",
"format")));
512 $this->ui_wrapper->getRenderedButton(
520 $this->ui_wrapper->getRenderedButton(
535 return $this->page_gui->getPageObject()->getPCModel();
542 if (!is_null($pc_edit)) {
543 $form = $pc_edit->getEditComponentForm(
545 $this->page_gui->getPageObject()->getParentType(),
547 $this->page_gui->getStyleId(),
551 $o = new \stdClass();
552 $o->editForm = $form;
564 if (!is_null($pc_edit)) {
565 $ui[$def[
"name"]] = $pc_edit->getEditorElements(
567 $this->page_gui->getPageObject()->getParentType(),
569 $this->page_gui->getStyleId()
580 $pcdef[
"types"][$def[
"name"]] = $def[
"pc_type"];
581 $pcdef[
"names"][$def[
"pc_type"]] = $def[
"name"];
582 $pcdef[
"txt"][$def[
"pc_type"]] = $this->
lng->txt(
"cont_" .
"pc_" . $def[
"pc_type"]);
590 $modal =
$ui->factory()->modal()->roundtrip(
'#title#',
$ui->factory()->legacy(
'#content#'))
591 ->withActionButtons([
592 $ui->factory()->button()->standard(
'#button_title#',
'#'),
594 $modalt[
"signal"] = $modal->getShowSignal()->getId();
595 $modalt[
"template"] =
$ui->renderer()->renderAsync($modal);
607 $confirmation =
$ui->factory()->messageBox()->confirmation(
"#text#");
609 return $ui->renderer()->renderAsync($confirmation);
617 $aset = new \ilSetting(
"adve");
618 return (
int) $aset->get(
"autosave");
getPageEditHelp()
Get page help (general)
Server UIWrapper $ui_wrapper
getMultiEditHelp()
Get page help (multi editing)
getAutoSaveInterval()
Get auto save interval.
componentEditFormResponse(array $query)
getComponentsEditorUI()
Get components ui elements.
getPCModel()
Get page component model.
getMultiLangActions()
Add multi-language actions to menu.
ilPageObjectGUI $page_gui
getConfirmationTemplate()
Get confirmation template.
ilComponentFactory $component_factory
__construct(\ilPageObjectGUI $page_gui)
getPasteMessage()
Confirmation screen for cut/paste step.
getErrorMessage()
Confirmation screen for cut/paste step.
getComponentsDefinitions()
static getPCDefinitions()
static getPCEditorInstanceByName(string $a_name)
Get instance.
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
static get(string $a_glyph, string $a_text="")
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
getPref(string $a_keyword)
static getInstance(int $obj_id)
const SEC_PROTECT_PROTECTED
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 getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
Query action handler interface.
This describes commonalities between all types of Dropdowns.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.