ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilDclTableViewGUI Class Reference

@ilCtrl_Calls ilDclTableViewGUI: ilDclTableViewEditGUI More...

+ Collaboration diagram for ilDclTableViewGUI:

Public Member Functions

 __construct (ilDclTableListGUI $a_parent_obj, int $table_id=0)
 Constructor. More...
 
 executeCommand ()
 
 getParentObj ()
 
 show ()
 
 checkViewsLeft (int $delete_count)
 redirects if there are no tableviews left after deletion of {$delete_count} tableviews More...
 

Protected Member Functions

 checkAccess ()
 
 getItems ()
 
 getActions (ilDclTableView $tableview)
 

Protected Attributes

ILIAS UI Factory $ui_factory
 
ILIAS UI Renderer $renderer
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilToolbarGUI $toolbar
 
ilGlobalTemplateInterface $tpl
 
ilTabsGUI $tabs
 
ilDclTable $table
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ilDclTableListGUI $parent_obj
 

Detailed Description

@ilCtrl_Calls ilDclTableViewGUI: ilDclTableViewEditGUI

Definition at line 26 of file class.ilDclTableViewGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilDclTableViewGUI::__construct ( ilDclTableListGUI  $a_parent_obj,
int  $table_id = 0 
)

Constructor.

Parameters
ilDclTableListGUI$a_parent_obj
int$table_id

Definition at line 45 of file class.ilDclTableViewGUI.php.

46 {
47 global $DIC;
48
49 $locator = $DIC['ilLocator'];
50 $this->parent_obj = $a_parent_obj;
51 $this->ctrl = $DIC->ctrl();
52 $this->lng = $DIC->language();
53 $this->tpl = $DIC->ui()->mainTemplate();
54 $this->tabs = $DIC->tabs();
55 $this->toolbar = $DIC->toolbar();
56 $this->http = $DIC->http();
57 $this->refinery = $DIC->refinery();
58 $this->ui_factory = $DIC->ui()->factory();
59 $this->renderer = $DIC->ui()->renderer();
60
61 $DIC->help()->setScreenId('dcl_views');
62
63 if ($table_id == 0) {
64 $table_id = $this->http->wrapper()->query()->retrieve('table_id', $this->refinery->kindlyTo()->int());
65 }
66
67 $this->table = ilDclCache::getTableCache($table_id);
68 $this->table->getCollectionObject()->setRefId(
69 $this->http->wrapper()->query()->retrieve('ref_id', $this->refinery->kindlyTo()->int())
70 );
71
72 $this->ctrl->saveParameterByClass('ilDclTableEditGUI', 'table_id');
73 $locator->addItem($this->table->getTitle(), $this->ctrl->getLinkTargetByClass('ilDclTableEditGUI', 'edit'));
74 $this->tpl->setLocator();
75
76 if (!$this->checkAccess()) {
77 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
78 $this->ctrl->redirectByClass(ilDclRecordListGUI::class, 'listRecords');
79 }
80 }
renderer()
static getTableCache(?int $table_id=null)
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26

References $DIC, checkAccess(), ILIAS\Repository\ctrl(), ilDclCache\getTableCache(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), renderer(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkAccess()

ilDclTableViewGUI::checkAccess ( )
protected

Definition at line 118 of file class.ilDclTableViewGUI.php.

118 : bool
119 {
121 $this->parent_obj->getDataCollectionObject()->getRefId(),
122 $this->table->getId()
123 );
124 }
static hasAccessToEditTable(int $ref_id, int $table_id)

References ilObjDataCollectionAccess\hasAccessToEditTable().

Referenced by __construct().

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

◆ checkViewsLeft()

ilDclTableViewGUI::checkViewsLeft ( int  $delete_count)

redirects if there are no tableviews left after deletion of {$delete_count} tableviews

Parameters
$delete_countnumber of tableviews to delete

Definition at line 201 of file class.ilDclTableViewGUI.php.

201 : void
202 {
203 if ($delete_count >= count($this->table->getTableViews())) {
204 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('dcl_msg_tableviews_delete_all'), true);
205 $this->ctrl->redirect($this, 'show');
206 }
207 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ executeCommand()

ilDclTableViewGUI::executeCommand ( )

Definition at line 82 of file class.ilDclTableViewGUI.php.

82 : void
83 {
84 $this->ctrl->saveParameter($this, 'table_id');
85 $cmd = $this->ctrl->getCmd("show");
86 $next_class = $this->ctrl->getNextClass($this);
87
88 switch ($next_class) {
89 case strtolower(ilDclTableViewEditGUI::class):
90 if ($this->http->wrapper()->query()->has('tableview_id')) {
91 $tableview_id = $this->http->wrapper()->query()->retrieve(
92 'tableview_id',
93 $this->refinery->kindlyTo()->int()
94 );
95 } else {
96 $tableview_id = 0;
97 }
98
99 $edit_gui = new ilDclTableViewEditGUI(
100 $this,
101 $this->table,
103 );
104 $this->ctrl->saveParameter($edit_gui, 'tableview_id');
105 $this->ctrl->forwardCommand($edit_gui);
106 break;
107 default:
108 $this->$cmd();
109 break;
110 }
111 }
@ilCtrl_Calls ilDclTableViewEditGUI: ilDclDetailedViewDefinitionGUI @ilCtrl_Calls ilDclTableViewEditG...
static findOrGetInstance($primary_key, array $add_constructor_args=[])
has(string $class_name)
if(!file_exists('../ilias.ini.php'))

References ILIAS\Repository\ctrl(), ilDclTableView\findOrGetInstance(), ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ getActions()

ilDclTableViewGUI::getActions ( ilDclTableView  $tableview)
protected
Returns
Shy[]

Definition at line 177 of file class.ilDclTableViewGUI.php.

177 : array
178 {
179 $this->ctrl->setParameterByClass(ilDclTableViewEditGUI::class, 'tableview_id', $tableview->getId());
180
181 $actions = [];
182 $actions[] = $this->ui_factory->button()->shy(
183 $this->lng->txt('edit'),
184 $this->ctrl->getLinkTargetByClass(ilDclTableViewEditGUI::class, 'editGeneralSettings')
185 );
186 $actions[] = $this->ui_factory->button()->shy(
187 $this->lng->txt('copy'),
188 $this->ctrl->getLinkTargetByClass(ilDclTableViewEditGUI::class, 'copy')
189 );
190 $actions[] = $this->ui_factory->button()->shy(
191 $this->lng->txt('delete'),
192 $this->ctrl->getLinkTargetByClass(ilDclTableViewEditGUI::class, 'confirmDelete')
193 );
194 return $actions;
195 }

References ILIAS\Repository\ctrl(), ilDclTableView\getId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getItems()

ilDclTableViewGUI::getItems ( )
protected

Definition at line 154 of file class.ilDclTableViewGUI.php.

154 : array
155 {
156 $items = [];
157 foreach ($this->table->getTableViews() as $tableview) {
158
159 $this->ctrl->setParameterByClass(ilDclTableViewEditGUI::class, 'tableview_id', $tableview->getId());
160 $item = $this->ui_factory->item()->standard(
161 $this->ui_factory->link()->standard(
162 $tableview->getTitle(),
163 $this->ctrl->getLinkTargetByClass(ilDclTableViewEditGUI::class, 'show')
164 )
165 )
166 ->withDescription($tableview->getDescription())
167 ->withActions($this->ui_factory->dropdown()->standard($this->getActions($tableview)));
168
169 $items[] = $item;
170 }
171 return $items;
172 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getParentObj()

ilDclTableViewGUI::getParentObj ( )

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

114 {
115 return $this->parent_obj;
116 }
@ilCtrl_Calls ilDclTableListGUI: ilDclFieldListGUI, ilDclFieldEditGUI, ilDclTableViewGUI,...
ilDclTableListGUI $parent_obj

References $parent_obj.

◆ show()

ilDclTableViewGUI::show ( )

Definition at line 126 of file class.ilDclTableViewGUI.php.

126 : void
127 {
128 $add_new = $this->ui_factory->button()->primary(
129 $this->lng->txt("dcl_add_new_view"),
130 $this->ctrl->getLinkTargetByClass(ilDclTableViewEditGUI::class, 'add')
131 );
132 $this->toolbar->addStickyItem($add_new);
133
134 $this->toolbar->addSeparator();
135
136 $switcher = new ilDclSwitcher($this->toolbar, $this->ui_factory, $this->ctrl, $this->lng);
137 $switcher->addTableSwitcherToToolbar(
138 $this->parent_obj->getDataCollectionObject()->getTables(),
139 self::class,
140 'show',
141 $this->table->getId()
142 );
143
144 $this->tpl->setContent(
145 $this->renderer->render(
146 $this->ui_factory->panel()->listing()->standard(
147 sprintf($this->lng->txt('dcl_tableviews_of_X'), $this->table->getTitle()),
148 [$this->ui_factory->item()->group('', $this->getItems())]
149 )
150 )
151 );
152 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), renderer(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilDclTableViewGUI::$ctrl
protected

Definition at line 30 of file class.ilDclTableViewGUI.php.

◆ $http

ILIAS HTTP Services ilDclTableViewGUI::$http
protected

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

◆ $lng

ilLanguage ilDclTableViewGUI::$lng
protected

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

◆ $parent_obj

ilDclTableListGUI ilDclTableViewGUI::$parent_obj
protected

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

Referenced by getParentObj().

◆ $refinery

ILIAS Refinery Factory ilDclTableViewGUI::$refinery
protected

Definition at line 37 of file class.ilDclTableViewGUI.php.

◆ $renderer

ILIAS UI Renderer ilDclTableViewGUI::$renderer
protected

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

◆ $table

ilDclTable ilDclTableViewGUI::$table
protected

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

◆ $tabs

ilTabsGUI ilDclTableViewGUI::$tabs
protected

Definition at line 34 of file class.ilDclTableViewGUI.php.

◆ $toolbar

ilToolbarGUI ilDclTableViewGUI::$toolbar
protected

Definition at line 32 of file class.ilDclTableViewGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilDclTableViewGUI::$tpl
protected

Definition at line 33 of file class.ilDclTableViewGUI.php.

◆ $ui_factory

ILIAS UI Factory ilDclTableViewGUI::$ui_factory
protected

Definition at line 28 of file class.ilDclTableViewGUI.php.


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