4 include_once
'Services/Payment/classes/class.ilShopTopics.php';
31 $a_gui_object->tabs_gui->setTabActive(
'topics');
38 $cmd = $this->ctrl->getCmd();
39 switch($this->ctrl->getNextClass($this))
42 if(!
$cmd = $this->ctrl->getCmd())
44 $cmd =
'showTopicsList';
66 $mode = $this->objCurrentTopic->getId() ?
'edit' :
'create';
68 if($this->objCurrentTopic->save())
81 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
83 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
87 if($this->objCurrentTopic->getId())
89 $this->ctrl->setParameter($this,
'topic_id', $this->objCurrentTopic->getId());
91 $form->setFormAction($this->ctrl->getFormAction($this,
'saveTopic'));
93 $form->setTitle($this->lng->txt($this->objCurrentTopic->getId() ?
'edit_topic' :
'new_topic'));
96 $title->setValue($this->objCurrentTopic->getTitle());
100 $sorting =
new ilTextInputGUI($this->lng->txt(
'pay_sorting_value'),
'sorting');
101 $sorting->
setValue($this->objCurrentTopic->getSorting());
102 $sorting->setMaxLength(11);
103 $sorting->setSize(11);
104 $form->addItem($sorting);
106 $form->addCommandButton(
'saveTopic', $this->lng->txt(
'save'));
107 $form->addCommandButton(
'showTopicsList', $this->lng->txt(
'cancel'));
109 $this->tpl->setVariable(
'FORM', $form->getHTML());
116 if(!count(
$_POST[
'topic_id']))
122 $this->ask_for_deletion =
true;
132 if(count(
$_POST[
'sorting']))
134 foreach(
$_POST[
'sorting'] as $topic_id => $sorting_value)
137 $oTopic->setSorting($sorting_value);
152 if(!count(
$_POST[
'topic_id']))
158 foreach(
$_POST[
'topic_id'] as $topic_id)
175 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
177 if($this->ask_for_deletion)
179 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
182 $c_gui->setFormAction($this->ctrl->getFormAction($this,
'performDeleteTopic'));
183 $c_gui->setHeaderText($this->lng->txt(
'sure_delete_topics'));
184 $c_gui->setCancel($this->lng->txt(
'cancel'),
'showTopicsList');
185 $c_gui->setConfirm($this->lng->txt(
'confirm'),
'performDeleteTopic');
187 foreach(
$_POST[
'topic_id'] as $topic_id)
192 $this->tpl->setVariable(
'CONFIRMATION', $c_gui->getHTML());
197 include_once
'Services/Payment/classes/class.ilShopTopicsTableGUI.php';
199 $table_gui->setTitle($this->lng->txt(
'topics'));
204 $table_gui->addCommandButton(
'showTopicForm', $this->lng->txt(
'add'));
205 $table_gui->addCommandButton(
'saveSorting', $this->lng->txt(
'pay_save_sorting'));
207 $this->tpl->setVariable(
'TABLE', $table_gui->getHTML());