ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilDclTableViewEditGUI Class Reference

Class ilDclTableViewEditGUI. More...

+ Collaboration diagram for ilDclTableViewEditGUI:

Public Member Functions

 __construct (ilDclTableViewGUI $parent_obj, ilDclTable $table, ilDclTableView $tableview)
 ilDclTableViewEditGUI constructor. More...
 
 executeCommand ()
 execute command More...
 
 update ()
 
 create ()
 
 confirmDelete ()
 
 permissionDenied ()
 

Data Fields

 $tableview
 
 $table
 

Protected Member Functions

 setTabs ($active)
 
 initTableGUI ()
 
 cancel ()
 return to overview More...
 
 delete ()
 
 checkAccess ($cmd)
 

Protected Attributes

 $parent_obj
 
 $ctrl
 
 $lng
 
 $tpl
 
 $form
 
 $table_gui
 
 $tabs_gui
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDclTableViewEditGUI::__construct ( ilDclTableViewGUI  $parent_obj,
ilDclTable  $table,
ilDclTableView  $tableview 
)

ilDclTableViewEditGUI constructor.

Parameters
ilDclTableViewGUI$parent_obj
ilDclTable$table

Definition at line 66 of file class.ilDclTableViewEditGUI.php.

67 {
68 global $DIC;
69 $lng = $DIC['lng'];
70 $ilCtrl = $DIC['ilCtrl'];
71 $tpl = $DIC['tpl'];
72 $ilTabs = $DIC['ilTabs'];
73 $locator = $DIC['ilLocator'];
74 $this->table = $table;
75 $this->tpl = $tpl;
76 $this->lng = $lng;
77 $this->ctrl = $ilCtrl;
78 $this->parent_obj = $parent_obj;
79 $this->tableview = $tableview;
80 $this->tabs_gui = $ilTabs;
81
82 $this->ctrl->saveParameterByClass('ilDclTableEditGUI', 'table_id');
83 $this->ctrl->saveParameter($this, 'tableview_id');
84 $locator->addItem($this->tableview->getTitle(), $this->ctrl->getLinkTarget($this, 'show'));
85 $this->tpl->setLocator();
86 }
global $ilCtrl
Definition: ilias.php:18
global $DIC

References $DIC, $ilCtrl, $lng, $parent_obj, $table, $tableview, and $tpl.

Member Function Documentation

◆ cancel()

ilDclTableViewEditGUI::cancel ( )
protected

return to overview

Definition at line 248 of file class.ilDclTableViewEditGUI.php.

249 {
250 $this->ctrl->setParameter($this->parent_obj, 'table_id', $this->table->getId());
251 $this->ctrl->redirect($this->parent_obj);
252 }

◆ checkAccess()

ilDclTableViewEditGUI::checkAccess (   $cmd)
protected
Parameters
$cmd
Returns
bool

Definition at line 297 of file class.ilDclTableViewEditGUI.php.

298 {
299 if (in_array($cmd, ['add', 'create'])) {
301 $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
302 $this->table->getId()
303 );
304 } else {
305 return ilObjDataCollectionAccess::hasAccessTo(
306 $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
307 $this->table->getId(),
308 $this->tableview->getId()
309 );
310 }
311 }
static hasAccessToEditTable($ref_id, $table_id)
$cmd
Definition: sahs_server.php:35

References $cmd, and ilObjDataCollectionAccess\hasAccessToEditTable().

Referenced by executeCommand().

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

◆ confirmDelete()

ilDclTableViewEditGUI::confirmDelete ( )

Definition at line 257 of file class.ilDclTableViewEditGUI.php.

258 {
259 //at least one view must exist
260 $this->parent_obj->checkViewsLeft(1);
261
262 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
263 $conf = new ilConfirmationGUI();
264 $conf->setFormAction($this->ctrl->getFormAction($this));
265 $conf->setHeaderText($this->lng->txt('dcl_tableview_confirm_delete'));
266
267 $conf->addItem('tableview_id', (int)$this->tableview->getId(), $this->tableview->getTitle());
268
269 $conf->setConfirm($this->lng->txt('delete'), 'delete');
270 $conf->setCancel($this->lng->txt('cancel'), 'cancel');
271
272 $this->tpl->setContent($conf->getHTML());
273 }
Confirmation screen class.

◆ create()

ilDclTableViewEditGUI::create ( )

Definition at line 184 of file class.ilDclTableViewEditGUI.php.

185 {
186 $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview, $this->table);
187 $ilDclTableViewEditFormGUI->setValuesByPost();
188 if ($ilDclTableViewEditFormGUI->checkInput()) {
189 $ilDclTableViewEditFormGUI->createTableView();
190 $this->ctrl->redirect($this, 'editGeneralSettings');
191 } else {
192 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
193 }
194 }
Class ilDclTableViewEditFormGUI.

◆ delete()

ilDclTableViewEditGUI::delete ( )
protected

Definition at line 275 of file class.ilDclTableViewEditGUI.php.

275 {
276 $this->tableview->delete();
277 $this->table->sortTableViews();
278 ilUtil::sendSuccess($this->lng->txt('dcl_msg_tableview_deleted'), true);
279 $this->cancel();
280 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ executeCommand()

ilDclTableViewEditGUI::executeCommand ( )

execute command

Definition at line 92 of file class.ilDclTableViewEditGUI.php.

93 {
94 $cmd = $this->ctrl->getCmd('show');
95 $next_class = $this->ctrl->getNextClass($this);
96
97 if (!$this->checkAccess($cmd)) {
98 $this->permissionDenied();
99 }
100
101 $this->tabs_gui->clearTargets();
102 $this->tabs_gui->clearSubTabs();
103 $this->tabs_gui->setBackTarget($this->lng->txt('dcl_tableviews'), $this->ctrl->getLinkTarget($this->parent_obj));
104 $this->tabs_gui->setBack2Target($this->lng->txt('dcl_tables'), $this->ctrl->getLinkTarget($this->parent_obj->parent_obj));
105
106
107
108 switch($next_class)
109 {
110 case 'ildcldetailedviewdefinitiongui':
111 $this->setTabs('detailed_view');
112 require_once('./Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinitionGUI.php');
113 $recordedit_gui = new ilDclDetailedViewDefinitionGUI($this->tableview->getId());
114 $ret = $this->ctrl->forwardCommand($recordedit_gui);
115 if ($ret != "") {
116 $this->tpl->setContent($ret);
117 }
118 global $DIC;
119 $ilTabs = $DIC['ilTabs'];
120 $ilTabs->removeTab('edit');
121 $ilTabs->removeTab('history');
122 $ilTabs->removeTab('clipboard'); // Fixme
123 $ilTabs->removeTab('pg');
124 break;
125 default:
126 switch($cmd) {
127 case 'show':
128 if ($this->tableview->getId()) {
129 $this->ctrl->redirect($this, 'editGeneralSettings');
130 } else {
131 $this->ctrl->redirect($this, 'add');
132 }
133 break;
134 case 'add':
135 $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
136 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
137 break;
138 case 'editGeneralSettings':
139 $this->setTabs('general_settings');
140 $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
141 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
142 break;
143 case 'editFieldSettings':
144 $this->setTabs('field_settings');
145 $this->initTableGUI();
146 $this->tpl->setContent($this->table_gui->getHTML());
147 break;
148 default:
149 $this->$cmd();
150 break;
151 }
152 break;
153 }
154
155 }
Class ilDclDetailedViewDefinitionGUI.
$ret
Definition: parser.php:6

References $cmd, $DIC, $ret, checkAccess(), initTableGUI(), permissionDenied(), and setTabs().

+ Here is the call graph for this function:

◆ initTableGUI()

ilDclTableViewEditGUI::initTableGUI ( )
protected
Returns
ilDclTableViewEditFieldsTableGUI

Definition at line 239 of file class.ilDclTableViewEditGUI.php.

240 {
242 $this->table_gui = $table;
243 }
Class ilDclTableViewEditFieldsTableGUI.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ permissionDenied()

ilDclTableViewEditGUI::permissionDenied ( )

Definition at line 286 of file class.ilDclTableViewEditGUI.php.

286 {
287 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
288 $this->ctrl->redirectByClass([ilObjDataCollectionGUI::class, ilDclRecordListGUI::class], ilDclRecordListGUI::CMD_LIST_RECORDS);
289 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References ilDclRecordListGUI\CMD_LIST_RECORDS, and ilUtil\sendFailure().

Referenced by executeCommand().

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

◆ setTabs()

ilDclTableViewEditGUI::setTabs (   $active)
protected

Definition at line 157 of file class.ilDclTableViewEditGUI.php.

158 {
159 $this->tabs_gui->addTab('general_settings', $this->lng->txt('settings'), $this->ctrl->getLinkTarget($this, 'editGeneralSettings'));
160 $this->tabs_gui->addTab('field_settings', $this->lng->txt('dcl_list_visibility_and_filter'), $this->ctrl->getLinkTarget($this, 'editFieldSettings'));
161 $this->tabs_gui->addTab('detailed_view', $this->lng->txt('dcl_detailed_view'), $this->ctrl->getLinkTargetByClass('ilDclDetailedViewDefinitionGUI', 'edit'));
162 $this->tabs_gui->setTabActive($active);
163 }

Referenced by executeCommand(), and update().

+ Here is the caller graph for this function:

◆ update()

ilDclTableViewEditGUI::update ( )

Definition at line 168 of file class.ilDclTableViewEditGUI.php.

169 {
170 $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
171 $ilDclTableViewEditFormGUI->setValuesByPost();
172 if ($ilDclTableViewEditFormGUI->checkInput()) {
173 $ilDclTableViewEditFormGUI->updateTableView();
174 $this->ctrl->redirect($this, 'editGeneralSettings');
175 } else {
176 $this->setTabs('general_settings');
177 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
178 }
179 }

References setTabs().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilDclTableViewEditGUI::$ctrl
protected

Definition at line 23 of file class.ilDclTableViewEditGUI.php.

◆ $form

ilDclTableViewEditGUI::$form
protected

Definition at line 43 of file class.ilDclTableViewEditGUI.php.

◆ $lng

ilDclTableViewEditGUI::$lng
protected

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

Referenced by __construct().

◆ $parent_obj

ilDclTableViewEditGUI::$parent_obj
protected

Definition at line 18 of file class.ilDclTableViewEditGUI.php.

Referenced by __construct().

◆ $table

ilDclTableViewEditGUI::$table

Definition at line 58 of file class.ilDclTableViewEditGUI.php.

Referenced by __construct().

◆ $table_gui

ilDclTableViewEditGUI::$table_gui
protected

Definition at line 48 of file class.ilDclTableViewEditGUI.php.

◆ $tableview

ilDclTableViewEditGUI::$tableview

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

Referenced by __construct().

◆ $tabs_gui

ilDclTableViewEditGUI::$tabs_gui
protected

Definition at line 53 of file class.ilDclTableViewEditGUI.php.

◆ $tpl

ilDclTableViewEditGUI::$tpl
protected

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

Referenced by __construct().


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