ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilStyleMediaQueryTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
28{
33
34 public function __construct(
35 object $a_parent_obj,
36 string $a_parent_cmd,
37 ilObjStyleSheet $a_style_obj,
39 ) {
40 global $DIC;
41
42 $this->access_manager = $access_manager;
43 $this->ctrl = $DIC->ctrl();
44 $this->lng = $DIC->language();
45 $this->access = $DIC->access();
46 $this->rbacsystem = $DIC->rbac()->system();
47 $ilCtrl = $DIC->ctrl();
48 $lng = $DIC->language();
49
50 parent::__construct($a_parent_obj, $a_parent_cmd);
51
52 $this->setTitle($lng->txt("sty_media_queries"));
53 $this->setDescription($lng->txt("sty_media_query_info"));
54 $this->style_obj = $a_style_obj;
55
56 $this->addColumn("", "", "1"); // checkbox
57 $this->addColumn($this->lng->txt("sty_order"));
58 $this->addColumn($this->lng->txt("sty_query"), "");
59 $this->addColumn($this->lng->txt("actions"), "");
60 $this->setEnableHeader(true);
61 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
62 $this->setRowTemplate("tpl.style_media_query_row.html", "components/ILIAS/Style/Content");
63 //$this->setSelectAllCheckbox("file");
64 $this->getItems();
65
66 // action commands
67 if ($this->access_manager->checkWrite()) {
68 $this->addCommandButton("saveMediaQueryOrder", $lng->txt("sty_save_order"));
69 $this->addMultiCommand("deleteMediaQueryConfirmation", $lng->txt("delete"));
70 }
71
72 $this->setEnableTitle(true);
73 }
74
75 public function getItems(): void
76 {
77 $this->setData($this->style_obj->getMediaQueries());
78 }
79
80 protected function fillRow(array $a_set): void
81 {
83 $ilCtrl = $this->ctrl;
84
85 $this->tpl->setVariable("MQUERY", $a_set["mquery"]);
86 $this->tpl->setVariable("MQID", $a_set["id"]);
87 $this->tpl->setVariable("ORDER_NR", $a_set["order_nr"]);
88
89 if ($this->access_manager->checkWrite()) {
90 $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
91 $ilCtrl->setParameter($this->parent_obj, "mq_id", $a_set["id"]);
92 $this->tpl->setVariable(
93 "LINK_EDIT_MQUERY",
94 $ilCtrl->getLinkTarget($this->parent_obj, "editMediaQuery")
95 );
96 }
97 }
98}
Manages access to content style editing.
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
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...
Class ilObjStyleSheet.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
TableGUI class for style editor (image list)
Content Access StyleAccessManager $access_manager
fillRow(array $a_set)
Standard Version of Fill Row.
__construct(object $a_parent_obj, string $a_parent_cmd, ilObjStyleSheet $a_style_obj, Content\Access\StyleAccessManager $access_manager)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setEnableTitle(bool $a_enabletitle)
setDescription(string $a_val)
addMultiCommand(string $a_cmd, string $a_text)
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
ilLanguage $lng
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26