ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilDclTableViewEditGUI Class Reference

ilDclTableViewEditGUI: ilDclDetailedViewDefinitionGUI ilDclTableViewEditGUI: ilDclCreateViewDefinitionGUI ilDclTableViewEditGUI: ilDclEditViewDefinitionGUI More...

+ Collaboration diagram for ilDclTableViewEditGUI:

Public Member Functions

 __construct (ilDclTableViewGUI $parent_obj, ilDclTable $table, ilDclTableView $tableview)
 
 executeCommand ()
 
 update ()
 
 create ()
 
 confirmDelete ()
 
 permissionDenied ()
 
 copy ()
 

Data Fields

ilDclTableView $tableview
 
ilDclTable $table
 

Protected Member Functions

 setTabs (string $active)
 
 initTableGUI ()
 
 cancel ()
 
 delete ()
 
 checkAccess (string $cmd)
 

Protected Attributes

ilDclTableViewGUI $parent_obj
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilGlobalPageTemplate $tpl
 
ilPropertyFormGUI $form
 
ilDclTableViewEditFieldsTableGUI $table_gui
 
ilTabsGUI $tabs_gui
 
ilHelpGUI $help
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, $lng, $parent_obj, $table, $tableview, $tpl, ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

42  {
43  global $DIC;
44  $lng = $DIC['lng'];
45  $ilCtrl = $DIC['ilCtrl'];
46  $tpl = $DIC['tpl'];
47  $ilTabs = $DIC['ilTabs'];
48  $locator = $DIC['ilLocator'];
49  $this->table = $table;
50  $this->tpl = $tpl;
51  $this->lng = $lng;
52  $this->ctrl = $ilCtrl;
53  $this->parent_obj = $parent_obj;
54  $this->tableview = $tableview;
55  $this->tabs_gui = $ilTabs;
56  $this->help = $DIC->help();
57  $this->http = $DIC->http();
58  $this->refinery = $DIC->refinery();
59 
60  $this->ctrl->saveParameterByClass('ilDclTableEditGUI', 'table_id');
61  $this->ctrl->saveParameter($this, 'tableview_id');
62  if ($this->tableview->getTitle()) {
63  $locator->addItem($this->tableview->getTitle(), $this->ctrl->getLinkTarget($this, 'show'));
64  }
65  $this->tpl->setLocator();
66  }
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

Member Function Documentation

◆ cancel()

ilDclTableViewEditGUI::cancel ( )
protected

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

References ILIAS\Repository\ctrl().

Referenced by copy(), and delete().

255  : void
256  {
257  $this->ctrl->setParameter($this->parent_obj, 'table_id', $this->table->getId());
258  $this->ctrl->redirect($this->parent_obj);
259  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkAccess()

ilDclTableViewEditGUI::checkAccess ( string  $cmd)
protected

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

References ilObjDataCollectionAccess\hasAccessToEditTable().

Referenced by executeCommand().

295  : bool
296  {
297  if (in_array($cmd, ['add', 'create', 'cancel'])) {
299  $this->parent_obj->getParentObj()->getDataCollectionObject()->getRefId(),
300  $this->table->getId()
301  );
302  } else {
303  return ilObjDataCollectionAccess::hasAccessTo(
304  $this->parent_obj->getParentObj()->getDataCollectionObject()->getRefId(),
305  $this->table->getId(),
306  $this->tableview->getId()
307  );
308  }
309  }
static hasAccessToEditTable(int $ref_id, int $table_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDelete()

ilDclTableViewEditGUI::confirmDelete ( )

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

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

261  : void
262  {
263  //at least one view must exist
264  $this->parent_obj->checkViewsLeft(1);
265 
266  $conf = new ilConfirmationGUI();
267  $conf->setFormAction($this->ctrl->getFormAction($this));
268  $conf->setHeaderText($this->lng->txt('dcl_tableview_confirm_delete'));
269 
270  $conf->addItem('tableview_id', (string) $this->tableview->getId(), $this->tableview->getTitle());
271 
272  $conf->setConfirm($this->lng->txt('delete'), 'delete');
273  $conf->setCancel($this->lng->txt('cancel'), 'cancel');
274 
275  $this->tpl->setContent($conf->getHTML());
276  }
+ Here is the call graph for this function:

◆ copy()

ilDclTableViewEditGUI::copy ( )

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

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

311  : void
312  {
313  $new_tableview = new ilDclTableView();
314  $new_tableview->setTableId($this->table->getId());
315  $new_tableview->cloneStructure($this->tableview, []);
316  $this->table->sortTableViews();
317  $this->tpl->setOnScreenMessage('success', $this->lng->txt("dcl_tableview_copy"), true);
318  $this->cancel();
319  }
+ Here is the call graph for this function:

◆ create()

ilDclTableViewEditGUI::create ( )

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

References ILIAS\LTI\ToolProvider\$key, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

187  : void
188  {
189  $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview, $this->table);
190  $ilDclTableViewEditFormGUI->setValuesByPost();
191  if ($ilDclTableViewEditFormGUI->checkInput()) {
192  $ilDclTableViewEditFormGUI->createTableView();
193  $this->ctrl->redirect($this, 'editGeneralSettings');
194  } else {
195  $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
196  }
197  }
+ Here is the call graph for this function:

◆ delete()

ilDclTableViewEditGUI::delete ( )
protected

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

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

278  : void
279  {
280  $this->tableview->delete();
281  $this->table->sortTableViews();
282  $this->tpl->setOnScreenMessage('success', $this->lng->txt('dcl_msg_tableview_deleted'), true);
283  $this->cancel();
284  }
+ Here is the call graph for this function:

◆ executeCommand()

ilDclTableViewEditGUI::executeCommand ( )

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

References checkAccess(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), initTableGUI(), ILIAS\Repository\lng(), permissionDenied(), and setTabs().

68  : void
69  {
70  $cmd = $this->ctrl->getCmd('show');
71  $next_class = $this->ctrl->getNextClass($this);
72 
73  if (!$this->checkAccess($cmd)) {
74  $this->permissionDenied();
75  }
76 
77  $this->tabs_gui->clearTargets();
78  $this->tabs_gui->clearSubTabs();
79  $this->tabs_gui->setBackTarget(
80  $this->lng->txt('dcl_tableviews'),
81  $this->ctrl->getLinkTarget($this->parent_obj)
82  );
83  $this->tabs_gui->setBack2Target(
84  $this->lng->txt('dcl_tables'),
85  $this->ctrl->getLinkTarget($this->parent_obj->getParentObj())
86  );
87 
88  switch ($next_class) {
89  case 'ildcldetailedviewdefinitiongui':
90  $this->help->setSubScreenId('detailed_view');
91  $this->setTabs('detailed_view');
92  $recordedit_gui = new ilDclDetailedViewDefinitionGUI($this->tableview->getId());
93  $ret = $this->ctrl->forwardCommand($recordedit_gui);
94  if ($ret != "") {
95  $this->tpl->setContent($ret);
96  }
97  break;
98  case 'ildclcreateviewdefinitiongui':
99  $this->help->setSubScreenId('record_create');
100  $this->setTabs('create_view');
101  $creation_gui = new ilDclCreateViewDefinitionGUI($this->tableview->getId());
102  $this->ctrl->forwardCommand($creation_gui);
103  break;
104  case 'ildcleditviewdefinitiongui':
105  $this->help->setSubScreenId('record_edit');
106  $this->setTabs('edit_view');
107  $edit_gui = new ilDclEditViewDefinitionGUI($this->tableview->getId());
108  $this->ctrl->forwardCommand($edit_gui);
109  break;
110  default:
111  switch ($cmd) {
112  case 'show':
113  if ($this->tableview->getId()) {
114  $this->ctrl->redirect($this, 'editGeneralSettings');
115  } else {
116  $this->ctrl->redirect($this, 'add');
117  }
118  break;
119  case 'add':
120  $this->help->setSubScreenId('create');
121  $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
122  $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
123  break;
124  case 'editGeneralSettings':
125  $this->help->setSubScreenId('edit');
126  $this->setTabs('general_settings');
127  $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
128  $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
129  break;
130  case 'editFieldSettings':
131  $this->help->setSubScreenId('overview');
132  $this->setTabs('field_settings');
133  $this->initTableGUI();
134  $this->tpl->setContent($this->table_gui->getHTML());
135  break;
136  default:
137  $this->$cmd();
138  break;
139  }
140  break;
141  }
142  }
ilDclCreateViewDefinitionGUI: ilDclTableViewEditGUI
ilDclEditViewDefinitionGUI: ilDclTableViewEditGUI
ilDclDetailedViewDefinitionGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMediaPoolTargetSelector ilDcl...
+ Here is the call graph for this function:

◆ initTableGUI()

ilDclTableViewEditGUI::initTableGUI ( )
protected

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

References $table.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ permissionDenied()

ilDclTableViewEditGUI::permissionDenied ( )

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

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

Referenced by executeCommand().

286  : void
287  {
288  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
289  $this->ctrl->redirectByClass(
290  [ilObjDataCollectionGUI::class, ilDclRecordListGUI::class],
292  );
293  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilDclTableViewEditGUI::setTabs ( string  $active)
protected

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

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

Referenced by executeCommand(), and update().

144  : void
145  {
146  $this->tabs_gui->addTab(
147  'general_settings',
148  $this->lng->txt('dcl_view_settings'),
149  $this->ctrl->getLinkTarget($this, 'editGeneralSettings')
150  );
151  $this->tabs_gui->addTab(
152  'create_view',
153  $this->lng->txt('dcl_create_entry_rules'),
154  $this->ctrl->getLinkTargetByClass('ilDclCreateViewDefinitionGUI', 'presentation')
155  );
156  $this->tabs_gui->addTab(
157  'edit_view',
158  $this->lng->txt('dcl_edit_entry_rules'),
159  $this->ctrl->getLinkTargetByClass('ilDclEditViewDefinitionGUI', 'presentation')
160  );
161  $this->tabs_gui->addTab(
162  'field_settings',
163  $this->lng->txt('dcl_list_visibility_and_filter'),
164  $this->ctrl->getLinkTarget($this, 'editFieldSettings')
165  );
166  $this->tabs_gui->addTab(
167  'detailed_view',
168  $this->lng->txt('dcl_detailed_view'),
169  $this->ctrl->getLinkTargetByClass('ilDclDetailedViewDefinitionGUI', 'edit')
170  );
171  $this->tabs_gui->setTabActive($active);
172  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilDclTableViewEditGUI::update ( )

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

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

174  : void
175  {
176  $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
177  $ilDclTableViewEditFormGUI->setValuesByPost();
178  if ($ilDclTableViewEditFormGUI->checkInput()) {
179  $ilDclTableViewEditFormGUI->updateTableView();
180  $this->ctrl->redirect($this, 'editGeneralSettings');
181  } else {
182  $this->setTabs('general_settings');
183  $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
184  }
185  }
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilDclTableViewEditGUI::$ctrl
protected

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

◆ $form

ilPropertyFormGUI ilDclTableViewEditGUI::$form
protected

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

◆ $help

ilHelpGUI ilDclTableViewEditGUI::$help
protected

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

◆ $http

ILIAS HTTP Services ilDclTableViewEditGUI::$http
protected

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

◆ $lng

ilLanguage ilDclTableViewEditGUI::$lng
protected

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

Referenced by __construct().

◆ $parent_obj

ilDclTableViewGUI ilDclTableViewEditGUI::$parent_obj
protected

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

Referenced by __construct().

◆ $refinery

ILIAS Refinery Factory ilDclTableViewEditGUI::$refinery
protected

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

◆ $table

ilDclTable ilDclTableViewEditGUI::$table

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

Referenced by __construct(), and initTableGUI().

◆ $table_gui

ilDclTableViewEditFieldsTableGUI ilDclTableViewEditGUI::$table_gui
protected

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

◆ $tableview

ilDclTableView ilDclTableViewEditGUI::$tableview

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

Referenced by __construct().

◆ $tabs_gui

ilTabsGUI ilDclTableViewEditGUI::$tabs_gui
protected

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

◆ $tpl

ilGlobalPageTemplate 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: