ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder Class Reference
+ Inheritance diagram for ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder:
+ Collaboration diagram for ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder:

Public Member Functions

 __construct (protected InternalDomainService $domain, protected InternalGUIService $gui, protected \ilWorkspaceAccessHandler|\ilPortfolioAccessHandler $handler, protected bool $portfolio_mode, protected int $parent_node_id, protected array $crs_ids, protected array $grp_ids, 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)
 
 activeAction (string $action, array $data_row)
 
 getTitleLink (array $data_row)
 
 getAclTitles (array $acl_types)
 
- 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 22 of file WorkspaceShareTableBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder::__construct ( protected InternalDomainService  $domain,
protected InternalGUIService  $gui,
protected \ilWorkspaceAccessHandler|\ilPortfolioAccessHandler  $handler,
protected bool  $portfolio_mode,
protected int  $parent_node_id,
protected array  $crs_ids,
protected array  $grp_ids,
object  $parent_gui,
string  $parent_cmd 
)

Definition at line 24 of file WorkspaceShareTableBuilder.php.

34 {
35 parent::__construct($parent_gui, $parent_cmd, $portfolio_mode ? false : true);
36 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ activeAction()

ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder::activeAction ( string  $action,
array  $data_row 
)
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 117 of file WorkspaceShareTableBuilder.php.

117 : bool
118 {
119 return $this->portfolio_mode || ($action === "copyShared" && $data_row["type"] === "file");
120 }

◆ build()

ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder::build ( TableAdapterGUI  $table)
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 82 of file WorkspaceShareTableBuilder.php.

82 : TableAdapterGUI
83 {
84 $lng = $this->domain->lng();
86 ->textColumn("lastname", $lng->txt("lastname"), true)
87 ->textColumn("firstname", $lng->txt("firstname"), true)
88 ->textColumn("login", $lng->txt("login"), true);
89
90 if (!$this->portfolio_mode) {
92 ->iconColumn("type_icon", $lng->txt("wsp_shared_object_type"))
93 ->textColumn("obj_type", $lng->txt("wsp_shared_object_type"), true);
94 }
95
97 ->dateColumn("acl_date", $lng->txt("wsp_shared_date"), true)
98 ->linkColumn("title", $lng->txt("wsp_shared_title"), true)
99 ->textColumn("acl_type", $lng->txt("wsp_shared_type"));
100
101 if ($this->portfolio_mode) {
102 return $table->singleAction(
103 "redirectSendMailToSharer",
104 $lng->txt("wsp_send_mail")
105 );
106 }
107
109 "copyShared",
110 $lng->txt("copy"),
111 [get_class($this->parent_gui)],
112 "copyShared",
113 "item_ref_id"
114 );
115 }
textColumn(string $key, string $title, bool $sortable=false)
singleAction(string $action, string $title, bool $async=false)
dateColumn(string $key, string $title, bool $sortable=false)
singleRedirectAction(string $action, string $title, array $class_path, string $cmd="", string $id_param="", bool $async=false)
iconColumn(string $key, string $title, bool $sortable=false)
global $lng
Definition: privfeed.php:26

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

+ Here is the call graph for this function:

◆ getAclTitles()

ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder::getAclTitles ( array  $acl_types)
protected

Definition at line 131 of file WorkspaceShareTableBuilder.php.

131 : array
132 {
133 $titles = [];
134 asort($acl_types);
135 foreach ($acl_types as $obj_id) {
136 switch ($obj_id) {
137 case \ilWorkspaceAccessGUI::PERMISSION_REGISTERED:
138 $titles[] = $this->domain->lng()->txt("wsp_set_permission_registered");
139 break;
140 case \ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD:
141 $titles[] = $this->domain->lng()->txt("wsp_set_permission_all_password");
142 break;
143 case \ilWorkspaceAccessGUI::PERMISSION_ALL:
144 $titles[] = $this->domain->lng()->txt("wsp_set_permission_all");
145 break;
146 default:
147 $type = \ilObject::_lookupType($obj_id);
148 $titles[] = $type === "usr"
149 ? \ilUserUtil::getNamePresentation($obj_id, false, true)
150 : \ilObject::_lookupTitle($obj_id);
151 break;
152 }
153 }
154
155 return $titles;
156 }
Class ilObject Basic functions for all objects.
static _lookupType(int $id, bool $reference=false)
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\_lookupTitle(), ilObject\_lookupType(), and ilUserUtil\getNamePresentation().

Referenced by ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder\transformRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder::getId ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 38 of file WorkspaceShareTableBuilder.php.

38 : string
39 {
40 return "workspace_share_" . (int) $this->portfolio_mode;
41 }

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ getRetrieval()

ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder::getRetrieval ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 48 of file WorkspaceShareTableBuilder.php.

48 : RetrievalInterface
49 {
50 return $this->domain->workspaceShareRetrieval(
51 $this->handler,
52 $this->portfolio_mode,
53 $this->crs_ids,
54 $this->grp_ids
55 );
56 }

◆ getTitle()

ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder::getTitle ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 43 of file WorkspaceShareTableBuilder.php.

43 : string
44 {
45 return $this->domain->lng()->txt("wsp_shared_resources");
46 }

◆ getTitleLink()

ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder::getTitleLink ( array  $data_row)
protected

Definition at line 122 of file WorkspaceShareTableBuilder.php.

122 : string
123 {
124 if ($this->portfolio_mode) {
125 return \ilLink::_getStaticLink($data_row["obj_id"], "prtf", true);
126 }
127
128 return $this->handler->getGotoLink($data_row["wsp_id"], $data_row["obj_id"]);
129 }

Referenced by ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder\transformRow().

+ Here is the caller graph for this function:

◆ transformRow()

ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder::transformRow ( array  $data_row)
protected

transform raw data array to table row data array

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 58 of file WorkspaceShareTableBuilder.php.

58 : array
59 {
60 $ui_factory = $this->gui->ui()->factory();
61 $row = [
62 "id" => $data_row["id"],
63 "lastname" => $data_row["lastname"],
64 "firstname" => $data_row["firstname"],
65 "login" => $data_row["login"],
66 "acl_date" => new \DateTimeImmutable("@" . $data_row["acl_date"]),
67 "title" => $ui_factory->link()->standard(
68 $data_row["title"],
69 $this->getTitleLink($data_row)
70 ),
71 "acl_type" => implode(", ", $this->getAclTitles($data_row["acl_type"]))
72 ];
73
74 if (!$this->portfolio_mode) {
75 $row["obj_type"] = $data_row["obj_type"];
76 $row["type_icon"] = $ui_factory->symbol()->icon()->standard($data_row["type"], "");
77 }
78
79 return $row;
80 }

References ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder\getAclTitles(), and ILIAS\PersonalWorkspace\WorkspaceShareTableBuilder\getTitleLink().

+ Here is the call graph for this function:

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