ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\LearningModule\Editing\PagesTableBuilder Class Reference
+ Inheritance diagram for ILIAS\LearningModule\Editing\PagesTableBuilder:
+ Collaboration diagram for ILIAS\LearningModule\Editing\PagesTableBuilder:

Public Member Functions

 __construct (protected InternalDomainService $domain, protected InternalGUIService $gui, protected \ilObjLearningModule $lm, object $parent_gui, string $parent_cmd)
 
- Public Member Functions inherited from ILIAS\Repository\Table\CommonTableBuilder
 __construct (protected object $parent_gui, protected string $parent_cmd, bool $numeric_ids=true)
 
 getTable ()
 

Protected Member Functions

 getId ()
 
 getTitle ()
 
 getRetrieval ()
 
 transformRow (array $data_row)
 transform raw data array to table row data array More...
 
 build (TableAdapterGUI $table)
 
- Protected Member Functions inherited from ILIAS\Repository\Table\CommonTableBuilder
 getId ()
 
 getTitle ()
 
 getRetrieval ()
 
 getNamespace ()
 
 getOrderingCommand ()
 
 activeAction (string $action, array $data_row)
 
 transformRow (array $data_row)
 transform raw data array to table row data array More...
 
 build (TableAdapterGUI $table)
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\Repository\Table\CommonTableBuilder
TableAdapterGUI $table
 

Detailed Description

Definition at line 29 of file PagesTableBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LearningModule\Editing\PagesTableBuilder::__construct ( protected InternalDomainService  $domain,
protected InternalGUIService  $gui,
protected \ilObjLearningModule  $lm,
object  $parent_gui,
string  $parent_cmd 
)

Definition at line 31 of file PagesTableBuilder.php.

37 {
38 parent::__construct($parent_gui, $parent_cmd);
39 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ build()

ILIAS\LearningModule\Editing\PagesTableBuilder::build ( TableAdapterGUI  $table)
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 111 of file PagesTableBuilder.php.

111 : TableAdapterGUI
112 {
113 $lng = $this->domain->lng();
114
115 $table = $table
116 ->iconColumn("type", $lng->txt(""))
117 ->linkColumn("title", $lng->txt("title"))
118 ->textColumn("usage", $lng->txt("cont_usage"))
119 ->singleAction("activatePages", $lng->txt("cont_de_activate"))
120 ->singleAction("movePage", $lng->txt("movePage"))
121 ->singleAction("copyPage", $lng->txt("copyPage"))
122 ->singleAction("deletePage", $lng->txt("delete"))
123 ->singleAction("selectHeader", $lng->txt("selectHeader"))
124 ->singleAction("selectFooter", $lng->txt("selectFooter"));
125
127 \ilEditClipboard::getAction() === "copy") {
128 $table = $table->singleAction("pastePage", $lng->txt("pastePage"));
129 }
130
131 if ($this->lm->getLayoutPerPage()) {
132 $table = $table
133 ->textColumn("layout", $lng->txt("cont_layout"))
134 ->singleAction("setPageLayout", $lng->txt("cont_set_layout"));
135 }
136
137 return $table;
138 }
textColumn(string $key, string $title, bool $sortable=false)
singleAction(string $action, string $title, bool $async=false)
iconColumn(string $key, string $title, bool $sortable=false)
global $lng
Definition: privfeed.php:26

References $lng, ILIAS\Repository\Table\CommonTableBuilder\$table, ilEditClipboard\getAction(), ilEditClipboard\getContentObjectType(), ILIAS\Repository\Table\TableAdapterGUI\iconColumn(), ILIAS\Repository\Table\TableAdapterGUI\singleAction(), and ILIAS\Repository\Table\TableAdapterGUI\textColumn().

+ Here is the call graph for this function:

◆ getId()

ILIAS\LearningModule\Editing\PagesTableBuilder::getId ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 41 of file PagesTableBuilder.php.

41 : string
42 {
43 return "lm_pages";
44 }

◆ getRetrieval()

ILIAS\LearningModule\Editing\PagesTableBuilder::getRetrieval ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 51 of file PagesTableBuilder.php.

51 : RetrievalInterface
52 {
53 return $this->domain->pagesRetrieval(
54 $this->lm->getId(),
55 $this->lm->getType(),
56 $this->lm->getLayoutPerPage()
57 );
58 }

◆ getTitle()

ILIAS\LearningModule\Editing\PagesTableBuilder::getTitle ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 46 of file PagesTableBuilder.php.

46 : string
47 {
48 return $this->domain->lng()->txt("cont_pages");
49 }

◆ transformRow()

ILIAS\LearningModule\Editing\PagesTableBuilder::transformRow ( array  $data_row)
protected

transform raw data array to table row data array

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 60 of file PagesTableBuilder.php.

60 : array
61 {
62 $lng = $this->domain->lng();
63 $f = $this->gui->ui()->factory();
64 $ctrl = $this->gui->ctrl();
65 $id = (int) $data_row["id"];
66
67 $img_sc = $data_row["scheduled"] ? "_sc" : "";
68 if (!$data_row["active"]) {
69 $img = "standard/icon_pg_d" . $img_sc . ".svg";
70 $alt = $lng->txt("cont_page_deactivated");
71 } elseif ($data_row["deactivated_elements"]) {
72 $img = "standard/icon_pg_del" . $img_sc . ".svg";
73 $alt = $lng->txt("cont_page_deactivated_elements");
74 } else {
75 $img = "standard/icon_pg" . $img_sc . ".svg";
76 $alt = $lng->txt("pg");
77 }
78
79 $ctrl->setParameterByClass(\ilLMPageObjectGUI::class, "obj_id", $id);
80 $target = $ctrl->getLinkTargetByClass(\ilLMPageObjectGUI::class, "edit");
81
82 $usage = $this->lm->lm_tree->isInTree($id)
83 ? $this->parent_gui->getContextPath($id)
84 : "---";
85 if ($id === $this->lm->getHeaderPage()) {
86 $usage .= " (" . $lng->txt("cont_header") . ")";
87 }
88 if ($id === $this->lm->getFooterPage()) {
89 $usage .= " (" . $lng->txt("cont_footer") . ")";
90 }
91
92 $row = [
93 "id" => $id,
94 "type" => $f->symbol()->icon()->custom(
96 $alt
97 ),
98 "title" => $f->link()->standard($data_row["title"], $target),
99 "usage" => $usage
100 ];
101
102 if ($this->lm->getLayoutPerPage()) {
103 $row["layout"] = $data_row["layout"] !== ""
104 ? $lng->txt("cont_layout_" . $data_row["layout"])
105 : "";
106 }
107
108 return $row;
109 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
foreach(array_slice($argv, 1) as $argument) $usage

References Vendor\Package\$f, $id, $lng, ILIAS\Scripts\PHPStan\$target, $usage, ilUtil\getImagePath(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

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