ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
ILIAS\COPage\Layout\PageLayoutTableBuilder Class Reference
+ Inheritance diagram for ILIAS\COPage\Layout\PageLayoutTableBuilder:
+ Collaboration diagram for ILIAS\COPage\Layout\PageLayoutTableBuilder:

Public Member Functions

 __construct (protected InternalDomainService $domain, protected InternalGUIService $gui, 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 18 of file PageLayoutTableBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\COPage\Layout\PageLayoutTableBuilder::__construct ( protected InternalDomainService  $domain,
protected InternalGUIService  $gui,
object  $parent_gui,
string  $parent_cmd 
)

Definition at line 20 of file PageLayoutTableBuilder.php.

25 {
26 parent::__construct($parent_gui, $parent_cmd);
27 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ build()

ILIAS\COPage\Layout\PageLayoutTableBuilder::build ( TableAdapterGUI  $table)
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 77 of file PageLayoutTableBuilder.php.

77 : TableAdapterGUI
78 {
79 $lng = $this->domain->lng();
80 $lng->loadLanguageModule("copg");
82 ->iconColumn("active", $lng->txt("active"))
83 ->textColumn("preview", $lng->txt("thumbnail"), false)
84 ->textColumn("title", $lng->txt("title"), true)
85 ->textColumn("description", $lng->txt("description"), true)
86 ->textColumn("modules", $lng->txt("copg_obj_types"), false)
87 ->singleAction("editPg", $lng->txt("edit"))
88 ->singleRedirectAction(
89 "properties",
90 $lng->txt("settings"),
91 [ilPageLayoutGUI::class],
92 "properties",
93 "obj_id"
94 )
95 ->singleAction("exportLayout", $lng->txt("export"))
96 ->singleAction("deletePgl", $lng->txt("delete"), true)
97 ->multiAction("activate", $lng->txt("activate"))
98 ->multiAction("deactivate", $lng->txt("deactivate"))
99 ->multiAction("deletePgl", $lng->txt("delete"), true);
100
101 return $table;
102 }
iconColumn(string $key, string $title, bool $sortable=false)
global $lng
Definition: privfeed.php:26

References $lng, ILIAS\Repository\Table\CommonTableBuilder\$table, and ILIAS\Repository\Table\TableAdapterGUI\iconColumn().

+ Here is the call graph for this function:

◆ getId()

ILIAS\COPage\Layout\PageLayoutTableBuilder::getId ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 29 of file PageLayoutTableBuilder.php.

29 : string
30 {
31 return "pglayout";
32 }

◆ getRetrieval()

ILIAS\COPage\Layout\PageLayoutTableBuilder::getRetrieval ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 39 of file PageLayoutTableBuilder.php.

39 : RetrievalInterface
40 {
41 return $this->domain->layoutRetrieval();
42 }

◆ getTitle()

ILIAS\COPage\Layout\PageLayoutTableBuilder::getTitle ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 34 of file PageLayoutTableBuilder.php.

34 : string
35 {
36 return $this->domain->lng()->txt("page_layouts");
37 }

◆ transformRow()

ILIAS\COPage\Layout\PageLayoutTableBuilder::transformRow ( array  $data_row)
protected

transform raw data array to table row data array

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 44 of file PageLayoutTableBuilder.php.

44 : array
45 {
46 $lng = $this->domain->lng();
48
49 $modules = [];
50 foreach ($all_mods as $mod_id => $mod_caption) {
51 if (($mod_id == ilPageLayout::MODULE_SCORM && $data_row["mod_scorm"]) ||
52 ($mod_id == ilPageLayout::MODULE_PORTFOLIO && $data_row["mod_portfolio"]) ||
53 ($mod_id == ilPageLayout::MODULE_LM && $data_row["mod_lm"])) {
54 $modules[] = $mod_caption;
55 }
56 }
57
58 $active_img = $data_row['active']
59 ? ilUtil::getImagePath("standard/icon_ok.svg")
60 : ilUtil::getImagePath("standard/icon_not_ok.svg");
61 $active_txt = $data_row['active']
62 ? $lng->txt("active")
63 : $lng->txt("inactive");
64
65 $pgl_obj = new ilPageLayout((int) $data_row['layout_id']);
66
67 return [
68 "id" => $data_row["id"],
69 "active" => $this->gui->ui()->factory()->symbol()->icon()->custom($active_img, $active_txt),
70 "preview" => $pgl_obj->getPreview(),
71 "title" => $data_row["title"],
72 "description" => $data_row["description"],
73 "modules" => implode(", ", $modules)
74 ];
75 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAvailableModules()
Util class various functions, usage as namespace.
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 $lng, ilPageLayout\getAvailableModules(), ilUtil\getImagePath(), ilPageLayout\MODULE_LM, ilPageLayout\MODULE_PORTFOLIO, and ilPageLayout\MODULE_SCORM.

+ Here is the call graph for this function:

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