ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\COPage\Page\PageQueryActionHandler Class Reference
+ Inheritance diagram for ILIAS\COPage\Page\PageQueryActionHandler:
+ Collaboration diagram for ILIAS\COPage\Page\PageQueryActionHandler:

Public Member Functions

 __construct (\ilPageObjectGUI $page_gui, string $pc_id="")
 
 handle (array $query)
 
 getActionsDropDown ()
 
 getMultiLangActions ()
 Add multi-language actions to menu. More...
 
 getMultiLangInfo ()
 
 getModalTemplate ()
 
 getConfirmationTemplate ()
 Get confirmation template. More...
 

Protected Member Functions

 allCommand ()
 
 getConfig ()
 
 getAddCommands ()
 
 getPageEditHelp ()
 Get page help (general) More...
 
 getMultiEditHelp ()
 Get page help (multi editing) More...
 
 getTopActions ()
 
 getMultiActions ()
 
 getPasteMessage ()
 Confirmation screen for cut/paste step. More...
 
 getErrorMessage ()
 Confirmation screen for cut/paste step. More...
 
 getErrorModalMessage ()
 
 getFormatSelection ()
 
 getPCModel ()
 Get page component model. More...
 
 componentEditFormResponse (array $query)
 
 getComponentsEditorUI ()
 Get components ui elements. More...
 
 getComponentsDefinitions ()
 
 getAutoSaveInterval ()
 Get auto save interval. More...
 

Protected Attributes

ILIAS COPage InternalGUIService $gui
 
ILIAS COPage PC PCDefinition $pc_definition
 
string $pc_id = ""
 
ILIAS DI UIServices $ui
 
ilLanguage $lng
 
ilPageObjectGUI $page_gui
 
ilObjUser $user
 
Server UIWrapper $ui_wrapper
 
ilCtrl $ctrl
 
ilComponentFactory $component_factory
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 30 of file class.PageQueryActionHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\COPage\Page\PageQueryActionHandler::__construct ( \ilPageObjectGUI  $page_gui,
string  $pc_id = "" 
)

Definition at line 43 of file class.PageQueryActionHandler.php.

References $DIC, ILIAS\COPage\Page\PageQueryActionHandler\$page_gui, ILIAS\COPage\Page\PageQueryActionHandler\$pc_id, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

44  {
45  global $DIC;
46 
47  $this->ui = $DIC->ui();
48  $this->lng = $DIC->language();
49  $this->page_gui = $page_gui;
50  $this->user = $DIC->user();
51  $this->ctrl = $DIC->ctrl();
52  $this->component_factory = $DIC["component.factory"];
53  $this->gui = $DIC->copage()->internal()->gui();
54  $this->pc_id = $pc_id;
55 
56  $this->ui_wrapper = new Server\UIWrapper($this->ui, $this->lng);
57  $this->pc_definition = $DIC
58  ->copage()
59  ->internal()
60  ->domain()
61  ->pc()
62  ->definition();
63  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ allCommand()

ILIAS\COPage\Page\PageQueryActionHandler::allCommand ( )
protected

Definition at line 80 of file class.PageQueryActionHandler.php.

References ILIAS\COPage\Page\PageQueryActionHandler\$ctrl, Vendor\Package\$f, ILIAS\COPage\Page\PageQueryActionHandler\$pc_id, $r, ilEditClipboard\getAction(), ILIAS\COPage\Page\PageQueryActionHandler\getAddCommands(), ILIAS\COPage\Page\PageQueryActionHandler\getAutoSaveInterval(), ILIAS\COPage\Page\PageQueryActionHandler\getComponentsDefinitions(), ILIAS\COPage\Page\PageQueryActionHandler\getComponentsEditorUI(), ILIAS\COPage\Page\PageQueryActionHandler\getConfig(), ILIAS\COPage\Page\PageQueryActionHandler\getConfirmationTemplate(), ILIAS\COPage\Page\PageQueryActionHandler\getErrorMessage(), ILIAS\COPage\Page\PageQueryActionHandler\getErrorModalMessage(), ILIAS\COPage\Page\PageQueryActionHandler\getFormatSelection(), ilUtil\getImagePath(), ILIAS\COPage\Page\PageQueryActionHandler\getModalTemplate(), ILIAS\COPage\Page\PageQueryActionHandler\getMultiActions(), ILIAS\COPage\Page\PageQueryActionHandler\getMultiEditHelp(), ILIAS\COPage\Page\PageQueryActionHandler\getPageEditHelp(), ILIAS\COPage\Page\PageQueryActionHandler\getPasteMessage(), ILIAS\COPage\Page\PageQueryActionHandler\getPCModel(), ILIAS\COPage\Page\PageQueryActionHandler\getTopActions(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\handle().

80  : Server\Response
81  {
83  $f = $this->ui->factory();
84  $dd = $f->dropdown()->standard([
85  $f->link()->standard("label", "#")
86  ]);
87  $r = $this->ui->renderer();
88  $o = new \stdClass();
89  $o->dropdown = $r->render($dd);
90  $o->addCommands = $this->getAddCommands();
91  $o->pageEditHelp = $this->getPageEditHelp();
92  $o->multiEditHelp = $this->getMultiEditHelp();
93  $o->pageTopActions = $this->getTopActions();
94  $o->multiActions = $this->getMultiActions();
95  $o->pasteMessage = $this->getPasteMessage();
96  $o->errorMessage = $this->getErrorMessage();
97  $o->errorModalMessage = $this->getErrorModalMessage();
98  $o->config = $this->getConfig();
99  $o->components = $this->getComponentsEditorUI();
100  $o->pcModel = $this->getPCModel();
101  $o->pcDefinition = $this->getComponentsDefinitions();
102  $o->formatSelection = $this->getFormatSelection();
103  $o->modal = $this->getModalTemplate();
104  $o->confirmation = $this->getConfirmationTemplate();
105  $o->autoSaveInterval = $this->getAutoSaveInterval();
106  $o->backUrl = $ctrl->getLinkTarget($this->page_gui, "edit");
107  $o->pasting = in_array(\ilEditClipboard::getAction(), ["copy", "cut"]) &&
108  count($this->user->getPCClipboardContent()) > 0;
109  $o->loaderUrl = \ilUtil::getImagePath("media/loader.svg");
110 
111  if ($this->pc_id !== "") {
112  $type = $this->page_gui->getPageObject()->getContentObjectForPcId($this->pc_id)->getType();
113  $def = $this->pc_definition->getPCDefinitionByType($type);
114  $o->initialComponent = $def["name"];
115  $o->initialPCId = $this->pc_id;
116  } else {
117  $o->initialComponent = "";
118  $o->initialPCId = "";
119  }
120 
121  return new Server\Response($o);
122  }
getPasteMessage()
Confirmation screen for cut/paste step.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
getErrorMessage()
Confirmation screen for cut/paste step.
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ componentEditFormResponse()

ILIAS\COPage\Page\PageQueryActionHandler::componentEditFormResponse ( array  $query)
protected

Definition at line 572 of file class.PageQueryActionHandler.php.

References ILIAS\COPage\Page\PageQueryActionHandler\$page_gui, and ilPageObjectGUI\getStyleId().

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\handle().

572  : Server\Response
573  {
574  $pc_edit = $this->pc_definition->getPCEditorInstanceByName($query["cname"]);
575  $form = "";
576  if (!is_null($pc_edit)) {
577  $form = $pc_edit->getEditComponentForm(
578  $this->ui_wrapper,
579  $this->page_gui->getPageObject()->getParentType(),
581  $this->page_gui->getStyleId(),
582  $query["pcid"]
583  );
584  }
585  $o = new \stdClass();
586  $o->editForm = $form;
587  return new Server\Response($o);
588  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActionsDropDown()

ILIAS\COPage\Page\PageQueryActionHandler::getActionsDropDown ( )

Definition at line 250 of file class.PageQueryActionHandler.php.

References ILIAS\COPage\Page\PageQueryActionHandler\$ctrl, $lm_set, ILIAS\COPage\Page\PageQueryActionHandler\$lng, ILIAS\COPage\Page\PageQueryActionHandler\$ui, ILIAS\COPage\Page\PageQueryActionHandler\$user, ANONYMOUS_USER_ID, ILIAS\COPage\Page\PageQueryActionHandler\getMultiLangActions(), ilLanguage\loadLanguageModule(), and ILIAS\Repository\user().

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\getTopActions().

251  {
252  $ui = $this->ui;
253  $user = $this->user;
254  $config = $this->page_gui->getPageConfig();
255  $page = $this->page_gui->getPageObject();
256  $ctrl = $this->ctrl;
257  $lng = $this->lng;
258 
259  // determine media, html and javascript mode
260  $sel_media_mode = ($user->getPref("ilPageEditor_MediaMode") != "disable");
261  $sel_html_mode = ($user->getPref("ilPageEditor_HTMLMode") != "disable");
262  $items = [];
263 
264  // activate/deactivate
265  if ($config->getEnableActivation()) {
266  $captions = $this->page_gui->getActivationCaptions();
267 
268  if ($page->getActive()) {
269  $items[] = $ui->factory()->link()->standard(
270  $captions["deactivatePage"],
271  $ctrl->getLinkTarget($this->page_gui, "deactivatePage")
272  );
273  } else {
274  $items[] = $ui->factory()->link()->standard(
275  $captions["activatePage"],
276  $ctrl->getLinkTarget($this->page_gui, "activatePage")
277  );
278  }
279  }
280 
281  // initially opened content
282  if ($config->getUseAttachedContent()) {
283  $items[] = $ui->factory()->link()->standard(
284  $lng->txt("cont_initial_attached_content"),
285  $ctrl->getLinkTarget($this->page_gui, "initialOpenedContent")
286  );
287  }
288 
289  // multi-lang actions
290  foreach ($this->getMultiLangActions() as $item) {
291  $items[] = $item;
292  }
293 
294  $lng->loadLanguageModule("content");
295 
296  // media mode
297  if ($sel_media_mode) {
298  $ctrl->setParameter($this->page_gui, "media_mode", "disable");
299  $items[] = $ui->factory()->link()->standard(
300  $lng->txt("cont_deactivate_media"),
301  $ctrl->getLinkTarget($this->page_gui, "setEditMode")
302  );
303  } else {
304  $ctrl->setParameter($this->page_gui, "media_mode", "enable");
305  $items[] = $ui->factory()->link()->standard(
306  $lng->txt("cont_activate_media"),
307  $ctrl->getLinkTarget($this->page_gui, "setEditMode")
308  );
309  }
310  $ctrl->setParameter($this, "media_mode", "");
311 
312  // html mode
313  if (!$config->getPreventHTMLUnmasking()) {
314  if ($sel_html_mode) {
315  $ctrl->setParameter($this->page_gui, "html_mode", "disable");
316  $items[] = $ui->factory()->link()->standard(
317  $lng->txt("cont_deactivate_html"),
318  $ctrl->getLinkTarget($this->page_gui, "setEditMode")
319  );
320  } else {
321  $ctrl->setParameter($this->page_gui, "html_mode", "enable");
322  $items[] = $ui->factory()->link()->standard(
323  $lng->txt("cont_activate_html"),
324  $ctrl->getLinkTarget($this->page_gui, "setEditMode")
325  );
326  }
327  }
328  $ctrl->setParameter($this->page_gui, "html_mode", "");
329 
330  $lm_set = new \ilSetting("lm");
331  if ($this->page_gui->getEnableEditing() && $this->user->getId() != ANONYMOUS_USER_ID) {
332  // history
333  if ($lm_set->get("page_history", 1)) {
334  $items[] = $ui->factory()->link()->standard(
335  $lng->txt("history"),
336  $ctrl->getLinkTarget($this->page_gui, "history")
337  );
338  }
339 
340  if ($config->getEnableScheduledActivation()) {
341  $items[] = $ui->factory()->link()->standard(
342  $lng->txt("cont_activation"),
343  $ctrl->getLinkTarget($this->page_gui, "editActivation")
344  );
345  }
346 
347  // clipboard
348  $items[] = $ui->factory()->link()->standard(
349  $lng->txt("clipboard"),
350  $ctrl->getLinkTargetByClass([get_class($this->page_gui), "ilEditClipboardGUI"], "view")
351  );
352 
353  if ($this->page_gui->getEnabledNews()) {
354  $items[] = $ui->factory()->link()->standard(
355  $lng->txt("news"),
356  $ctrl->getLinkTargetByClass([get_class($this->page_gui), "ilnewsitemgui"], "editNews")
357  );
358  }
359 
360  if (($md_link = $this->page_gui->getMetaDataLink()) !== "") {
361  $items[] = $ui->factory()->link()->standard(
362  $lng->txt("meta_data"),
363  $md_link
364  );
365  }
366  }
367 
368  if ($this->page_gui->use_meta_data) {
369  $mdgui = new \ilObjectMetaDataGUI(
370  $this->page_gui->meta_data_rep_obj,
371  $this->page_gui->meta_data_type,
372  $this->page_gui->meta_data_sub_obj_id
373  );
374  $mdtab = $mdgui->getTab();
375  if ($mdtab) {
376  $items[] = $ui->factory()->link()->standard(
377  $lng->txt("meta_data"),
378  $mdtab
379  );
380  }
381  }
382 
383 
384  if ($this->page_gui->getEnabledNews()) {
385  $items[] = $ui->factory()->link()->standard(
386  $lng->txt("news"),
387  $ctrl->getLinkTargetByClass([get_class($this->page_gui), \ilNewsItemGUI::class], "editNews")
388  );
389  }
390 
391 
392  // additional page actions
393  foreach ($this->page_gui->getAdditionalPageActions() as $item) {
394  $items[] = $item;
395  }
396 
397  return $ui->factory()->dropdown()->standard($items);
398  }
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
const ANONYMOUS_USER_ID
Definition: constants.php:27
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...
getMultiLangActions()
Add multi-language actions to menu.
loadLanguageModule(string $a_module)
Load language module.
getPref(string $a_keyword)
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
$lm_set
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
This describes a Standard Dropdown.
Definition: Standard.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAddCommands()

ILIAS\COPage\Page\PageQueryActionHandler::getAddCommands ( )
protected

Definition at line 149 of file class.PageQueryActionHandler.php.

References ILIAS\COPage\Page\PageQueryActionHandler\$lng, XapiProxy\$plugin, ilLanguage\txt(), and ilPageComponentPlugin\TXT_CMD_INSERT.

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

149  : array
150  {
151  $lng = $this->lng;
152 
153  $commands = [];
154 
155  // content types
156  $config = $this->page_gui->getPageConfig();
157  foreach ($config->getEnabledTopPCTypes() as $def) {
158  $commands[$def["pc_type"]] = $lng->txt("cont_ed_insert_" . $def["pc_type"]);
159  }
160 
161  // content templates
162  if (count($this->page_gui->getPageObject()->getContentTemplates()) > 0) {
163  $commands["templ"] = $lng->txt("cont_ed_insert_templ");
164  }
165 
166  // plugins
167  foreach ($this->component_factory->getActivePluginsInSlot("pgcp") as $plugin) {
168  if ($plugin->isValidParentType($this->page_gui->getPageObject()->getParentType())) {
169  $commands["plug_" . $plugin->getPluginName()] =
171  }
172  }
173  return $commands;
174  }
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAutoSaveInterval()

ILIAS\COPage\Page\PageQueryActionHandler::getAutoSaveInterval ( )
protected

Get auto save interval.

Definition at line 652 of file class.PageQueryActionHandler.php.

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

652  : int
653  {
654  $aset = new \ilSetting("adve");
655  return (int) $aset->get("autosave");
656  }
+ Here is the caller graph for this function:

◆ getComponentsDefinitions()

ILIAS\COPage\Page\PageQueryActionHandler::getComponentsDefinitions ( )
protected

Definition at line 613 of file class.PageQueryActionHandler.php.

References ILIAS\Repository\lng().

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

613  : array
614  {
615  $pcdef = [];
616  foreach ($this->pc_definition->getPCDefinitions() as $def) {
617  $pcdef["types"][$def["name"]] = $def["pc_type"];
618  $pcdef["names"][$def["pc_type"]] = $def["name"];
619  $pcdef["txt"][$def["pc_type"]] = $this->lng->txt("cont_" . "pc_" . $def["pc_type"]);
620  }
621  return $pcdef;
622  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComponentsEditorUI()

ILIAS\COPage\Page\PageQueryActionHandler::getComponentsEditorUI ( )
protected

Get components ui elements.

Definition at line 593 of file class.PageQueryActionHandler.php.

References ILIAS\COPage\Page\PageQueryActionHandler\$page_gui, ILIAS\COPage\Page\PageQueryActionHandler\$ui, and ilPageObjectGUI\getStyleId().

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

593  : array
594  {
595  $ui = [];
596  $config = $this->page_gui->getPageConfig();
597  foreach ($this->pc_definition->getPCDefinitions() as $def) {
598  $pc_edit = $this->pc_definition->getPCEditorInstanceByName($def["name"]);
599  if ($config->getEnablePCType($def["name"])) {
600  if (!is_null($pc_edit)) {
601  $ui[$def["name"]] = $pc_edit->getEditorElements(
602  $this->ui_wrapper,
603  $this->page_gui->getPageObject()->getParentType(),
605  $this->page_gui->getStyleId()
606  );
607  }
608  }
609  }
610  return $ui;
611  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getConfig()

ILIAS\COPage\Page\PageQueryActionHandler::getConfig ( )
protected

Definition at line 124 of file class.PageQueryActionHandler.php.

References $txt, ilObjStyleSheet\getContentStylePath(), ilUtil\getStyleSheetLocation(), ilPageConfig\SEC_PROTECT_PROTECTED, and ILIAS\Repository\user().

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

124  : \stdClass
125  {
126  $config = new \stdClass();
127  $config->user = $this->user->getLogin();
128  $config->content_css =
129  \ilObjStyleSheet::getContentStylePath($this->page_gui->getStyleId()) . ", " .
131  "./Services/COPage/css/tiny_extra.css";
132  $config->text_formats = \ilPCParagraphGUI::_getTextCharacteristics($this->page_gui->getStyleId());
133  $config->text_block_formats = [];
134  foreach (["text_block", "heading1", "heading2", "heading3"] as $type) {
135  $dummy_pc = new \ilPCParagraphGUI($this->page_gui->getPageObject(), null, "");
136  $dummy_pc->setStyleId($this->page_gui->getStyleId());
137  $dummy_pc->getCharacteristicsOfCurrentStyle([$type]);
138  foreach ($dummy_pc->getCharacteristics() as $char => $txt) {
139  $config->text_block_formats[$char] = $txt;
140  }
141  }
142  $config->editPlaceholders = $this->page_gui->getPageConfig()->getEnablePCType("PlaceHolder");
143  $config->activatedProtection =
144  ($this->page_gui->getPageConfig()->getSectionProtection() == \ilPageConfig::SEC_PROTECT_PROTECTED);
145 
146  return $config;
147  }
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
$txt
Definition: error.php:14
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getConfirmationTemplate()

ILIAS\COPage\Page\PageQueryActionHandler::getConfirmationTemplate ( )

Get confirmation template.

Definition at line 640 of file class.PageQueryActionHandler.php.

References ILIAS\COPage\Page\PageQueryActionHandler\$ui.

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

640  : string
641  {
642  $ui = $this->ui;
643 
644  $confirmation = $ui->factory()->messageBox()->confirmation("#text#");
645 
646  return $ui->renderer()->renderAsync($confirmation);
647  }
+ Here is the caller graph for this function:

◆ getErrorMessage()

ILIAS\COPage\Page\PageQueryActionHandler::getErrorMessage ( )
protected

Confirmation screen for cut/paste step.

Definition at line 512 of file class.PageQueryActionHandler.php.

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

512  : string
513  {
514  $html = $this->ui_wrapper->getRenderedFailureBox();
515 
516  return $html;
517  }
+ Here is the caller graph for this function:

◆ getErrorModalMessage()

ILIAS\COPage\Page\PageQueryActionHandler::getErrorModalMessage ( )
protected

Definition at line 519 of file class.PageQueryActionHandler.php.

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

519  : string
520  {
521  $html = $this->ui_wrapper->getRenderedModalFailureBox();
522 
523  return $html;
524  }
+ Here is the caller graph for this function:

◆ getFormatSelection()

ILIAS\COPage\Page\PageQueryActionHandler::getFormatSelection ( )
protected

Definition at line 526 of file class.PageQueryActionHandler.php.

References ILIAS\COPage\Page\PageQueryActionHandler\$lng, and ILIAS\COPage\Page\PageQueryActionHandler\$ui.

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

526  : string
527  {
528  $lng = $this->lng;
529  $ui = $this->ui;
530  $tpl = new \ilTemplate("tpl.format_selection.html", true, true, "Services/COPage/Editor");
531  $tpl->setVariable("TXT_PAR", $lng->txt("cont_choose_characteristic_text"));
532  $tpl->setVariable("TXT_SECTION", $lng->txt("cont_choose_characteristic_section"));
533  $tpl->setVariable("TXT_MEDIA", $lng->txt("cont_media"));
534 
535  $par_sel = new ParagraphStyleSelector($this->ui_wrapper, $this->page_gui->getStyleId());
536  $tpl->setVariable("PAR_SELECTOR", $ui->renderer()->renderAsync($par_sel->getStyleSelector("", "format", "format.paragraph", "format")));
537 
538  $sec_sel = new SectionStyleSelector($this->ui_wrapper, $this->page_gui->getStyleId());
539  $tpl->setVariable("SEC_SELECTOR", $ui->renderer()->renderAsync($sec_sel->getStyleSelector("", "format", "format.section", "format")));
540 
541  $med_sel = new MediaObjectStyleSelector($this->ui_wrapper, $this->page_gui->getStyleId());
542  $tpl->setVariable("MEDIA_SELECTOR", $ui->renderer()->renderAsync($med_sel->getStyleSelector("", "format", "format.media", "format")));
543 
544  $tpl->setVariable(
545  "SAVE_BUTTON",
546  $this->ui_wrapper->getRenderedButton(
547  $lng->txt("save"),
548  "format",
549  "format.save"
550  )
551  );
552  $tpl->setVariable(
553  "CANCEL_BUTTON",
554  $this->ui_wrapper->getRenderedButton(
555  $lng->txt("cancel"),
556  "format",
557  "format.cancel"
558  )
559  );
560  return $tpl->get();
561  }
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...
+ Here is the caller graph for this function:

◆ getModalTemplate()

ILIAS\COPage\Page\PageQueryActionHandler::getModalTemplate ( )

Definition at line 624 of file class.PageQueryActionHandler.php.

References ILIAS\COPage\Page\PageQueryActionHandler\$ui.

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

624  : array
625  {
626  $ui = $this->ui;
627  $modal = $ui->factory()->modal()->roundtrip('#title#', $ui->factory()->legacy('#content#'))
628  ->withActionButtons([
629  $ui->factory()->button()->standard('#button_title#', '#'),
630  ]);
631  $modalt["signal"] = $modal->getShowSignal()->getId();
632  $modalt["template"] = $ui->renderer()->renderAsync($modal);
633 
634  return $modalt;
635  }
+ Here is the caller graph for this function:

◆ getMultiActions()

ILIAS\COPage\Page\PageQueryActionHandler::getMultiActions ( )
protected

Definition at line 476 of file class.PageQueryActionHandler.php.

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

476  : string
477  {
478  $groups = [
479  [
480  "cut" => "cut",
481  "copy" => "copy",
482  "delete" => "delete"
483  ],
484  [
485  "all" => "select_all",
486  "none" => "cont_select_none",
487  ],
488  [
489  "activate" => "cont_ed_enable",
490  "characteristic" => "cont_assign_characteristic"
491  ]
492  ];
493 
494  return $this->ui_wrapper->getRenderedButtonGroups($groups);
495  }
+ Here is the caller graph for this function:

◆ getMultiEditHelp()

ILIAS\COPage\Page\PageQueryActionHandler::getMultiEditHelp ( )
protected

Get page help (multi editing)

Definition at line 199 of file class.PageQueryActionHandler.php.

References ILIAS\COPage\Page\PageQueryActionHandler\$lng, and ilLanguage\loadLanguageModule().

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

199  : string
200  {
201  $lng = $this->lng;
202  $lng->loadLanguageModule("content");
203  $tpl = new \ilTemplate("tpl.page_edit_help.html", true, true, "Services/COPage/Editor");
204  $tpl->setCurrentBlock("multi-help");
205  $tpl->setVariable("TXT_SEL", $lng->txt("cont_click_multi_select"));
206  $tpl->parseCurrentBlock();
207 
208  return $tpl->get();
209  }
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...
loadLanguageModule(string $a_module)
Load language module.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMultiLangActions()

ILIAS\COPage\Page\PageQueryActionHandler::getMultiLangActions ( )

Add multi-language actions to menu.

Definition at line 403 of file class.PageQueryActionHandler.php.

References ILIAS\COPage\Page\PageQueryActionHandler\$ctrl, $lang, ILIAS\COPage\Page\PageQueryActionHandler\$lng, ILIAS\COPage\Page\PageQueryActionHandler\$ui, and ilObjectTranslation\getInstance().

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\getActionsDropDown().

403  : array
404  {
405  $config = $this->page_gui->getPageConfig();
406  $page = $this->page_gui->getPageObject();
407  $ctrl = $this->ctrl;
408  $ui = $this->ui;
409  $lng = $this->lng;
410 
411  $items = [];
412 
413 
414  // general multi lang support and single page mode?
415  if ($config->getMultiLangSupport()) {
416  $ot = \ilObjectTranslation::getInstance($page->getParentId());
417 
418  if ($ot->getContentActivated()) {
419  $lng->loadLanguageModule("meta");
420 
421  if ($page->getLanguage() != "-") {
422  $l = $ot->getMasterLanguage();
423  $items[] = $ui->factory()->link()->standard(
424  $lng->txt("cont_edit_language_version") . ": " .
425  $lng->txt("meta_l_" . $l),
426  $ctrl->getLinkTarget($this->page_gui, "editMasterLanguage")
427  );
428  }
429 
430  foreach ($ot->getLanguages() as $al => $lang) {
431  if ($page->getLanguage() != $al &&
432  $al != $ot->getMasterLanguage()) {
433  $ctrl->setParameter($this->page_gui, "totransl", $al);
434  $items[] = $ui->factory()->link()->standard(
435  $lng->txt("cont_edit_language_version") . ": " .
436  $lng->txt("meta_l_" . $al),
437  $ctrl->getLinkTarget($this->page_gui, "switchToLanguage")
438  );
439  $ctrl->setParameter($this->page_gui, "totransl", "");
440  }
441  }
442  }
443  }
444 
445  return $items;
446  }
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...
loadLanguageModule(string $a_module)
Load language module.
static getInstance(int $obj_id)
$lang
Definition: xapiexit.php:26
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMultiLangInfo()

ILIAS\COPage\Page\PageQueryActionHandler::getMultiLangInfo ( )

Definition at line 448 of file class.PageQueryActionHandler.php.

References ILIAS\COPage\Page\PageQueryActionHandler\$lng, ILIAS\COPage\Page\PageQueryActionHandler\$ui, and ilObjectTranslation\getInstance().

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\getTopActions().

448  : string
449  {
450  $info = "";
451 
452  $config = $this->page_gui->getPageConfig();
453  $page = $this->page_gui->getPageObject();
454  $lng = $this->lng;
455  $ui = $this->ui;
456 
457  // general multi lang support and single page mode?
458  if ($config->getMultiLangSupport()) {
459  $ot = \ilObjectTranslation::getInstance($page->getParentId());
460 
461  if ($ot->getContentActivated()) {
462  $lng->loadLanguageModule("meta");
463 
464  $ml_gui = new \ilPageMultiLangGUI(
465  $page->getParentType(),
466  $page->getParentId()
467  );
468  $info = $ml_gui->getMultiLangInfo($page->getLanguage());
469  $info = $ui->renderer()->renderAsync($ui->factory()->messageBox()->info($info));
470  }
471  }
472 
473  return $info;
474  }
loadLanguageModule(string $a_module)
Load language module.
static getInstance(int $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPageEditHelp()

ILIAS\COPage\Page\PageQueryActionHandler::getPageEditHelp ( )
protected

Get page help (general)

Definition at line 179 of file class.PageQueryActionHandler.php.

References ILIAS\COPage\Page\PageQueryActionHandler\$lng, and ilLanguage\loadLanguageModule().

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

179  : string
180  {
181  $lng = $this->lng;
182  $lng->loadLanguageModule("content");
183  $tpl = new \ilTemplate("tpl.page_edit_help.html", true, true, "Services/COPage/Editor");
184  $tpl->setCurrentBlock("help");
185  $tpl->setVariable("TXT_ADD_EL", $lng->txt("cont_add_elements"));
186  $tpl->setVariable("PLUS", $this->gui->symbol()->glyph("add")->render());
187  $tpl->setVariable("DRAG_ARROW", $this->gui->symbol()->glyph("next")->render());
188  $tpl->setVariable("TXT_DRAG", $lng->txt("cont_drag_and_drop_elements"));
189  $tpl->setVariable("TXT_EDIT", $lng->txt("cont_click_edit"));
190  $tpl->setVariable("TXT_SEL", $lng->txt("cont_shift_click_to_select"));
191  $tpl->parseCurrentBlock();
192 
193  return $tpl->get();
194  }
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...
loadLanguageModule(string $a_module)
Load language module.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPasteMessage()

ILIAS\COPage\Page\PageQueryActionHandler::getPasteMessage ( )
protected

Confirmation screen for cut/paste step.

Definition at line 500 of file class.PageQueryActionHandler.php.

References ILIAS\COPage\Page\PageQueryActionHandler\$lng.

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

500  : string
501  {
502  $lng = $this->lng;
503 
504  $html = $this->ui_wrapper->getRenderedInfoBox($lng->txt("cont_sel_el_use_paste"));
505 
506  return $html;
507  }
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...
+ Here is the caller graph for this function:

◆ getPCModel()

ILIAS\COPage\Page\PageQueryActionHandler::getPCModel ( )
protected

Get page component model.

Definition at line 567 of file class.PageQueryActionHandler.php.

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

567  : array
568  {
569  return $this->page_gui->getPageObject()->getPCModel();
570  }
+ Here is the caller graph for this function:

◆ getTopActions()

ILIAS\COPage\Page\PageQueryActionHandler::getTopActions ( )
protected

Definition at line 211 of file class.PageQueryActionHandler.php.

References Vendor\Package\$b, ILIAS\COPage\Page\PageQueryActionHandler\$ctrl, ILIAS\COPage\Page\PageQueryActionHandler\$lng, ILIAS\COPage\Page\PageQueryActionHandler\$ui, ILIAS\COPage\Page\PageQueryActionHandler\getActionsDropDown(), ilUtil\getImagePath(), ILIAS\COPage\Page\PageQueryActionHandler\getMultiLangInfo(), and ilLanguage\loadLanguageModule().

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand().

211  : string
212  {
213  $ui = $this->ui;
214  $ctrl = $this->ctrl;
215  $lng = $this->lng;
216  $lng->loadLanguageModule("content");
217  $tpl = new \ilTemplate("tpl.top_actions.html", true, true, "Services/COPage/Editor");
218 
219  $dd = $this->getActionsDropDown();
220  $tpl->setVariable("DROPDOWN", $ui->renderer()->renderAsync($dd));
221 
222  if ($this->page_gui->getPageObject()->getEffectiveEditLockTime() > 0) {
223  $mess = $this->page_gui->getBlockingInfoMessage();
224  $tpl->setVariable("MESSAGE", $mess);
225  $b = $ui->factory()->button()->standard(
226  $lng->txt("cont_finish_editing"),
227  $ctrl->getLinkTarget($this->page_gui, "releasePageLock")
228  );
229  } else {
230  $b = $ui->factory()->button()->standard(
231  $lng->txt("cont_finish_editing"),
232  $ctrl->getLinkTarget($this->page_gui, "finishEditing")
233  );
234  }
235  $tpl->setVariable("MESSAGE2", $this->getMultiLangInfo());
236  $tpl->setVariable("QUIT_BUTTON", $ui->renderer()->renderAsync($b));
237 
238  $html = $this->ui_wrapper->getRenderedViewControl(
239  [
240  ["Page", "switch.single", $lng->txt("cont_edit_comp")],
241  ["Page", "switch.multi", $lng->txt("cont_edit_multi")]
242  ]
243  );
244  $tpl->setVariable("SWITCH", $html);
245  $tpl->setVariable("SRC_LOADER", \ilUtil::getImagePath("media/loader.svg"));
246 
247  return $tpl->get();
248  }
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 getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
loadLanguageModule(string $a_module)
Load language module.
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handle()

ILIAS\COPage\Page\PageQueryActionHandler::handle ( array  $query)
Exceptions
Exception

Definition at line 68 of file class.PageQueryActionHandler.php.

References ILIAS\COPage\Page\PageQueryActionHandler\allCommand(), and ILIAS\COPage\Page\PageQueryActionHandler\componentEditFormResponse().

68  : Server\Response
69  {
70  switch ($query["action"]) {
71  case "ui.all":
72  return $this->allCommand();
73 
74  case "component.edit.form":
75  return $this->componentEditFormResponse($query);
76  }
77  throw new Exception("Unknown action " . $query["action"]);
78  }
+ Here is the call graph for this function:

Field Documentation

◆ $component_factory

ilComponentFactory ILIAS\COPage\Page\PageQueryActionHandler::$component_factory
protected

Definition at line 41 of file class.PageQueryActionHandler.php.

◆ $ctrl

◆ $gui

ILIAS COPage InternalGUIService ILIAS\COPage\Page\PageQueryActionHandler::$gui
protected

Definition at line 32 of file class.PageQueryActionHandler.php.

◆ $lng

◆ $page_gui

◆ $pc_definition

ILIAS COPage PC PCDefinition ILIAS\COPage\Page\PageQueryActionHandler::$pc_definition
protected

Definition at line 33 of file class.PageQueryActionHandler.php.

◆ $pc_id

string ILIAS\COPage\Page\PageQueryActionHandler::$pc_id = ""
protected

◆ $ui

◆ $ui_wrapper

Server UIWrapper ILIAS\COPage\Page\PageQueryActionHandler::$ui_wrapper
protected

Definition at line 39 of file class.PageQueryActionHandler.php.

◆ $user

ilObjUser ILIAS\COPage\Page\PageQueryActionHandler::$user
protected

The documentation for this class was generated from the following file: