ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 

Protected Member Functions

 populateForm (ilPropertyFormGUI $form)
 
 getSettingsForm ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 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
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

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 13 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 21 of file class.ilObjForumAdministrationGUI.php.

22 {
23 global $DIC;
24 $this->rbac = $DIC->rbac();
25
26 $this->type = 'frma';
27 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
28 $this->lng->loadLanguageModule('forum');
29 }
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 237 of file class.ilObjForumAdministrationGUI.php.

238 {
239 switch ($a_form_id) {
241
242 $fields = array(
243 'enable_fora_statistics' => array($this->settings->get('enable_fora_statistics', false), ilAdministrationSettingsFormHandler::VALUE_BOOL),
244 'enable_anonymous_fora' => array($this->settings->get('enable_anonymous_fora', false), ilAdministrationSettingsFormHandler::VALUE_BOOL)
245 );
246
247 return array(array("editSettings", $fields));
248
250 $fields = array(
251 'adm_captcha_anonymous_short' => array(ilCaptchaUtil::isActiveForForum(), ilAdministrationSettingsFormHandler::VALUE_BOOL)
252 );
253
254 return array('obj_frma' => array('editSettings', $fields));
255 }
256 }
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 84 of file class.ilObjForumAdministrationGUI.php.

85 {
86 $this->tabs_gui->activateTab('settings');
87
88 if (!$form) {
89 $form = $this->getSettingsForm();
90 $this->populateForm($form);
91 }
92
93 $this->tpl->setContent($form->getHtml());
94 }
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 34 of file class.ilObjForumAdministrationGUI.php.

35 {
36 $next_class = $this->ctrl->getNextClass($this);
37 $cmd = $this->ctrl->getCmd();
38
39 $this->prepareOutput();
40
41 switch ($next_class) {
42 case 'ilpermissiongui':
43 $this->tabs_gui->setTabActive('perm_settings');
44 $this->ctrl->forwardCommand(new ilPermissionGUI($this));
45 break;
46
47 default:
48 if (!$cmd || $cmd == 'view') {
49 $cmd = 'editSettings';
50 }
51
52 $this->$cmd();
53 break;
54 }
55 return true;
56 }
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 61 of file class.ilObjForumAdministrationGUI.php.

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

◆ getSettingsForm()

ilObjForumAdministrationGUI::getSettingsForm ( )
protected
Returns
ilPropertyFormGUI

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

157 {
158 $form = new ilPropertyFormGUI();
159 $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
160 $form->setTitle($this->lng->txt('settings'));
161
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);
167
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);
171
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);
175
176 $file_upload = new ilRadioGroupInputGUI($this->lng->txt('file_upload_allowed_fora'), 'file_upload_allowed_fora');
177 $file_upload->addOption(new ilRadioOption($this->lng->txt('file_upload_option_allow'), ilForumProperties::FILE_UPLOAD_GLOBALLY_ALLOWED));
178 $file_upload->addOption(new ilRadioOption($this->lng->txt('file_upload_option_disallow'), ilForumProperties::FILE_UPLOAD_INDIVIDUAL));
179 $file_upload->setInfo($this->lng->txt('file_upload_allowed_fora_desc'));
180 $form->addItem($file_upload);
181
182 if (ilCronManager::isJobActive('frm_notification')) {
185 $form,
186 $this
187 );
188 } else {
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);
193 }
194
195 $check = new ilCheckboxInputGui($this->lng->txt('enable_send_attachments'), 'send_attachments_by_mail');
196 $check->setInfo($this->lng->txt('enable_send_attachments_desc'));
197 $check->setValue(1);
198 $form->addItem($check);
199
200 $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym');
201 $cap->setInfo($this->lng->txt('adm_captcha_anonymous_frm'));
202 $cap->setValue(1);
204 $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
205 }
206 $form->addItem($cap);
207
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);
211
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);
215
216 $autosave_interval = new ilNumberInputGUI($this->lng->txt('adm_autosave_ival'), 'autosave_drafts_ival');
217 $autosave_interval->allowDecimals(false);
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);
225
226 if ($this->checkPermissionBool("write")) {
227 $form->addCommandButton('saveSettings', $this->lng->txt('save'));
228 }
229
230 return $form;
231 }
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 135 of file class.ilObjForumAdministrationGUI.php.

136 {
137 $frma_set = new ilSetting('frma');
138
139 $form->setValuesByArray(array(
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(),
145 'file_upload_allowed_fora' => (int) $this->settings->get('file_upload_allowed_fora', ilForumProperties::FILE_UPLOAD_GLOBALLY_ALLOWED),
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)
150 ));
151 }
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 99 of file class.ilObjForumAdministrationGUI.php.

100 {
101 $this->checkPermission("write");
102
103 $form = $this->getSettingsForm();
104 if (!$form->checkInput()) {
105 $form->setValuesByPost();
106 $this->editSettings($form);
107 return;
108 }
109
110 $frma_set = new ilSetting('frma');
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'));
116
117 if (!ilCronManager::isJobActive('frm_notification')) {
118 $this->settings->set('forum_notification', (int) $form->getInput('forum_notification'));
119 }
120
121 ilCaptchaUtil::setActiveForForum((bool) $form->getInput('activate_captcha_anonym'));
122
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'));
126
127 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
128 $form->setValuesByPost();
129 $this->editSettings($form);
130 }
editSettings(ilPropertyFormGUI $form=null)
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.

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

+ Here is the call graph for this function:

Field Documentation

◆ $rbac

ilObjForumAdministrationGUI::$rbac
private

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


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