ILIAS  trunk Revision v12.0_alpha-1541-g23eaa5e013d
ILIAS\COPage\History\HistoryTableBuilder Class Reference
+ Inheritance diagram for ILIAS\COPage\History\HistoryTableBuilder:
+ Collaboration diagram for ILIAS\COPage\History\HistoryTableBuilder:

Public Member Functions

 __construct (protected InternalDomainService $domain, protected InternalGUIService $gui, object $parent_gui, string $parent_cmd, int $page_id, string $parent_type, string $lang)
 
- 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)
 

Protected Attributes

ILIAS UI Factory $ui_factory
 
int $page_id
 
string $parent_type
 
string $lang
 
bool $rselect = false
 
bool $lselect = false
 
- Protected Attributes inherited from ILIAS\Repository\Table\CommonTableBuilder
TableAdapterGUI $table
 

Detailed Description

Definition at line 29 of file class.HistoryTableBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\COPage\History\HistoryTableBuilder::__construct ( protected InternalDomainService  $domain,
protected InternalGUIService  $gui,
object  $parent_gui,
string  $parent_cmd,
int  $page_id,
string  $parent_type,
string  $lang 
)

Definition at line 38 of file class.HistoryTableBuilder.php.

46 {
47 $this->page_id = $page_id;
48 $this->parent_type = $parent_type;
49 $this->lang = $lang;
50 $this->ui_factory = $this->gui->ui()->factory();
51 parent::__construct($parent_gui, $parent_cmd);
52 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\COPage\History\HistoryTableBuilder\$lang, ILIAS\COPage\History\HistoryTableBuilder\$page_id, ILIAS\COPage\History\HistoryTableBuilder\$parent_type, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ activeAction()

ILIAS\COPage\History\HistoryTableBuilder::activeAction ( string  $action,
array  $data_row 
)
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 105 of file class.HistoryTableBuilder.php.

105 : bool
106 {
107 if ($action === "rollbackConfirmation" && $data_row["nr"] > 0) {
108 return true;
109 }
110 return false;
111 }

◆ build()

ILIAS\COPage\History\HistoryTableBuilder::build ( TableAdapterGUI  $table)
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 113 of file class.HistoryTableBuilder.php.

113 : TableAdapterGUI
114 {
115 $lng = $this->domain->lng();
116
117 $table = $table
118 ->linkColumn("date", $lng->txt("date"))
119 ->textColumn("user", $lng->txt("user"))
120 ->multiAction("compareVersion", $lng->txt("cont_page_compare"))
121 ->singleAction("rollbackConfirmation", $lng->txt("cont_rollback"));
122
123 return $table;
124 }
linkColumn(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\linkColumn().

+ Here is the call graph for this function:

◆ getId()

ILIAS\COPage\History\HistoryTableBuilder::getId ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 54 of file class.HistoryTableBuilder.php.

54 : string
55 {
56 return "ilCOPgHistoryTable";
57 }

◆ getRetrieval()

ILIAS\COPage\History\HistoryTableBuilder::getRetrieval ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 64 of file class.HistoryTableBuilder.php.

64 : RetrievalInterface
65 {
66 return $this->domain->historyRetrieval(
67 $this->page_id,
68 $this->parent_type,
69 $this->lang
70 );
71 }

◆ getTitle()

ILIAS\COPage\History\HistoryTableBuilder::getTitle ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 59 of file class.HistoryTableBuilder.php.

59 : string
60 {
61 return $this->domain->lng()->txt("content_page_history");
62 }

◆ transformRow()

ILIAS\COPage\History\HistoryTableBuilder::transformRow ( array  $data_row)
protected

transform raw data array to table row data array

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 73 of file class.HistoryTableBuilder.php.

73 : array
74 {
75 $ctrl = $this->gui->ctrl();
76
77 $nr = (int) $data_row["nr"];
78
79 $ctrl->setParameter($this->parent_gui, "old_nr", $nr);
80 $ctrl->setParameter($this->parent_gui, "history_mode", "1");
81 $date_link = $this->ui_factory->link()->standard(
83 $ctrl->getLinkTarget($this->parent_gui, "preview")
84 );
85 $ctrl->setParameter($this->parent_gui, "history_mode", "");
86 $ctrl->setParameter($this->parent_gui, "old_nr", "");
87
88 $user = "";
89 if (\ilObject::_exists((int) $data_row["user"])) {
91 (int) $data_row["user"],
92 true,
93 true,
94 $ctrl->getLinkTarget($this->parent_gui, $this->parent_cmd)
95 );
96 }
97
98 return [
99 "id" => (string) $nr,
100 "date" => $date_link,
101 "user" => $user
102 ];
103 }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:

References ilObject\_exists(), ilDatePresentation\formatDate(), ilUserUtil\getNamePresentation(), IL_CAL_DATETIME, and ILIAS\Repository\int().

+ Here is the call graph for this function:

Field Documentation

◆ $lang

string ILIAS\COPage\History\HistoryTableBuilder::$lang
protected

◆ $lselect

bool ILIAS\COPage\History\HistoryTableBuilder::$lselect = false
protected

Definition at line 36 of file class.HistoryTableBuilder.php.

◆ $page_id

int ILIAS\COPage\History\HistoryTableBuilder::$page_id
protected

◆ $parent_type

string ILIAS\COPage\History\HistoryTableBuilder::$parent_type
protected

◆ $rselect

bool ILIAS\COPage\History\HistoryTableBuilder::$rselect = false
protected

Definition at line 35 of file class.HistoryTableBuilder.php.

◆ $ui_factory

ILIAS UI Factory ILIAS\COPage\History\HistoryTableBuilder::$ui_factory
protected

Definition at line 31 of file class.HistoryTableBuilder.php.


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