ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler Class Reference
+ Inheritance diagram for ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler:
+ Collaboration diagram for ILIAS\UI\Implementation\Component\Layout\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\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::__construct ( \ilPageObjectGUI  $page_gui,
string  $pc_id = "" 
)

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

References $DIC, ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$page_gui, ILIAS\UI\Implementation\Component\Layout\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: shib_login.php:25
+ Here is the call graph for this function:

Member Function Documentation

◆ allCommand()

ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::allCommand ( )
protected

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

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

Referenced by ILIAS\UI\Implementation\Component\Layout\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  $dd_html = preg_replace('/\s*id="[^"]*"/', '', $r->render($dd));
90  $r->renderAsync($dd); // this prevents further buttons to get the dd JS attached
91  $o->dropdown = $dd_html;
92  $o->addCommands = $this->getAddCommands();
93  $o->pageEditHelp = $this->getPageEditHelp();
94  $o->multiEditHelp = $this->getMultiEditHelp();
95  $o->pageTopActions = $this->getTopActions();
96  $o->multiActions = $this->getMultiActions();
97  $o->pasteMessage = $this->getPasteMessage();
98  $o->errorMessage = $this->getErrorMessage();
99  $o->errorModalMessage = $this->getErrorModalMessage();
100  $o->config = $this->getConfig();
101  $o->components = $this->getComponentsEditorUI();
102  $o->pcModel = $this->getPCModel();
103  $o->pcDefinition = $this->getComponentsDefinitions();
104  $o->formatSelection = $this->getFormatSelection();
105  $o->modal = $this->getModalTemplate();
106  $o->confirmation = $this->getConfirmationTemplate();
107  $o->autoSaveInterval = $this->getAutoSaveInterval();
108  $o->backUrl = $ctrl->getLinkTarget($this->page_gui, "edit");
109  $o->pasting = in_array(\ilEditClipboard::getAction(), ["copy", "cut"]) &&
110  count($this->user->getPCClipboardContent()) > 0;
111  $o->loaderUrl = \ilUtil::getImagePath("media/loader.svg");
112 
113  if ($this->pc_id !== "") {
114  $type = $this->page_gui->getPageObject()->getContentObjectForPcId($this->pc_id)->getType();
115  $def = $this->pc_definition->getPCDefinitionByType($type);
116  $o->initialComponent = $def["name"];
117  $o->initialPCId = $this->pc_id;
118  } else {
119  $o->initialComponent = "";
120  $o->initialPCId = "";
121  }
122 
123  return new Server\Response($o);
124  }
static getImagePath(string $image_name, 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)
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ componentEditFormResponse()

ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::componentEditFormResponse ( array  $query)
protected

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

References ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$page_gui, and ilPageObjectGUI\getStyleId().

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\handle().

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

◆ getActionsDropDown()

ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getActionsDropDown ( )

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

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

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\getTopActions().

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

◆ getAddCommands()

ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getAddCommands ( )
protected

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

References ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$lng, XapiProxy\$plugin, ilLanguage\txt(), and ilPageComponentPlugin\TXT_CMD_INSERT.

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

151  : array
152  {
153  $lng = $this->lng;
154 
155  $commands = [];
156 
157  // content types
158  $config = $this->page_gui->getPageConfig();
159  foreach ($config->getEnabledTopPCTypes() as $def) {
160  $commands[$def["pc_type"]] = $lng->txt("cont_ed_insert_" . $def["pc_type"]);
161  }
162 
163  // content templates
164  if (count($this->page_gui->getPageObject()->getContentTemplates()) > 0) {
165  $commands["templ"] = $lng->txt("cont_ed_insert_templ");
166  }
167 
168  // plugins
169  foreach ($this->component_factory->getActivePluginsInSlot("pgcp") as $plugin) {
170  if ($plugin->isValidParentType($this->page_gui->getPageObject()->getParentType())) {
171  $commands["plug_" . $plugin->getPluginName()] =
173  }
174  }
175  return $commands;
176  }
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\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getAutoSaveInterval ( )
protected

Get auto save interval.

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

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

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

◆ getComponentsDefinitions()

ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getComponentsDefinitions ( )
protected

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

References ILIAS\Repository\lng().

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

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

◆ getComponentsEditorUI()

ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getComponentsEditorUI ( )
protected

Get components ui elements.

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

References ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$page_gui, ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$ui, and ilPageObjectGUI\getStyleId().

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

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

◆ getConfig()

ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getConfig ( )
protected

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

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

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

126  : \stdClass
127  {
128  $config = new \stdClass();
129  $config->user = $this->user->getLogin();
130  $config->content_css =
131  \ilObjStyleSheet::getContentStylePath($this->page_gui->getStyleId()) . ", " .
133  "./components/ILIAS/COPage/css/tiny_extra.css";
134  $config->text_formats = \ilPCParagraphGUI::_getTextCharacteristics($this->page_gui->getStyleId());
135  $config->text_block_formats = [];
136  foreach (["text_block", "heading1", "heading2", "heading3"] as $type) {
137  $dummy_pc = new \ilPCParagraphGUI($this->page_gui->getPageObject(), null, "");
138  $dummy_pc->setStyleId($this->page_gui->getStyleId());
139  $dummy_pc->getCharacteristicsOfCurrentStyle([$type]);
140  foreach ($dummy_pc->getCharacteristics() as $char => $txt) {
141  $config->text_block_formats[$char] = $txt;
142  }
143  }
144  $config->editPlaceholders = $this->page_gui->getPageConfig()->getEnablePCType("PlaceHolder");
145  $config->activatedProtection =
146  ($this->page_gui->getPageConfig()->getSectionProtection() == \ilPageConfig::SEC_PROTECT_PROTECTED);
147 
148  return $config;
149  }
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
$txt
Definition: error.php:30
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\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getConfirmationTemplate ( )

Get confirmation template.

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

References ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$ui.

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

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

◆ getErrorMessage()

ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getErrorMessage ( )
protected

Confirmation screen for cut/paste step.

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

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

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

◆ getErrorModalMessage()

ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getErrorModalMessage ( )
protected

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

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

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

◆ getFormatSelection()

ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getFormatSelection ( )
protected

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

References ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$lng, and ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$ui.

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

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

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

References ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$ui.

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

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

◆ getMultiActions()

ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getMultiActions ( )
protected

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

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

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

◆ getMultiEditHelp()

ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getMultiEditHelp ( )
protected

Get page help (multi editing)

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

References ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$lng, and ilLanguage\loadLanguageModule().

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

201  : string
202  {
203  $lng = $this->lng;
204  $lng->loadLanguageModule("content");
205  $tpl = new \ilTemplate("tpl.page_edit_help.html", true, true, "components/ILIAS/COPage/Editor");
206  $tpl->setCurrentBlock("multi-help");
207  $tpl->setVariable("TXT_SEL", $lng->txt("cont_click_multi_select"));
208  $tpl->parseCurrentBlock();
209 
210  return $tpl->get();
211  }
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\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getMultiLangActions ( )

Add multi-language actions to menu.

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

References ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$ctrl, ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$lng, ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$ui, and ilObjectTranslation\getInstance().

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\getActionsDropDown().

405  : array
406  {
407  $config = $this->page_gui->getPageConfig();
408  $page = $this->page_gui->getPageObject();
409  $ctrl = $this->ctrl;
410  $ui = $this->ui;
411  $lng = $this->lng;
412 
413  $items = [];
414 
415 
416  // general multi lang support and single page mode?
417  if ($config->getMultiLangSupport()) {
418  $ot = \ilObjectTranslation::getInstance($page->getParentId());
419 
420  if ($ot->getContentActivated()) {
421  $lng->loadLanguageModule("meta");
422 
423  if ($page->getLanguage() != "-") {
424  $l = $ot->getMasterLanguage();
425  $items[] = $ui->factory()->link()->standard(
426  $lng->txt("cont_edit_language_version") . ": " .
427  $lng->txt("meta_l_" . $l),
428  $ctrl->getLinkTarget($this->page_gui, "editMasterLanguage")
429  );
430  }
431 
432  foreach ($ot->getLanguages() as $al => $lang) {
433  if ($page->getLanguage() != $al &&
434  $al != $ot->getMasterLanguage()) {
435  $ctrl->setParameter($this->page_gui, "totransl", $al);
436  $items[] = $ui->factory()->link()->standard(
437  $lng->txt("cont_edit_language_version") . ": " .
438  $lng->txt("meta_l_" . $al),
439  $ctrl->getLinkTarget($this->page_gui, "switchToLanguage")
440  );
441  $ctrl->setParameter($this->page_gui, "totransl", "");
442  }
443  }
444  }
445  }
446 
447  return $items;
448  }
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)
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\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getMultiLangInfo ( )

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

References ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$lng, ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$ui, and ilObjectTranslation\getInstance().

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\getTopActions().

450  : string
451  {
452  $info = "";
453 
454  $config = $this->page_gui->getPageConfig();
455  $page = $this->page_gui->getPageObject();
456  $lng = $this->lng;
457  $ui = $this->ui;
458 
459  // general multi lang support and single page mode?
460  if ($config->getMultiLangSupport()) {
461  $ot = \ilObjectTranslation::getInstance($page->getParentId());
462 
463  if ($ot->getContentActivated()) {
464  $lng->loadLanguageModule("meta");
465 
466  $ml_gui = new \ilPageMultiLangGUI(
467  $page->getParentType(),
468  $page->getParentId()
469  );
470  $info = $ml_gui->getMultiLangInfo($page->getLanguage());
471  $info = $ui->renderer()->renderAsync($ui->factory()->messageBox()->info($info));
472  }
473  }
474 
475  return $info;
476  }
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\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getPageEditHelp ( )
protected

Get page help (general)

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

References ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$lng, and ilLanguage\loadLanguageModule().

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

181  : string
182  {
183  $lng = $this->lng;
184  $lng->loadLanguageModule("content");
185  $tpl = new \ilTemplate("tpl.page_edit_help.html", true, true, "components/ILIAS/COPage/Editor");
186  $tpl->setCurrentBlock("help");
187  $tpl->setVariable("TXT_ADD_EL", $lng->txt("cont_add_elements"));
188  $tpl->setVariable("PLUS", $this->gui->symbol()->glyph("add")->render());
189  $tpl->setVariable("DRAG_ARROW", $this->gui->symbol()->glyph("next")->render());
190  $tpl->setVariable("TXT_DRAG", $lng->txt("cont_drag_and_drop_elements"));
191  $tpl->setVariable("TXT_EDIT", $lng->txt("cont_click_edit"));
192  $tpl->setVariable("TXT_SEL", $lng->txt("cont_shift_click_to_select"));
193  $tpl->parseCurrentBlock();
194 
195  return $tpl->get();
196  }
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\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getPasteMessage ( )
protected

Confirmation screen for cut/paste step.

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

References ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\$lng.

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

502  : string
503  {
504  $lng = $this->lng;
505 
506  $html = $this->ui_wrapper->getRenderedInfoBox($lng->txt("cont_sel_el_use_paste"));
507 
508  return $html;
509  }
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\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getPCModel ( )
protected

Get page component model.

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

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

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

◆ getTopActions()

ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::getTopActions ( )
protected

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

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

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand().

213  : string
214  {
215  $ui = $this->ui;
216  $ctrl = $this->ctrl;
217  $lng = $this->lng;
218  $lng->loadLanguageModule("content");
219  $tpl = new \ilTemplate("tpl.top_actions.html", true, true, "components/ILIAS/COPage/Editor");
220 
221  $dd = $this->getActionsDropDown();
222  $tpl->setVariable("DROPDOWN", $ui->renderer()->renderAsync($dd));
223 
224  if ($this->page_gui->getPageObject()->getEffectiveEditLockTime() > 0) {
225  $mess = $this->page_gui->getBlockingInfoMessage();
226  $tpl->setVariable("MESSAGE", $mess);
227  $b = $ui->factory()->button()->standard(
228  $lng->txt("cont_finish_editing"),
229  $ctrl->getLinkTarget($this->page_gui, "releasePageLock")
230  );
231  } else {
232  $b = $ui->factory()->button()->standard(
233  $lng->txt("cont_finish_editing"),
234  $ctrl->getLinkTarget($this->page_gui, "finishEditing")
235  );
236  }
237  $tpl->setVariable("MESSAGE2", $this->getMultiLangInfo());
238  $tpl->setVariable("QUIT_BUTTON", $ui->renderer()->renderAsync($b));
239 
240  $html = $this->ui_wrapper->getRenderedViewControl(
241  [
242  ["Page", "switch.single", $lng->txt("cont_edit_comp")],
243  ["Page", "switch.multi", $lng->txt("cont_edit_multi")]
244  ]
245  );
246  $tpl->setVariable("SWITCH", $html);
247  $tpl->setVariable("SRC_LOADER", \ilUtil::getImagePath("media/loader.svg"));
248 
249  return $tpl->get();
250  }
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 getImagePath(string $image_name, 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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handle()

ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::handle ( array  $query)
Exceptions
Exception

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

References ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler\allCommand(), and ILIAS\UI\Implementation\Component\Layout\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\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::$component_factory
protected

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

◆ $ctrl

◆ $gui

ILIAS COPage InternalGUIService ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::$gui
protected

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

◆ $lng

◆ $page_gui

◆ $pc_definition

ILIAS COPage PC PCDefinition ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::$pc_definition
protected

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

◆ $pc_id

string ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::$pc_id = ""
protected

◆ $ui

◆ $ui_wrapper

Server UIWrapper ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::$ui_wrapper
protected

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

◆ $user

ilObjUser ILIAS\UI\Implementation\Component\Layout\Page\PageQueryActionHandler::$user
protected

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