4 require_once
'Services/Object/classes/class.ilObjectGUI.php';
5 require_once
'Modules/Forum/classes/class.ilForumProperties.php';
23 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
26 $this->rbac = $DIC->rbac();
29 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
30 $this->lng->loadLanguageModule(
'forum');
38 $next_class = $this->ctrl->getNextClass($this);
39 $cmd = $this->ctrl->getCmd();
43 switch ($next_class) {
44 case 'ilpermissiongui':
45 $this->tabs_gui->setTabActive(
'perm_settings');
46 require_once
'Services/AccessControl/classes/class.ilPermissionGUI.php';
51 if (!$cmd || $cmd ==
'view') {
52 $cmd =
'editSettings';
66 if ($this->rbac->system()->checkAccess(
'visible,read', $this->
object->getRefId())) {
67 $this->tabs_gui->addTarget(
69 $this->ctrl->getLinkTarget($this,
'editSettings'),
70 array(
'editSettings',
'view')
74 if ($this->rbac->system()->checkAccess(
'edit_permission', $this->
object->getRefId())) {
75 $this->tabs_gui->addTarget(
77 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
'perm'),
89 $this->tabs_gui->activateTab(
'settings');
96 $this->tpl->setContent(
$form->getHtml());
107 if (!
$form->checkInput()) {
108 $form->setValuesByPost();
114 $frma_set->set(
'forum_overview',
$form->getInput(
'forum_overview'));
115 $this->
settings->set(
'file_upload_allowed_fora', (
int)
$form->getInput(
'file_upload_allowed_fora'));
116 $this->
settings->set(
'send_attachments_by_mail', (
int)
$form->getInput(
'send_attachments_by_mail'));
117 $this->
settings->set(
'enable_fora_statistics', (
int)
$form->getInput(
'fora_statistics'));
118 $this->
settings->set(
'enable_anonymous_fora', (
int)
$form->getInput(
'anonymous_fora'));
120 require_once
'Services/Cron/classes/class.ilCronManager.php';
122 $this->
settings->set(
'forum_notification', (
int)
$form->getInput(
'forum_notification'));
125 require_once
'Services/Captcha/classes/class.ilCaptchaUtil.php';
126 ilCaptchaUtil::setActiveForForum((
bool)
$form->getInput(
'activate_captcha_anonym'));
128 $this->
settings->set(
'save_post_drafts', (
int)
$form->getInput(
'save_post_drafts'));
129 $this->
settings->set(
'autosave_drafts', (
int)
$form->getInput(
'autosave_drafts'));
130 $this->
settings->set(
'autosave_drafts_ival', (
int)
$form->getInput(
'autosave_drafts_ival'));
133 $form->setValuesByPost();
142 require_once
'Services/Captcha/classes/class.ilCaptchaUtil.php';
147 'forum_overview' => (
bool) $frma_set->get(
'forum_overview',
false),
148 'fora_statistics' => (bool) $this->
settings->get(
'enable_fora_statistics',
false),
149 'anonymous_fora' => (bool) $this->
settings->get(
'enable_anonymous_fora',
false),
150 'forum_notification' => (int) $this->
settings->get(
'forum_notification') === 1 ? true :
false,
151 'activate_captcha_anonym' => ilCaptchaUtil::isActiveForForum(),
153 'save_post_drafts' => (int) $this->
settings->get(
'save_post_drafts', 0),
154 'autosave_drafts' => (int) $this->
settings->get(
'autosave_drafts', 0),
155 'autosave_drafts_ival' => (int) $this->
settings->get(
'autosave_drafts_ival', 30),
156 'send_attachments_by_mail' => (bool) $this->
settings->get(
'send_attachments_by_mail',
false)
165 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
167 $form->setFormAction($this->ctrl->getFormAction($this,
'saveSettings'));
168 $form->setTitle($this->lng->txt(
'settings'));
170 $frm_radio =
new ilRadioGroupInputGUI($this->lng->txt(
'frm_displayed_infos'),
'forum_overview');
171 $frm_radio->
addOption(
new ilRadioOption($this->lng->txt(
'new') .
', ' . $this->lng->txt(
'is_read') .
', ' . $this->lng->txt(
'unread'),
'0'));
172 $frm_radio->addOption(
new ilRadioOption($this->lng->txt(
'is_read') .
', ' . $this->lng->txt(
'unread'),
'1'));
173 $frm_radio->setInfo($this->lng->txt(
'frm_disp_info_desc'));
174 $form->addItem($frm_radio);
176 $check =
new ilCheckboxInputGui($this->lng->txt(
'enable_fora_statistics'),
'fora_statistics');
177 $check->setInfo($this->lng->txt(
'enable_fora_statistics_desc'));
178 $form->addItem($check);
180 $check =
new ilCheckboxInputGui($this->lng->txt(
'enable_anonymous_fora'),
'anonymous_fora');
181 $check->setInfo($this->lng->txt(
'enable_anonymous_fora_desc'));
182 $form->addItem($check);
184 $file_upload =
new ilRadioGroupInputGUI($this->lng->txt(
'file_upload_allowed_fora'),
'file_upload_allowed_fora');
187 $file_upload->setInfo($this->lng->txt(
'file_upload_allowed_fora_desc'));
188 $form->addItem($file_upload);
190 require_once
'Services/Cron/classes/class.ilCronManager.php';
192 require_once
'Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php';
199 $notifications =
new ilCheckboxInputGui($this->lng->txt(
'cron_forum_notification'),
'forum_notification');
200 $notifications->setInfo($this->lng->txt(
'cron_forum_notification_desc'));
201 $notifications->setValue(1);
202 $form->addItem($notifications);
205 $check =
new ilCheckboxInputGui($this->lng->txt(
'enable_send_attachments'),
'send_attachments_by_mail');
206 $check->setInfo($this->lng->txt(
'enable_send_attachments_desc'));
208 $form->addItem($check);
210 require_once
'Services/Captcha/classes/class.ilCaptchaUtil.php';
211 $cap =
new ilCheckboxInputGUI($this->lng->txt(
'adm_captcha_anonymous_short'),
'activate_captcha_anonym');
212 $cap->
setInfo($this->lng->txt(
'adm_captcha_anonymous_frm'));
215 $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
217 $form->addItem($cap);
219 $drafts =
new ilCheckboxInputGUI($this->lng->txt(
'adm_save_drafts'),
'save_post_drafts');
220 $drafts->
setInfo($this->lng->txt(
'adm_save_drafts_desc'));
221 $drafts->setValue(1);
223 $autosave_drafts =
new ilCheckboxInputGUI($this->lng->txt(
'adm_autosave_drafts'),
'autosave_drafts');
224 $autosave_drafts->
setInfo($this->lng->txt(
'adm_autosave_drafts_desc'));
225 $autosave_drafts->setValue(1);
227 $autosave_interval =
new ilNumberInputGUI($this->lng->txt(
'adm_autosave_ival'),
'autosave_drafts_ival');
229 $autosave_interval->setMinValue(30);
230 $autosave_interval->setMaxValue(60 * 60);
231 $autosave_interval->setSize(10);
232 $autosave_interval->setSuffix($this->lng->txt(
'seconds'));
233 $autosave_drafts->addSubItem($autosave_interval);
234 $drafts->addSubItem($autosave_drafts);
235 $form->addItem($drafts);
238 $form->addCommandButton(
'saveSettings', $this->lng->txt(
'save'));
250 switch ($a_form_id) {
261 require_once
'Services/Captcha/classes/class.ilCaptchaUtil.php';
266 return array(
'obj_frma' =>
array(
'editSettings', $fields));
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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)
Create styles array
The data for the language used.
Forum Administration Settings.
Create new PHPExcel object
obj_idprivate
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.