4 require_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
5 require_once(
"./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinition.php");
38 public function __construct(
$table_id, $a_definition_id = 0) {
48 if (!$a_definition_id) {
53 if (!$a_definition_id) {
55 $viewdef->setTableId($this->table_id);
56 $viewdef->setActive(
false);
58 $a_definition_id = $viewdef->getId();
61 parent::__construct(
"dclf", $a_definition_id);
65 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
67 $tpl->setCurrentBlock(
"SyntaxStyle");
69 $tpl->parseCurrentBlock();
71 $tpl->setCurrentBlock(
"ContentStyle");
73 $tpl->parseCurrentBlock();
81 global $ilLocator,
$lng;
83 $next_class = $this->ctrl->getNextClass($this);
87 $this->ctrl->setParameter($this,
"dclv", $viewdef->getId());
88 $title = $lng->txt(
"dcl_view_viewdefinition");
91 switch ($next_class) {
92 case "ilpageobjectgui":
93 throw new ilCOPageException(
"Deprecated. ilDataCollectionRecordViewViewdefinitionGUI gui forwarding to ilpageobject");
97 $ilLocator->addItem($title, $this->ctrl->getLinkTarget($this,
"preview"));
100 return parent::executeCommand();
106 global
$lng, $ilToolbar;
113 $delete_button->setCaption(
'dcl_empty_view');
114 $delete_button->setUrl($this->ctrl->getLinkTarget($this,
'confirmDelete'));
115 $ilToolbar->addButtonInstance($delete_button);
119 $activation_button->setCaption(
'dcl_deactivate_view');
120 $activation_button->setUrl($this->ctrl->getLinkTarget($this,
'deactivate'));
122 $activation_button->setCaption(
'dcl_activate_view');
123 $activation_button->setUrl($this->ctrl->getLinkTarget($this,
'activate'));
126 $ilToolbar->addButtonInstance($activation_button);
129 if (
sizeof($legend)) {
130 $this->
setPrependingHtml(
"<span class=\"small\">" . $this->lng->txt(
"dcl_legend_placeholders") .
": " . implode(
" ", $legend)
135 return parent::showPage();
141 $page->setActive(
true);
143 $this->ctrl->redirect($this,
'edit');
149 $page->setActive(
false);
151 $this->ctrl->redirect($this,
'edit');
161 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
163 $conf->setFormAction($ilCtrl->getFormAction($this));
164 $conf->setHeaderText($lng->txt(
'dcl_confirm_delete_view_title'));
166 $conf->addItem(
'table', (
int)$this->table_id, $lng->txt(
'dcl_confirm_delete_view_text'));
168 $conf->setConfirm($lng->txt(
'delete'),
'deleteView');
169 $conf->setCancel($lng->txt(
'cancel'),
'cancelDelete');
171 $tpl->setContent($conf->getHTML());
181 $ilCtrl->redirect($this,
"edit");
191 include_once(
"./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinition.php");
193 $pageObject->delete();
195 $query =
"DELETE FROM il_dcl_view WHERE table_id = " . $this->table_id .
" AND type = " . $ilDB->quote(0,
"integer") .
" AND formtype = " 196 . $ilDB->quote(0,
"integer");
197 $ilDB->manipulate(
$query);
202 $ilCtrl->redirectByClass(
"ilDataCollectionFieldListGUI",
"listFields");
215 $ilCtrl->redirectByClass(
'ilDataCollectionFieldListGUI',
"listFields");
248 foreach ($allp as $item) {
249 $a_output = str_replace($item,
"<span style=\"color:green\">" . $item .
"</span>", $a_output);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
cancelDelete()
cancelDelete
executeCommand()
execute command
static getIdByTableId($a_table_id)
Get view definition id by table id.
getPageObject()
Get Page Object.
Class ilDataCollectionField.
releasePageLock()
Release page lock overwrite to redirect properly.
Class ilDataCollectionRecordViewViewdefinitionGUI.
getSyntaxStylePath()
get syntax style path
setPrependingHtml($a_prependinghtml)
Set Prepending HTML.
setPresentationTitle($a_title="")
static getAvailablePlaceholders($a_table_id, $a_verbose=false)
Get all placeholders for table id.
getContentStylePath($a_style_id)
get content style path
showPage()
display content of page
postOutputProcessing($a_output)
Finalizing output processing.
confirmDelete()
confirmDelete
Base exception class for copage service.
Confirmation screen class.