ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
PortfolioPageTableBuilder.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Portfolio\Page;
22
28
30{
31 public function __construct(
32 protected InternalDomainService $domain,
33 protected InternalGUIService $gui,
34 protected int $portfolio_id,
35 object $parent_gui,
36 string $parent_cmd
37 ) {
38 parent::__construct($parent_gui, $parent_cmd);
39 }
40
41 protected function getId(): string
42 {
43 return "portfolio_pages";
44 }
45
46 protected function getTitle(): string
47 {
48 return $this->domain->lng()->txt("content");
49 }
50
51 protected function getRetrieval(): RetrievalInterface
52 {
53 return $this->domain->portfolioPageRetrieval($this->portfolio_id);
54 }
55
56 protected function getOrderingCommand(): string
57 {
58 return "savePortfolioPagesOrdering";
59 }
60
61 protected function transformRow(array $data_row): array
62 {
63 $page_gui = $this->parent_gui->getPageGUIClassName();
64 $ctrl = $this->gui->ctrl();
65 $ctrl->setParameterByClass($page_gui, "ppage", $data_row["id"]);
66 $title = $this->gui->ui()->factory()->link()->standard(
67 $data_row["title"],
68 $ctrl->getLinkTargetByClass($page_gui, "edit")
69 );
70 $ctrl->setParameterByClass($page_gui, "ppage", "");
71
72 return [
73 "id" => $data_row["id"],
74 "title" => $title,
75 "type" => $this->domain->lng()->txt("page")
76 ];
77 }
78
80 {
81 $lng = $this->domain->lng();
82 $page_gui = $this->parent_gui->getPageGUIClassName();
83
84 return $table
85 ->linkColumn("title", $lng->txt("title"))
86 ->textColumn("type", $lng->txt("type"))
87 ->singleAction("editTitle", $lng->txt("prtf_edit_title"), true)
88 ->singleRedirectAction(
89 "editPage",
90 $lng->txt("prtf_edit_content"),
91 [$page_gui],
92 "edit",
93 "ppage"
94 )
95 ->singleAction("copyPageForm", $lng->txt("prtf_copy_pg"))
96 ->singleAction("confirmPortfolioPageDeletion", $lng->txt("delete"), true);
97 }
98}
transformRow(array $data_row)
transform raw data array to table row data array
__construct(protected InternalDomainService $domain, protected InternalGUIService $gui, protected int $portfolio_id, object $parent_gui, string $parent_cmd)
linkColumn(string $key, string $title, bool $sortable=false)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $lng
Definition: privfeed.php:26