51 $ilToolbar = $DIC[
'ilToolbar'];
53 $ilTabs = $DIC[
'ilTabs'];
54 $locator = $DIC[
'ilLocator'];
57 $table_id =
$_GET[
'table_id'];
60 $this->parent_obj = $a_parent_obj;
64 $this->tabs = $ilTabs;
65 $this->toolbar = $ilToolbar;
68 $this->ctrl->saveParameterByClass(
'ilDclTableEditGUI',
'table_id');
69 $locator->addItem($this->table->getTitle(), $this->ctrl->getLinkTargetByClass(
'ilDclTableEditGUI',
'edit'));
70 $this->tpl->setLocator();
74 $this->ctrl->redirectByClass(
'ildclrecordlistgui',
'listRecords');
84 $this->ctrl->saveParameter($this,
'table_id');
85 $cmd = $this->ctrl->getCmd(
"show");
86 $next_class = $this->ctrl->getNextClass($this);
88 switch ($next_class) {
89 case 'ildcltablevieweditgui':
91 $this->ctrl->saveParameter($edit_gui,
'tableview_id');
92 $this->ctrl->forwardCommand($edit_gui);
120 $add_new->setPrimary(
true);
121 $add_new->setCaption(
"dcl_add_new_view");
122 $add_new->setUrl($this->ctrl->getLinkTargetByClass(
'ilDclTableViewEditGUI',
'add'));
123 $this->toolbar->addStickyItem($add_new);
125 $this->toolbar->addSeparator();
128 $tables = $this->parent_obj->getDataCollectionObject()->getTables();
130 foreach ($tables as
$table) {
131 $options[$table->getId()] = $table->getTitle();
133 include_once
'./Services/Form/classes/class.ilSelectInputGUI.php';
135 $table_selection->setOptions(
$options);
136 $table_selection->setValue($this->table->getId());
138 $this->toolbar->setFormAction($this->ctrl->getFormActionByClass(
"ilDclTableViewGUI",
"doTableSwitch"));
139 $this->toolbar->addText($this->lng->txt(
"dcl_select"));
140 $this->toolbar->addInputItem($table_selection);
142 $button->setCommand(
"doTableSwitch");
143 $button->setCaption(
'change');
144 $this->toolbar->addButtonInstance($button);
147 $this->tpl->setContent($table_gui->getHTML());
156 $this->ctrl->setParameterByClass(
"ilDclTableViewGUI",
"table_id",
$_POST[
'table_id']);
157 $this->ctrl->redirectByClass(
"ilDclTableViewGUI",
"show");
167 $tableviews = isset(
$_POST[
'dcl_tableview_ids']) ?
$_POST[
'dcl_tableview_ids'] : array();
170 $this->tabs->clearSubTabs();
172 $conf->setFormAction($this->ctrl->getFormAction($this));
173 $conf->setHeaderText($this->lng->txt(
'dcl_tableviews_confirm_delete'));
175 foreach ($tableviews as $tableview_id) {
176 $conf->addItem(
'dcl_tableview_ids[]', $tableview_id, ilDclTableView::find($tableview_id)->getTitle());
178 $conf->setConfirm($this->lng->txt(
'delete'),
'deleteTableviews');
179 $conf->setCancel($this->lng->txt(
'cancel'),
'show');
180 $this->tpl->setContent($conf->getHTML());
189 $tableviews = isset(
$_POST[
'dcl_tableview_ids']) ?
$_POST[
'dcl_tableview_ids'] : array();
190 foreach ($tableviews as $tableview_id) {
191 ilDclTableView::find($tableview_id)->delete();
193 $this->table->sortTableViews();
194 ilUtil::sendSuccess($this->lng->txt(
'dcl_msg_tableviews_deleted'),
true);
195 $this->ctrl->redirect($this,
'show');
206 if ($delete_count >= count($this->table->getTableViews())) {
208 $this->ctrl->redirect($this,
'show');
218 $orders =
$_POST[
'order'];
220 $tableviews = array();
221 foreach (array_keys($orders) as $tableview_id) {
222 $tableviews[] = ilDclTableView::find($tableview_id);
224 $this->table->sortTableViews($tableviews);
225 ilUtil::sendSuccess($this->lng->txt(
'dcl_msg_tableviews_order_updated'));
226 $this->ctrl->redirect($this);
Class ilDclTableViewEditGUI.
saveTableViewOrder()
invoked by ilDclTableViewTableGUI
static hasAccessToEditTable($ref_id, $table_id)
confirmDeleteTableviews()
Confirm deletion of multiple fields.
static getTableCache($table_id=0)
__construct(ilDclTableListGUI $a_parent_obj, $table_id=0)
Constructor.
Class ilDclTableViewTableGUI.
checkViewsLeft($delete_count)
redirects if there are no tableviews left after deletion of {$delete_count} tableviews ...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static findOrGetInstance($primary_key, array $add_constructor_args=array())
Confirmation screen class.