ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Style\Content\Images\ImageTableBuilder Class Reference
+ Inheritance diagram for ILIAS\Style\Content\Images\ImageTableBuilder:
+ Collaboration diagram for ILIAS\Style\Content\Images\ImageTableBuilder:

Public Member Functions

 __construct (protected InternalDomainService $domain, protected InternalGUIService $gui, protected StyleAccessManager $access_manager, protected ImageManager $image_manager, 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...
 
 activeAction (string $action, array $data_row)
 
 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 31 of file ImageTableBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Style\Content\Images\ImageTableBuilder::__construct ( protected InternalDomainService  $domain,
protected InternalGUIService  $gui,
protected StyleAccessManager  $access_manager,
protected ImageManager  $image_manager,
object  $parent_gui,
string  $parent_cmd 
)

Definition at line 33 of file ImageTableBuilder.php.

40 {
41 parent::__construct($parent_gui, $parent_cmd, false);
42 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ activeAction()

ILIAS\Style\Content\Images\ImageTableBuilder::activeAction ( string  $action,
array  $data_row 
)
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 83 of file ImageTableBuilder.php.

83 : bool
84 {
85 if ($action === "resizeImageForm") {
86 return (bool) ($data_row["supports_resize"] ?? false);
87 }
88 return true;
89 }

◆ build()

ILIAS\Style\Content\Images\ImageTableBuilder::build ( TableAdapterGUI  $table)
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 91 of file ImageTableBuilder.php.

92 {
93 $lng = $this->domain->lng();
94
96 ->textColumn("thumbnail", $lng->txt("thumbnail"))
97 ->textColumn("filename", $lng->txt("file"), true)
98 ->textColumn("width_height", $lng->txt("sty_width_height"))
99 ->textColumn("size", $lng->txt("size"));
100
101 if ($this->access_manager->checkWrite()) {
102 $table = $table
103 ->singleAction("resizeImageForm", $lng->txt("sty_resize"))
104 ->singleAction("confirmDeleteImage", $lng->txt("delete"), true);
105 }
106
107 return $table;
108 }
textColumn(string $key, string $title, bool $sortable=false)
singleAction(string $action, string $title, bool $async=false)
global $lng
Definition: privfeed.php:26

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

+ Here is the call graph for this function:

◆ getId()

ILIAS\Style\Content\Images\ImageTableBuilder::getId ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 44 of file ImageTableBuilder.php.

44 : string
45 {
46 return "style_images";
47 }

◆ getRetrieval()

ILIAS\Style\Content\Images\ImageTableBuilder::getRetrieval ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 54 of file ImageTableBuilder.php.

54 : RetrievalInterface
55 {
56 return $this->domain->imageRetrieval($this->image_manager);
57 }

◆ getTitle()

ILIAS\Style\Content\Images\ImageTableBuilder::getTitle ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 49 of file ImageTableBuilder.php.

49 : string
50 {
51 return $this->domain->lng()->txt("sty_images");
52 }

◆ transformRow()

ILIAS\Style\Content\Images\ImageTableBuilder::transformRow ( array  $data_row)
protected

transform raw data array to table row data array

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 59 of file ImageTableBuilder.php.

59 : array
60 {
61 $thumbnail = "";
62 if (is_file($data_row["thumbnail"]) || str_starts_with($data_row["thumbnail"], "http")) {
63 $image = $this->gui->ui()->factory()->image()->responsive(
64 $data_row["thumbnail"],
65 $data_row["filename"]
66 );
67 $thumbnail = str_replace(
68 "<img ",
69 "<img style='max-width:100px;' ",
70 $this->gui->ui()->renderer()->render($image)
71 );
72 }
73
74 return [
75 "id" => $data_row["id"],
76 "thumbnail" => $thumbnail,
77 "filename" => $data_row["filename"],
78 "width_height" => $data_row["width_height"],
79 "size" => $data_row["size"],
80 ];
81 }

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