4 include_once
'Services/Payment/classes/class.ilShopTopics.php';
31 $this->gui_object = $a_gui_object;
33 $a_gui_object->tabs_gui->setTabActive(
'topics');
41 $cmd = $this->ctrl->getCmd();
49 if(!
$cmd = $this->ctrl->getCmd())
51 $cmd =
'showTopicsList';
62 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
65 $genSetData = $genSet->getAll();
68 $form->setFormAction($this->ctrl->getFormAction($this,
'saveTopicsSettings'));
69 $form->setTitle($this->lng->txt(
'pays_general_settings'));
71 $form->addCommandButton(
'saveTopicsSettings',$this->lng->txt(
'save'));
75 $formItem->
setChecked((
int)$genSetData[
'enable_topics']);
76 $formItem->setInfo($this->lng->txt(
'enable_topics_info'));
77 $form->addItem($formItem);
81 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_topics_default_sorting_type'),
'topics_sorting_type');
82 $formItem->
setValue($genSetData[
'topics_sorting_type']);
84 1 => $this->lng->txt(
'pay_topics_sort_by_title'),
85 2 => $this->lng->txt(
'pay_topics_sort_by_date'),
86 3 => $this->lng->txt(
'pay_topics_sort_manually')
89 $form->addItem($formItem);
92 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_topics_default_sorting_direction'),
'topics_sorting_direction');
93 $formItem->
setValue($genSetData[
'topics_sorting_direction']);
95 'asc' => $this->lng->txt(
'sort_asc'),
96 'desc' => $this->lng->txt(
'sort_desc'),
99 $form->addItem($formItem);
102 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_topics_allow_custom_sorting'),
'topics_allow_custom_sorting');
103 $formItem->
setChecked((
int)$genSetData[
'topics_allow_custom_sorting']);
104 $formItem->setInfo($this->lng->txt(
'pay_topics_allow_custom_sorting_info'));
105 $form->addItem($formItem);
108 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'show_topics_filter'),
'show_topics_filter');
109 $formItem->
setChecked((
int)$genSetData[
'show_topics_filter']);
110 $formItem->setInfo($this->lng->txt(
'show_topics_filter_info'));
111 $form->addItem($formItem);
113 $this->tpl->setVariable(
'FORM',$form->getHTML());
122 $genSet->set(
'enable_topics',
$_POST[
'enable_topics'],
'gui');
123 $genSet->set(
'topics_allow_custom_sorting',
$_POST[
'topics_allow_custom_sorting'],
'gui');
124 $genSet->set(
'topics_sorting_type',
$_POST[
'topics_sorting_type'],
'gui');
125 $genSet->set(
'topics_sorting_direction',
$_POST[
'topics_sorting_direction'],
'gui');
126 $genSet->set(
'show_topics_filter',
$_POST[
'show_topics_filter'],
'gui');
146 $mode = $this->objCurrentTopic->getId() ?
'edit' :
'create';
148 if($this->objCurrentTopic->save())
161 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
163 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
167 if($this->objCurrentTopic->getId())
169 $this->ctrl->setParameter($this,
'topic_id', $this->objCurrentTopic->getId());
171 $form->setFormAction($this->ctrl->getFormAction($this,
'saveTopic'));
173 $form->setTitle($this->lng->txt($this->objCurrentTopic->getId() ?
'edit_topic' :
'new_topic'));
176 $title->
setValue($this->objCurrentTopic->getTitle());
177 $title->setRequired(
true);
178 $form->addItem($title);
180 $sorting =
new ilTextInputGUI($this->lng->txt(
'pay_sorting_value'),
'sorting');
181 $sorting->
setValue($this->objCurrentTopic->getSorting());
182 $sorting->setMaxLength(11);
183 $sorting->setSize(11);
184 $form->addItem($sorting);
186 $form->addCommandButton(
'saveTopic', $this->lng->txt(
'save'));
187 $form->addCommandButton(
'showTopicsList', $this->lng->txt(
'cancel'));
189 $this->tpl->setVariable(
'FORM', $form->getHTML());
196 if(!count(
$_POST[
'topic_id']))
202 $this->ask_for_deletion =
true;
212 if(count(
$_POST[
'sorting']))
214 foreach(
$_POST[
'sorting'] as $topic_id => $sorting_value)
217 $oTopic->setSorting($sorting_value);
232 if(!count(
$_POST[
'topic_id']))
238 foreach(
$_POST[
'topic_id'] as $topic_id)
255 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
257 if($this->ask_for_deletion)
259 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
262 $c_gui->setFormAction($this->ctrl->getFormAction($this,
'performDeleteTopic'));
263 $c_gui->setHeaderText($this->lng->txt(
'sure_delete_topics'));
264 $c_gui->setCancel($this->lng->txt(
'cancel'),
'showTopicsList');
265 $c_gui->setConfirm($this->lng->txt(
'confirm'),
'performDeleteTopic');
267 foreach(
$_POST[
'topic_id'] as $topic_id)
272 $this->tpl->setVariable(
'CONFIRMATION', $c_gui->getHTML());
277 include_once
'Services/Payment/classes/class.ilShopTopicsTableGUI.php';
279 $table_gui->setTitle($this->lng->txt(
'topics'));
284 $table_gui->addCommandButton(
'showTopicForm', $this->lng->txt(
'add'));
285 $table_gui->addCommandButton(
'saveSorting', $this->lng->txt(
'pay_save_sorting'));
287 $this->tpl->setVariable(
'TABLE', $table_gui->getHTML());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
const TOPICS_SORT_MANUALLY
static _lookupTitle($a_id)
__construct($a_gui_object)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(!is_array($argv)) $options
This class represents a text property in a property form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class ilShopTopicsTableGUI.
setValue($a_value)
Set Value.
Confirmation screen class.