ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 58 of file class.ilDclTableViewEditGUI.php.

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

59  {
60  global $DIC;
61  $lng = $DIC['lng'];
62  $ilCtrl = $DIC['ilCtrl'];
63  $tpl = $DIC['tpl'];
64  $ilTabs = $DIC['ilTabs'];
65  $locator = $DIC['ilLocator'];
66  $this->table = $table;
67  $this->tpl = $tpl;
68  $this->lng = $lng;
69  $this->ctrl = $ilCtrl;
70  $this->parent_obj = $parent_obj;
71  $this->tableview = $tableview;
72  $this->tabs_gui = $ilTabs;
73 
74  $this->ctrl->saveParameterByClass('ilDclTableEditGUI', 'table_id');
75  $this->ctrl->saveParameter($this, 'tableview_id');
76  if ($this->tableview->getTitle()) {
77  $locator->addItem($this->tableview->getTitle(), $this->ctrl->getLinkTarget($this, 'show'));
78  }
79  $this->tpl->setLocator();
80  }
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46

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 287 of file class.ilDclTableViewEditGUI.php.

References ilObjDataCollectionAccess\hasAccessToEditTable().

Referenced by executeCommand().

288  {
289  if (in_array($cmd, ['add', 'create'])) {
291  $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
292  $this->table->getId()
293  );
294  } else {
295  return ilObjDataCollectionAccess::hasAccessTo(
296  $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
297  $this->table->getId(),
298  $this->tableview->getId()
299  );
300  }
301  }
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 245 of file class.ilDclTableViewEditGUI.php.

246  {
247  //at least one view must exist
248  $this->parent_obj->checkViewsLeft(1);
249 
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 176 of file class.ilDclTableViewEditGUI.php.

References $_POST.

177  {
178  $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview, $this->table);
179  $ilDclTableViewEditFormGUI->setValuesByPost();
180  if ($ilDclTableViewEditFormGUI->checkInput()) {
181  $ilDclTableViewEditFormGUI->createTableView();
182  $this->ctrl->redirect($this, 'editGeneralSettings');
183  } else {
184  $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
185  }
186  }
Class ilDclTableViewEditFormGUI.

◆ delete()

ilDclTableViewEditGUI::delete ( )
protected

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

References cancel().

264  {
265  $this->tableview->delete();
266  $this->table->sortTableViews();
267  ilUtil::sendSuccess($this->lng->txt('dcl_msg_tableview_deleted'), true);
268  $this->cancel();
269  }
+ Here is the call graph for this function:

◆ executeCommand()

ilDclTableViewEditGUI::executeCommand ( )

execute command

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

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

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

◆ initTableGUI()

ilDclTableViewEditGUI::initTableGUI ( )
protected
Returns
ilDclTableViewEditFieldsTableGUI

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

References $table.

Referenced by executeCommand().

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

◆ permissionDenied()

ilDclTableViewEditGUI::permissionDenied ( )

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

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

Referenced by executeCommand().

276  {
277  ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
278  $this->ctrl->redirectByClass([ilObjDataCollectionGUI::class, ilDclRecordListGUI::class], ilDclRecordListGUI::CMD_LIST_RECORDS);
279  }
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 147 of file class.ilDclTableViewEditGUI.php.

Referenced by executeCommand(), and update().

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

◆ update()

ilDclTableViewEditGUI::update ( )

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

References setTabs().

160  {
161  $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
162  $ilDclTableViewEditFormGUI->setValuesByPost();
163  if ($ilDclTableViewEditFormGUI->checkInput()) {
164  $ilDclTableViewEditFormGUI->updateTableView();
165  $this->ctrl->redirect($this, 'editGeneralSettings');
166  } else {
167  $this->setTabs('general_settings');
168  $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
169  }
170  }
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 37 of file class.ilDclTableViewEditGUI.php.

◆ $lng

ilDclTableViewEditGUI::$lng
protected

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

Referenced by __construct().

◆ $parent_obj

ilDclTableViewEditGUI::$parent_obj
protected

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

Referenced by __construct().

◆ $table

ilDclTableViewEditGUI::$table

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

Referenced by __construct(), and initTableGUI().

◆ $table_gui

ilDclTableViewEditGUI::$table_gui
protected

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

◆ $tableview

ilDclTableViewEditGUI::$tableview

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

Referenced by __construct().

◆ $tabs_gui

ilDclTableViewEditGUI::$tabs_gui
protected

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

◆ $tpl

ilDclTableViewEditGUI::$tpl
protected

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

Referenced by __construct().


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