ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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 ()
 
 getDropdownTemplate (string $aria_label="")
 
 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
 
ilDBInterface $db
 
ilComponentFactory $component_factory
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

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

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

46 {
47 global $DIC;
48
49 $this->ui = $DIC->ui();
50 $this->lng = $DIC->language();
51 $this->page_gui = $page_gui;
52 $this->user = $DIC->user();
53 $this->ctrl = $DIC->ctrl();
54 $this->db = $DIC->database();
55 $this->component_factory = $DIC["component.factory"];
56 $this->gui = $DIC->copage()->internal()->gui();
57 $this->pc_id = $pc_id;
58
59 $this->ui_wrapper = new Server\UIWrapper($this->ui, $this->lng);
60 $this->pc_definition = $DIC
61 ->copage()
62 ->internal()
63 ->domain()
64 ->pc()
65 ->definition();
66 }
global $DIC
Definition: shib_login.php:26

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().

+ Here is the call graph for this function:

Member Function Documentation

◆ allCommand()

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

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

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

References ILIAS\COPage\Page\PageQueryActionHandler\$ctrl, ILIAS\COPage\Page\PageQueryActionHandler\$pc_id, 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\getDropdownTemplate(), ILIAS\COPage\Page\PageQueryActionHandler\getErrorMessage(), ILIAS\COPage\Page\PageQueryActionHandler\getErrorModalMessage(), ILIAS\COPage\Page\PageQueryActionHandler\getFormatSelection(), ilUtil\getImagePath(), ilCtrl\getLinkTarget(), 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\lng(), and ILIAS\Repository\user().

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

+ 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 581 of file class.PageQueryActionHandler.php.

581 : Server\Response
582 {
583 $pc_edit = $this->pc_definition->getPCEditorInstanceByName($query["cname"]);
584 $form = "";
585 if (!is_null($pc_edit)) {
586 $form = $pc_edit->getEditComponentForm(
587 $this->ui_wrapper,
588 $this->page_gui->getPageObject()->getParentType(),
589 $this->page_gui,
590 $this->page_gui->getStyleId(),
591 $query["pcid"]
592 );
593 }
594 $o = new \stdClass();
595 $o->editForm = $form;
596 return new Server\Response($o);
597 }

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

+ Here is the caller graph for this function:

◆ getActionsDropDown()

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

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

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

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, ilCtrl\getLinkTarget(), ilCtrl\getLinkTargetByClass(), ILIAS\COPage\Page\PageQueryActionHandler\getMultiLangActions(), ilObjUser\getPref(), ilLanguage\loadLanguageModule(), ilCtrl\setParameter(), and ilLanguage\txt().

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

+ 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 163 of file class.PageQueryActionHandler.php.

163 : array
164 {
166
167 $commands = [];
168
169 // content types
170 $config = $this->page_gui->getPageConfig();
171 foreach ($config->getEnabledTopPCTypes() as $def) {
172 $commands[$def["pc_type"]] = $lng->txt("cont_ed_insert_" . $def["pc_type"]);
173 }
174
175 // content templates
176 if (count($this->page_gui->getPageObject()->getContentTemplates()) > 0) {
177 $commands["templ"] = $lng->txt("cont_ed_insert_templ");
178 }
179
180 // plugins
181 foreach ($this->component_factory->getActivePluginsInSlot("pgcp") as $plugin) {
182 if ($plugin->isValidParentType($this->page_gui->getPageObject()->getParentType())) {
183 $commands["plug_" . $plugin->getPluginName()] =
185 }
186 }
187 return $commands;
188 }

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

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

+ 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 662 of file class.PageQueryActionHandler.php.

662 : int
663 {
664 $aset = new \ilSetting("adve");
665 return (int) $aset->get("autosave");
666 }

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

+ Here is the caller graph for this function:

◆ getComponentsDefinitions()

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

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

622 : array
623 {
624 $pcdef = [];
625 foreach ($this->pc_definition->getPCDefinitions() as $def) {
626 $pcdef["types"][$def["name"]] = $def["pc_type"];
627 $pcdef["names"][$def["pc_type"]] = $def["name"];
628 $pcdef["txt"][$def["pc_type"]] = $this->lng->txt("cont_" . "pc_" . $def["pc_type"]);
629 }
630 return $pcdef;
631 }

References ILIAS\Repository\lng().

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

+ 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 602 of file class.PageQueryActionHandler.php.

602 : array
603 {
604 $ui = [];
605 $config = $this->page_gui->getPageConfig();
606 foreach ($this->pc_definition->getPCDefinitions() as $def) {
607 $pc_edit = $this->pc_definition->getPCEditorInstanceByName($def["name"]);
608 if ($config->getEnablePCType($def["name"])) {
609 if (!is_null($pc_edit)) {
610 $ui[$def["name"]] = $pc_edit->getEditorElements(
611 $this->ui_wrapper,
612 $this->page_gui->getPageObject()->getParentType(),
613 $this->page_gui,
614 $this->page_gui->getStyleId()
615 );
616 }
617 }
618 }
619 return $ui;
620 }

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

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

+ Here is the caller graph for this function:

◆ getConfig()

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

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

138 : \stdClass
139 {
140 $config = new \stdClass();
141 $config->user = $this->user->getLogin();
142 $config->content_css =
143 \ilObjStyleSheet::getContentStylePath($this->page_gui->getStyleId()) . ", " .
145 "./components/ILIAS/COPage/css/tiny_extra.css";
146 $config->text_formats = \ilPCParagraphGUI::_getTextCharacteristics($this->page_gui->getStyleId());
147 $config->text_block_formats = [];
148 foreach (["text_block", "heading1", "heading2", "heading3"] as $type) {
149 $dummy_pc = new \ilPCParagraphGUI($this->page_gui->getPageObject(), null, "");
150 $dummy_pc->setStyleId($this->page_gui->getStyleId());
151 $dummy_pc->getCharacteristicsOfCurrentStyle([$type]);
152 foreach ($dummy_pc->getCharacteristics() as $char => $txt) {
153 $config->text_block_formats[$char] = $txt;
154 }
155 }
156 $config->editPlaceholders = $this->page_gui->getPageConfig()->getEnablePCType("PlaceHolder");
157 $config->activatedProtection =
158 ($this->page_gui->getPageConfig()->getSectionProtection() == \ilPageConfig::SEC_PROTECT_PROTECTED);
159
160 return $config;
161 }
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user

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

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

+ 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 650 of file class.PageQueryActionHandler.php.

650 : string
651 {
652 $ui = $this->ui;
653
654 $confirmation = $ui->factory()->messageBox()->confirmation("#text#");
655
656 return $ui->renderer()->renderAsync($confirmation);
657 }

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

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

+ Here is the caller graph for this function:

◆ getDropdownTemplate()

ILIAS\COPage\Page\PageQueryActionHandler::getDropdownTemplate ( string  $aria_label = "")
protected

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

123 : string
124 {
125 $f = $this->ui->factory();
126 $dd = $f->dropdown()->standard([
127 $f->link()->standard("label", "#")
128 ]);
129 if ($aria_label !== "") {
130 $dd = $dd->withAriaLabel($aria_label);
131 }
132 $r = $this->ui->renderer();
133 $dd_html = preg_replace('/\s*id="[^"]*"/', '', $r->render($dd));
134 $r->renderAsync($dd); // this prevents further buttons to get the dd JS attached
135 return $dd_html;
136 }

References Vendor\Package\$f, and ILIAS\Repository\ui().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getErrorMessage()

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

Confirmation screen for cut/paste step.

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

521 : string
522 {
523 $html = $this->ui_wrapper->getRenderedFailureBox();
524
525 return $html;
526 }

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

+ Here is the caller graph for this function:

◆ getErrorModalMessage()

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

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

528 : string
529 {
530 $html = $this->ui_wrapper->getRenderedModalFailureBox();
531
532 return $html;
533 }

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

+ Here is the caller graph for this function:

◆ getFormatSelection()

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

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

535 : string
536 {
538 $ui = $this->ui;
539 $tpl = new \ilTemplate("tpl.format_selection.html", true, true, "components/ILIAS/COPage/Editor");
540 $tpl->setVariable("TXT_PAR", $lng->txt("cont_choose_characteristic_text"));
541 $tpl->setVariable("TXT_SECTION", $lng->txt("cont_choose_characteristic_section"));
542 $tpl->setVariable("TXT_MEDIA", $lng->txt("cont_media"));
543
544 $par_sel = new ParagraphStyleSelector($this->ui_wrapper, $this->page_gui->getStyleId());
545 $tpl->setVariable("PAR_SELECTOR", $ui->renderer()->renderAsync($par_sel->getStyleSelector(" ", "format", "format.paragraph", "format")));
546
547 $sec_sel = new SectionStyleSelector($this->ui_wrapper, $this->page_gui->getStyleId());
548 $tpl->setVariable("SEC_SELECTOR", $ui->renderer()->renderAsync($sec_sel->getStyleSelector(" ", "format", "format.section", "format")));
549
550 $med_sel = new MediaObjectStyleSelector($this->ui_wrapper, $this->page_gui->getStyleId());
551 $tpl->setVariable("MEDIA_SELECTOR", $ui->renderer()->renderAsync($med_sel->getStyleSelector(" ", "format", "format.media", "format")));
552
553 $tpl->setVariable(
554 "SAVE_BUTTON",
555 $this->ui_wrapper->getRenderedButton(
556 $lng->txt("save"),
557 "format",
558 "format.save"
559 )
560 );
561 $tpl->setVariable(
562 "CANCEL_BUTTON",
563 $this->ui_wrapper->getRenderedButton(
564 $lng->txt("cancel"),
565 "format",
566 "format.cancel"
567 )
568 );
569 return $tpl->get();
570 }

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getModalTemplate()

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

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

633 : array
634 {
635 $ui = $this->ui;
636 $modal = $ui->factory()->modal()->roundtrip('#title#', $ui->factory()->legacy()->content('#content#'))
637 ->withActionButtons([
638 $ui->factory()->button()->standard('#button_title#', '#'),
639 ]);
640 $modalt["signal"] = $modal->getShowSignal()->getId();
641 $modalt["closeSignal"] = $modal->getCloseSignal()->getId();
642 $modalt["template"] = $ui->renderer()->renderAsync($modal);
643
644 return $modalt;
645 }

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

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

+ Here is the caller graph for this function:

◆ getMultiActions()

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

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

485 : string
486 {
487 $groups = [
488 [
489 "cut" => "cut",
490 "copy" => "copy",
491 "delete" => "delete"
492 ],
493 [
494 "all" => "select_all",
495 "none" => "cont_select_none",
496 ],
497 [
498 "activate" => "cont_ed_enable",
499 "characteristic" => "cont_assign_characteristic"
500 ]
501 ];
502
503 return $this->ui_wrapper->getRenderedButtonGroups($groups);
504 }

Referenced by ILIAS\COPage\Page\PageQueryActionHandler\allCommand(), and ILIAS\UI\Implementation\Component\Table\AbstractTable\hasMultiActions().

+ Here is the caller graph for this function:

◆ getMultiEditHelp()

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

Get page help (multi editing)

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

213 : string
214 {
216 $lng->loadLanguageModule("content");
217 $tpl = new \ilTemplate("tpl.page_edit_help.html", true, true, "components/ILIAS/COPage/Editor");
218 $tpl->setCurrentBlock("multi-help");
219 $tpl->setVariable("TXT_SEL", $lng->txt("cont_click_multi_select"));
220 $tpl->parseCurrentBlock();
221
222 return $tpl->get();
223 }

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

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

+ 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 408 of file class.PageQueryActionHandler.php.

408 : array
409 {
410 $config = $this->page_gui->getPageConfig();
411 $page = $this->page_gui->getPageObject();
413 $ui = $this->ui;
415
416 $items = [];
417
418
419 // general multi lang support and single page mode?
420 if ($config->getMultiLangSupport()) {
421 $ot = (new TranslationsRepository(
422 $this->db
423 ))->getFor($page->getParentId());
424
425 if ($ot->getContentTranslationActivated()) {
426 $lng->loadLanguageModule("meta");
427
428 if ($page->getLanguage() != "-") {
429 $l = $ot->getBaseLanguage();
430 $items[] = $ui->factory()->link()->standard(
431 $lng->txt("cont_edit_language_version") . ": " .
432 $lng->txt("meta_l_" . $l),
433 $ctrl->getLinkTarget($this->page_gui, "editMasterLanguage")
434 );
435 }
436
437 foreach ($ot->getLanguages() as $al => $lang) {
438 if ($page->getLanguage() != $al &&
439 $al != $ot->getBaseLanguage()) {
440 $ctrl->setParameter($this->page_gui, "totransl", $al);
441 $items[] = $ui->factory()->link()->standard(
442 $lng->txt("cont_edit_language_version") . ": " .
443 $lng->txt("meta_l_" . $al),
444 $ctrl->getLinkTarget($this->page_gui, "switchToLanguage")
445 );
446 $ctrl->setParameter($this->page_gui, "totransl", "");
447 }
448 }
449 }
450 }
451
452 return $items;
453 }

References ILIAS\COPage\Page\PageQueryActionHandler\$ctrl, ILIAS\COPage\Page\PageQueryActionHandler\$lng, ILIAS\COPage\Page\PageQueryActionHandler\$ui, ilCtrl\getLinkTarget(), ilLanguage\loadLanguageModule(), ilCtrl\setParameter(), and ilLanguage\txt().

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

+ 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 455 of file class.PageQueryActionHandler.php.

455 : string
456 {
457 $info = "";
458
459 $config = $this->page_gui->getPageConfig();
460 $page = $this->page_gui->getPageObject();
462 $ui = $this->ui;
463
464 // general multi lang support and single page mode?
465 if ($config->getMultiLangSupport()) {
466 $ot = (new TranslationsRepository(
467 $this->db
468 ))->getFor($page->getParentId());
469
470 if ($ot->getContentTranslationActivated()) {
471 $lng->loadLanguageModule("meta");
472
473 $ml_gui = new \ilPageMultiLangGUI(
474 $page->getParentType(),
475 $page->getParentId()
476 );
477 $info = $ml_gui->getMultiLangInfo($page->getLanguage());
478 $info = $ui->renderer()->renderAsync($ui->factory()->messageBox()->info($info));
479 }
480 }
481
482 return $info;
483 }
$info
Definition: entry_point.php:21

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

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

+ 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 193 of file class.PageQueryActionHandler.php.

193 : string
194 {
196 $lng->loadLanguageModule("content");
197 $tpl = new \ilTemplate("tpl.page_edit_help.html", true, true, "components/ILIAS/COPage/Editor");
198 $tpl->setCurrentBlock("help");
199 $tpl->setVariable("TXT_ADD_EL", $lng->txt("cont_add_elements"));
200 $tpl->setVariable("PLUS", $this->gui->symbol()->glyph("add")->render());
201 $tpl->setVariable("DRAG_ARROW", $this->gui->symbol()->glyph("next")->render());
202 $tpl->setVariable("TXT_DRAG", $lng->txt("cont_drag_and_drop_elements"));
203 $tpl->setVariable("TXT_EDIT", $lng->txt("cont_click_edit"));
204 $tpl->setVariable("TXT_SEL", $lng->txt("cont_shift_click_to_select"));
205 $tpl->parseCurrentBlock();
206
207 return $tpl->get();
208 }

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

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

+ 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 509 of file class.PageQueryActionHandler.php.

509 : string
510 {
512
513 $html = $this->ui_wrapper->getRenderedInfoBox($lng->txt("cont_sel_el_use_paste"));
514
515 return $html;
516 }

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPCModel()

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

Get page component model.

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

576 : array
577 {
578 return $this->page_gui->getPageObject()->getPCModel();
579 }

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

+ Here is the caller graph for this function:

◆ getTopActions()

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

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

225 : string
226 {
227 $ui = $this->ui;
230 $lng->loadLanguageModule("content");
231 $tpl = new \ilTemplate("tpl.top_actions.html", true, true, "components/ILIAS/COPage/Editor");
232
233 $dd = $this->getActionsDropDown();
234 $tpl->setVariable("DROPDOWN", $ui->renderer()->renderAsync($dd));
235
236 if ($this->page_gui->getPageObject()->getEffectiveEditLockTime() > 0) {
237 $mess = $this->page_gui->getBlockingInfoMessage();
238 $tpl->setVariable("MESSAGE", $mess);
239 $b = $ui->factory()->button()->standard(
240 $lng->txt("cont_finish_editing"),
241 $ctrl->getLinkTarget($this->page_gui, "releasePageLock")
242 );
243 } else {
244 $b = $ui->factory()->button()->standard(
245 $lng->txt("cont_finish_editing"),
246 $ctrl->getLinkTarget($this->page_gui, "finishEditing")
247 );
248 }
249 $tpl->setVariable("MESSAGE2", $this->getMultiLangInfo());
250 $tpl->setVariable("QUIT_BUTTON", $ui->renderer()->renderAsync($b));
251
252 $html = $this->ui_wrapper->getRenderedViewControl(
253 [
254 ["Page", "switch.single", $lng->txt("cont_edit_comp")],
255 ["Page", "switch.multi", $lng->txt("cont_edit_multi")]
256 ]
257 );
258 $tpl->setVariable("SWITCH", $html);
259 $tpl->setVariable("SRC_LOADER", \ilUtil::getImagePath("media/loader.svg"));
260
261 return $tpl->get();
262 }

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(), ilCtrl\getLinkTarget(), ILIAS\COPage\Page\PageQueryActionHandler\getMultiLangInfo(), ilLanguage\loadLanguageModule(), and ilLanguage\txt().

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

+ 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 71 of file class.PageQueryActionHandler.php.

71 : Server\Response
72 {
73 switch ($query["action"]) {
74 case "ui.all":
75 return $this->allCommand();
76
77 case "component.edit.form":
78 return $this->componentEditFormResponse($query);
79 }
80 throw new Exception("Unknown action " . $query["action"]);
81 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $component_factory

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

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

◆ $ctrl

◆ $db

ilDBInterface ILIAS\COPage\Page\PageQueryActionHandler::$db
protected

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

◆ $gui

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

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

◆ $lng

◆ $page_gui

ilPageObjectGUI ILIAS\COPage\Page\PageQueryActionHandler::$page_gui
protected

◆ $pc_definition

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

Definition at line 34 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 40 of file class.PageQueryActionHandler.php.

◆ $user

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

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