ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ClipboardTableBuilder.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29
31{
32 public function __construct(
33 protected InternalDomainService $domain,
34 protected InternalGUIService $gui,
35 protected \ilObjUser $user,
36 protected ThumbsGUI $thumbs_gui,
37 object $parent_gui,
38 string $parent_cmd
39 ) {
40 parent::__construct($parent_gui, $parent_cmd, false);
41 }
42
43 protected function getId(): string
44 {
45 return "clipboard";
46 }
47
48 protected function getTitle(): string
49 {
50 return $this->domain->lng()->txt("clipboard");
51 }
52
53 protected function getRetrieval(): RetrievalInterface
54 {
55 return new ClipboardRetrieval($this->user);
56 }
57
58 protected function transformRow(array $data_row): array
59 {
60 $type = (string) $data_row["type"];
61 $id = (int) $data_row["source_id"];
62 $title = htmlspecialchars(
63 (string) $data_row["title"] . " [" . $id . "]",
64 ENT_QUOTES,
65 "UTF-8"
66 );
67
68 if ($type === "mob") {
69 $mob = new \ilObjMediaObject($id);
70 $thumbnail = $this->thumbs_gui->getThumbHtml($id);
72 } else {
73 $thumbnail = $this->gui->ui()->renderer()->render(
74 $this->gui->ui()->factory()->symbol()->icon()->custom(
75 \ilUtil::getImagePath("standard/icon_pg.svg"),
76 $this->domain->lng()->txt("page")
77 )->withSize("large")
78 );
79 }
80
81 return [
82 "id" => $data_row["id"],
83 "thumbnail" => $thumbnail,
84 "title" => $title
85 ];
86 }
87
89 {
90 $lng = $this->domain->lng();
92 ->textColumn("thumbnail", $lng->txt("mep_thumbnail"))
93 ->textColumn("title", $lng->txt("mep_title_and_description"), true)
94 ->multiAction("remove", $lng->txt("remove"))
95 ->singleAction("removeSingle", $lng->txt("remove"));
96
97 if ($this->parent_gui->mode === "getObject") {
99 ->multiAction("insert", $this->parent_gui->getInsertButtonTitle())
100 ->singleAction("insertSingle", $this->parent_gui->getInsertButtonTitle());
101 } else {
103 "edit",
104 $lng->txt("edit"),
105 [\ilObjMediaObjectGUI::class],
106 "edit",
107 "clip_item_id"
108 );
109 }
110
111 return $table;
112 }
113}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
__construct(protected InternalDomainService $domain, protected InternalGUIService $gui, protected \ilObjUser $user, protected ThumbsGUI $thumbs_gui, object $parent_gui, string $parent_cmd)
transformRow(array $data_row)
transform raw data array to table row data array
textColumn(string $key, string $title, bool $sortable=false)
singleRedirectAction(string $action, string $title, array $class_path, string $cmd="", string $id_param="", bool $async=false)
multiAction(string $action, string $title, bool $async=false)
static _getMediaInfoHTML(ilObjMediaObject $a_mob)
get media info as html
User class.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $lng
Definition: privfeed.php:26