ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjForumAdministrationGUI Class Reference

Forum Administration Settings. More...

+ Inheritance diagram for ilObjForumAdministrationGUI:
+ Collaboration diagram for ilObjForumAdministrationGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Contructor @access public. More...
 
 executeCommand ()
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 editSettings (ilPropertyFormGUI $form=null)
 
 saveSettings ()
 Save settings. More...
 
 addToExternalSettingsForm ($a_form_id)
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Protected Member Functions

 populateForm (ilPropertyFormGUI $form)
 
 getSettingsForm ()
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Private Attributes

 $rbac
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Forum Administration Settings.

Author
Nadia Matuschek nmatu.nosp@m.sche.nosp@m.k@dat.nosp@m.abay.nosp@m..de
Version
$Id:$ @ilCtrl_Calls ilObjForumAdministrationGUI: ilPermissionGUI @ilCtrl_IsCalledBy ilObjForumAdministrationGUI: ilAdministrationGUI

Definition at line 15 of file class.ilObjForumAdministrationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjForumAdministrationGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Contructor @access public.

Definition at line 23 of file class.ilObjForumAdministrationGUI.php.

24 {
25 global $DIC;
26 $this->rbac = $DIC->rbac();
27
28 $this->type = 'frma';
29 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
30 $this->lng->loadLanguageModule('forum');
31 }
global $DIC
Definition: saml.php:7

References $DIC.

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjForumAdministrationGUI::addToExternalSettingsForm (   $a_form_id)
Parameters
string$a_form_id
Returns
array

Definition at line 248 of file class.ilObjForumAdministrationGUI.php.

249 {
250 switch ($a_form_id) {
252
253 $fields = array(
254 'enable_fora_statistics' => array($this->settings->get('enable_fora_statistics', false), ilAdministrationSettingsFormHandler::VALUE_BOOL),
255 'enable_anonymous_fora' => array($this->settings->get('enable_anonymous_fora', false), ilAdministrationSettingsFormHandler::VALUE_BOOL)
256 );
257
258 return array(array("editSettings", $fields));
259
261 require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
262 $fields = array(
263 'adm_captcha_anonymous_short' => array(ilCaptchaUtil::isActiveForForum(), ilAdministrationSettingsFormHandler::VALUE_BOOL)
264 );
265
266 return array('obj_frma' => array('editSettings', $fields));
267 }
268 }
settings()
Definition: settings.php:2

References ilAdministrationSettingsFormHandler\FORM_ACCESSIBILITY, ilAdministrationSettingsFormHandler\FORM_PRIVACY, settings(), and ilAdministrationSettingsFormHandler\VALUE_BOOL.

+ Here is the call graph for this function:

◆ editSettings()

ilObjForumAdministrationGUI::editSettings ( ilPropertyFormGUI  $form = null)
Parameters
ilPropertyFormGUI$form

Definition at line 87 of file class.ilObjForumAdministrationGUI.php.

88 {
89 $this->tabs_gui->activateTab('settings');
90
91 if (!$form) {
92 $form = $this->getSettingsForm();
93 $this->populateForm($form);
94 }
95
96 $this->tpl->setContent($form->getHtml());
97 }
if(isset($_POST['submit'])) $form

References $form, getSettingsForm(), and populateForm().

Referenced by saveSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjForumAdministrationGUI::executeCommand ( )
Returns
bool

Reimplemented from ilObjectGUI.

Definition at line 36 of file class.ilObjForumAdministrationGUI.php.

37 {
38 $next_class = $this->ctrl->getNextClass($this);
39 $cmd = $this->ctrl->getCmd();
40
41 $this->prepareOutput();
42
43 switch ($next_class) {
44 case 'ilpermissiongui':
45 $this->tabs_gui->setTabActive('perm_settings');
46 require_once 'Services/AccessControl/classes/class.ilPermissionGUI.php';
47 $this->ctrl->forwardCommand(new ilPermissionGUI($this));
48 break;
49
50 default:
51 if (!$cmd || $cmd == 'view') {
52 $cmd = 'editSettings';
53 }
54
55 $this->$cmd();
56 break;
57 }
58 return true;
59 }
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.

References ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjForumAdministrationGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 64 of file class.ilObjForumAdministrationGUI.php.

65 {
66 if ($this->rbac->system()->checkAccess('visible,read', $this->object->getRefId())) {
67 $this->tabs_gui->addTarget(
68 'settings',
69 $this->ctrl->getLinkTarget($this, 'editSettings'),
70 array('editSettings', 'view')
71 );
72 }
73
74 if ($this->rbac->system()->checkAccess('edit_permission', $this->object->getRefId())) {
75 $this->tabs_gui->addTarget(
76 'perm_settings',
77 $this->ctrl->getLinkTargetByClass('ilpermissiongui', 'perm'),
78 array(),
79 'ilpermissiongui'
80 );
81 }
82 }

◆ getSettingsForm()

ilObjForumAdministrationGUI::getSettingsForm ( )
protected
Returns
ilPropertyFormGUI

Definition at line 163 of file class.ilObjForumAdministrationGUI.php.

164 {
165 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
166 $form = new ilPropertyFormGUI();
167 $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
168 $form->setTitle($this->lng->txt('settings'));
169
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);
175
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);
179
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);
183
184 $file_upload = new ilRadioGroupInputGUI($this->lng->txt('file_upload_allowed_fora'), 'file_upload_allowed_fora');
185 $file_upload->addOption(new ilRadioOption($this->lng->txt('file_upload_option_allow'), ilForumProperties::FILE_UPLOAD_GLOBALLY_ALLOWED));
186 $file_upload->addOption(new ilRadioOption($this->lng->txt('file_upload_option_disallow'), ilForumProperties::FILE_UPLOAD_INDIVIDUAL));
187 $file_upload->setInfo($this->lng->txt('file_upload_allowed_fora_desc'));
188 $form->addItem($file_upload);
189
190 require_once 'Services/Cron/classes/class.ilCronManager.php';
191 if (ilCronManager::isJobActive('frm_notification')) {
192 require_once 'Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php';
195 $form,
196 $this
197 );
198 } else {
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);
203 }
204
205 $check = new ilCheckboxInputGui($this->lng->txt('enable_send_attachments'), 'send_attachments_by_mail');
206 $check->setInfo($this->lng->txt('enable_send_attachments_desc'));
207 $check->setValue(1);
208 $form->addItem($check);
209
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'));
213 $cap->setValue(1);
215 $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
216 }
217 $form->addItem($cap);
218
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);
222
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);
226
227 $autosave_interval = new ilNumberInputGUI($this->lng->txt('adm_autosave_ival'), 'autosave_drafts_ival');
228 $autosave_interval->allowDecimals(false);
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);
236
237 if ($this->checkPermissionBool("write")) {
238 $form->addCommandButton('saveSettings', $this->lng->txt('save'));
239 }
240
241 return $form;
242 }
static addFieldsToForm($a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
static checkFreetype()
Check whether captcha support is active.
This class represents a checkbox property in a property form.
static isJobActive($a_job_id)
Check if given job is currently active.
This class represents a number property in a property form.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.

References $form, ilAdministrationSettingsFormHandler\addFieldsToForm(), ilCaptchaUtil\checkFreetype(), ilObjectGUI\checkPermissionBool(), ilForumProperties\FILE_UPLOAD_GLOBALLY_ALLOWED, ilForumProperties\FILE_UPLOAD_INDIVIDUAL, ilAdministrationSettingsFormHandler\FORM_FORUM, and ilCronManager\isJobActive().

Referenced by editSettings(), and saveSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateForm()

ilObjForumAdministrationGUI::populateForm ( ilPropertyFormGUI  $form)
protected
Parameters
ilPropertyFormGUI$form

Definition at line 140 of file class.ilObjForumAdministrationGUI.php.

141 {
142 require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
143
144 $frma_set = new ilSetting('frma');
145
146 $form->setValuesByArray(array(
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(),
152 'file_upload_allowed_fora' => (int) $this->settings->get('file_upload_allowed_fora', ilForumProperties::FILE_UPLOAD_GLOBALLY_ALLOWED),
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)
157 ));
158 }
ILIAS Setting Class.

References $form, and ilForumProperties\FILE_UPLOAD_GLOBALLY_ALLOWED.

Referenced by editSettings().

+ Here is the caller graph for this function:

◆ saveSettings()

ilObjForumAdministrationGUI::saveSettings ( )

Save settings.

Definition at line 102 of file class.ilObjForumAdministrationGUI.php.

103 {
104 $this->checkPermission("write");
105
106 $form = $this->getSettingsForm();
107 if (!$form->checkInput()) {
108 $form->setValuesByPost();
109 $this->editSettings($form);
110 return;
111 }
112
113 $frma_set = new ilSetting('frma');
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'));
119
120 require_once 'Services/Cron/classes/class.ilCronManager.php';
121 if (!ilCronManager::isJobActive('frm_notification')) {
122 $this->settings->set('forum_notification', (int) $form->getInput('forum_notification'));
123 }
124
125 require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
126 ilCaptchaUtil::setActiveForForum((bool) $form->getInput('activate_captcha_anonym'));
127
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'));
131
132 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
133 $form->setValuesByPost();
134 $this->editSettings($form);
135 }
editSettings(ilPropertyFormGUI $form=null)
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References $form, ilObjectGUI\checkPermission(), editSettings(), getSettingsForm(), ilCronManager\isJobActive(), ilUtil\sendSuccess(), and settings().

+ Here is the call graph for this function:

Field Documentation

◆ $rbac

ilObjForumAdministrationGUI::$rbac
private

Definition at line 17 of file class.ilObjForumAdministrationGUI.php.


The documentation for this class was generated from the following file: