21 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
24 $this->rbac = $DIC->rbac();
27 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
28 $this->lng->loadLanguageModule(
'forum');
36 $next_class = $this->ctrl->getNextClass($this);
37 $cmd = $this->ctrl->getCmd();
41 switch ($next_class) {
42 case 'ilpermissiongui':
43 $this->tabs_gui->setTabActive(
'perm_settings');
48 if (!$cmd || $cmd ==
'view') {
49 $cmd =
'editSettings';
63 if ($this->rbac->system()->checkAccess(
'visible,read', $this->object->getRefId())) {
64 $this->tabs_gui->addTarget(
66 $this->ctrl->getLinkTarget($this,
'editSettings'),
67 array(
'editSettings',
'view')
71 if ($this->rbac->system()->checkAccess(
'edit_permission', $this->object->getRefId())) {
72 $this->tabs_gui->addTarget(
74 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
'perm'),
86 $this->tabs_gui->activateTab(
'settings');
93 $this->tpl->setContent(
$form->getHtml());
104 if (!
$form->checkInput()) {
105 $form->setValuesByPost();
111 $frma_set->set(
'forum_overview',
$form->getInput(
'forum_overview'));
112 $this->
settings->set(
'file_upload_allowed_fora', (
int)
$form->getInput(
'file_upload_allowed_fora'));
113 $this->
settings->set(
'send_attachments_by_mail', (
int)
$form->getInput(
'send_attachments_by_mail'));
114 $this->
settings->set(
'enable_fora_statistics', (
int)
$form->getInput(
'fora_statistics'));
115 $this->
settings->set(
'enable_anonymous_fora', (
int)
$form->getInput(
'anonymous_fora'));
118 $this->
settings->set(
'forum_notification', (
int)
$form->getInput(
'forum_notification'));
121 ilCaptchaUtil::setActiveForForum((
bool)
$form->getInput(
'activate_captcha_anonym'));
123 $this->
settings->set(
'save_post_drafts', (
int)
$form->getInput(
'save_post_drafts'));
124 $this->
settings->set(
'autosave_drafts', (
int)
$form->getInput(
'autosave_drafts'));
125 $this->
settings->set(
'autosave_drafts_ival', (
int)
$form->getInput(
'autosave_drafts_ival'));
127 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
128 $form->setValuesByPost();
140 'forum_overview' => (
bool) $frma_set->get(
'forum_overview',
false),
141 'fora_statistics' => (bool) $this->
settings->get(
'enable_fora_statistics',
false),
142 'anonymous_fora' => (bool) $this->
settings->get(
'enable_anonymous_fora',
false),
143 'forum_notification' => (int) $this->
settings->get(
'forum_notification') === 1 ? true :
false,
144 'activate_captcha_anonym' => ilCaptchaUtil::isActiveForForum(),
146 'save_post_drafts' => (int) $this->
settings->get(
'save_post_drafts', 0),
147 'autosave_drafts' => (int) $this->
settings->get(
'autosave_drafts', 0),
148 'autosave_drafts_ival' => (int) $this->
settings->get(
'autosave_drafts_ival', 30),
149 'send_attachments_by_mail' => (bool) $this->
settings->get(
'send_attachments_by_mail',
false)
159 $form->setFormAction($this->ctrl->getFormAction($this,
'saveSettings'));
160 $form->setTitle($this->lng->txt(
'settings'));
162 $frm_radio =
new ilRadioGroupInputGUI($this->lng->txt(
'frm_displayed_infos'),
'forum_overview');
163 $frm_radio->
addOption(
new ilRadioOption($this->lng->txt(
'new') .
', ' . $this->lng->txt(
'is_read') .
', ' . $this->lng->txt(
'unread'),
'0'));
164 $frm_radio->addOption(
new ilRadioOption($this->lng->txt(
'is_read') .
', ' . $this->lng->txt(
'unread'),
'1'));
165 $frm_radio->setInfo($this->lng->txt(
'frm_disp_info_desc'));
166 $form->addItem($frm_radio);
168 $check =
new ilCheckboxInputGui($this->lng->txt(
'enable_fora_statistics'),
'fora_statistics');
169 $check->setInfo($this->lng->txt(
'enable_fora_statistics_desc'));
170 $form->addItem($check);
172 $check =
new ilCheckboxInputGui($this->lng->txt(
'enable_anonymous_fora'),
'anonymous_fora');
173 $check->setInfo($this->lng->txt(
'enable_anonymous_fora_desc'));
174 $form->addItem($check);
176 $file_upload =
new ilRadioGroupInputGUI($this->lng->txt(
'file_upload_allowed_fora'),
'file_upload_allowed_fora');
179 $file_upload->setInfo($this->lng->txt(
'file_upload_allowed_fora_desc'));
180 $form->addItem($file_upload);
189 $notifications =
new ilCheckboxInputGui($this->lng->txt(
'cron_forum_notification'),
'forum_notification');
190 $notifications->setInfo($this->lng->txt(
'cron_forum_notification_desc'));
191 $notifications->setValue(1);
192 $form->addItem($notifications);
195 $check =
new ilCheckboxInputGui($this->lng->txt(
'enable_send_attachments'),
'send_attachments_by_mail');
196 $check->setInfo($this->lng->txt(
'enable_send_attachments_desc'));
198 $form->addItem($check);
200 $cap =
new ilCheckboxInputGUI($this->lng->txt(
'adm_captcha_anonymous_short'),
'activate_captcha_anonym');
201 $cap->
setInfo($this->lng->txt(
'adm_captcha_anonymous_frm'));
204 $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
206 $form->addItem($cap);
208 $drafts =
new ilCheckboxInputGUI($this->lng->txt(
'adm_save_drafts'),
'save_post_drafts');
209 $drafts->
setInfo($this->lng->txt(
'adm_save_drafts_desc'));
210 $drafts->setValue(1);
212 $autosave_drafts =
new ilCheckboxInputGUI($this->lng->txt(
'adm_autosave_drafts'),
'autosave_drafts');
213 $autosave_drafts->
setInfo($this->lng->txt(
'adm_autosave_drafts_desc'));
214 $autosave_drafts->setValue(1);
216 $autosave_interval =
new ilNumberInputGUI($this->lng->txt(
'adm_autosave_ival'),
'autosave_drafts_ival');
218 $autosave_interval->setMinValue(30);
219 $autosave_interval->setMaxValue(60 * 60);
220 $autosave_interval->setSize(10);
221 $autosave_interval->setSuffix($this->lng->txt(
'seconds'));
222 $autosave_drafts->addSubItem($autosave_interval);
223 $drafts->addSubItem($autosave_drafts);
224 $form->addItem($drafts);
227 $form->addCommandButton(
'saveSettings', $this->lng->txt(
'save'));
239 switch ($a_form_id) {
247 return array(array(
"editSettings", $fields));
254 return array(
'obj_frma' => array(
'editSettings', $fields));
This class represents an option in a radio group.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Contructor public.
static checkFreetype()
Check whether captcha support is active.
populateForm(ilPropertyFormGUI $form)
const FILE_UPLOAD_INDIVIDUAL
prepareOutput($a_show_subobjects=true)
prepare output
const FILE_UPLOAD_GLOBALLY_ALLOWED
saveSettings()
Save settings.
editSettings(ilPropertyFormGUI $form=null)
if(isset($_POST['submit'])) $form
Class ilObjectGUI Basic methods of all Output classes.
addToExternalSettingsForm($a_form_id)
Forum Administration Settings.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static isJobActive($a_job_id)
Check if given job is currently active.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.