ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 64 of file class.ilDclTableViewEditGUI.php.

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

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

Member Function Documentation

◆ cancel()

ilDclTableViewEditGUI::cancel ( )
protected

return to overview

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

Referenced by delete().

236  {
237  $this->ctrl->setParameter($this->parent_obj, 'table_id', $this->table->getId());
238  $this->ctrl->redirect($this->parent_obj);
239  }
+ Here is the caller graph for this function:

◆ checkAccess()

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

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

References ilObjDataCollectionAccess\hasAccessToEditTable().

Referenced by executeCommand().

287  {
288  if (in_array($cmd, ['add', 'create'])) {
290  $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
291  $this->table->getId()
292  );
293  } else {
294  return ilObjDataCollectionAccess::hasAccessTo(
295  $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
296  $this->table->getId(),
297  $this->tableview->getId()
298  );
299  }
300  }
static hasAccessToEditTable($ref_id, $table_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDelete()

ilDclTableViewEditGUI::confirmDelete ( )

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

245  {
246  //at least one view must exist
247  $this->parent_obj->checkViewsLeft(1);
248 
249  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
250  $conf = new ilConfirmationGUI();
251  $conf->setFormAction($this->ctrl->getFormAction($this));
252  $conf->setHeaderText($this->lng->txt('dcl_tableview_confirm_delete'));
253 
254  $conf->addItem('tableview_id', (int) $this->tableview->getId(), $this->tableview->getTitle());
255 
256  $conf->setConfirm($this->lng->txt('delete'), 'delete');
257  $conf->setCancel($this->lng->txt('cancel'), 'cancel');
258 
259  $this->tpl->setContent($conf->getHTML());
260  }
Confirmation screen class.

◆ create()

ilDclTableViewEditGUI::create ( )

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

References $_POST, $key, array, and ilUtil\sendSuccess().

180  {
181  $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview, $this->table);
182  $ilDclTableViewEditFormGUI->setValuesByPost();
183  if ($ilDclTableViewEditFormGUI->checkInput()) {
184  $ilDclTableViewEditFormGUI->createTableView();
185  $this->ctrl->redirect($this, 'editGeneralSettings');
186  } else {
187  $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
188  }
189  }
Class ilDclTableViewEditFormGUI.
+ Here is the call graph for this function:

◆ delete()

ilDclTableViewEditGUI::delete ( )
protected

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

References cancel(), and ilUtil\sendSuccess().

263  {
264  $this->tableview->delete();
265  $this->table->sortTableViews();
266  ilUtil::sendSuccess($this->lng->txt('dcl_msg_tableview_deleted'), true);
267  $this->cancel();
268  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
+ Here is the call graph for this function:

◆ executeCommand()

ilDclTableViewEditGUI::executeCommand ( )

execute command

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

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

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

◆ initTableGUI()

ilDclTableViewEditGUI::initTableGUI ( )
protected
Returns
ilDclTableViewEditFieldsTableGUI

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

References $table.

Referenced by executeCommand().

227  {
229  $this->table_gui = $table;
230  }
Class ilDclTableViewEditFieldsTableGUI.
+ Here is the caller graph for this function:

◆ permissionDenied()

ilDclTableViewEditGUI::permissionDenied ( )

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

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

Referenced by executeCommand().

275  {
276  ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
277  $this->ctrl->redirectByClass([ilObjDataCollectionGUI::class, ilDclRecordListGUI::class], ilDclRecordListGUI::CMD_LIST_RECORDS);
278  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilDclTableViewEditGUI::setTabs (   $active)
protected

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

Referenced by executeCommand(), and update().

153  {
154  $this->tabs_gui->addTab('general_settings', $this->lng->txt('settings'), $this->ctrl->getLinkTarget($this, 'editGeneralSettings'));
155  $this->tabs_gui->addTab('field_settings', $this->lng->txt('dcl_list_visibility_and_filter'), $this->ctrl->getLinkTarget($this, 'editFieldSettings'));
156  $this->tabs_gui->addTab('detailed_view', $this->lng->txt('dcl_detailed_view'), $this->ctrl->getLinkTargetByClass('ilDclDetailedViewDefinitionGUI', 'edit'));
157  $this->tabs_gui->setTabActive($active);
158  }
+ Here is the caller graph for this function:

◆ update()

ilDclTableViewEditGUI::update ( )

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

References setTabs().

164  {
165  $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
166  $ilDclTableViewEditFormGUI->setValuesByPost();
167  if ($ilDclTableViewEditFormGUI->checkInput()) {
168  $ilDclTableViewEditFormGUI->updateTableView();
169  $this->ctrl->redirect($this, 'editGeneralSettings');
170  } else {
171  $this->setTabs('general_settings');
172  $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
173  }
174  }
Class ilDclTableViewEditFormGUI.
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilDclTableViewEditGUI::$ctrl
protected

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

◆ $form

ilDclTableViewEditGUI::$form
protected

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

◆ $lng

ilDclTableViewEditGUI::$lng
protected

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

Referenced by __construct().

◆ $parent_obj

ilDclTableViewEditGUI::$parent_obj
protected

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

Referenced by __construct().

◆ $table

ilDclTableViewEditGUI::$table

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

Referenced by __construct(), and initTableGUI().

◆ $table_gui

ilDclTableViewEditGUI::$table_gui
protected

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

◆ $tableview

ilDclTableViewEditGUI::$tableview

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

Referenced by __construct().

◆ $tabs_gui

ilDclTableViewEditGUI::$tabs_gui
protected

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

◆ $tpl

ilDclTableViewEditGUI::$tpl
protected

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

Referenced by __construct().


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