ILIAS  release_7 Revision v7.30-3-g800a261c036
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 ()
 viewObject container presentation for "administration -> repository, trash, permissions" 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...
 
 addToDeskObject ()
 @inheritDoc More...
 
 removeFromDeskObject ()
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

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...
 
 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
 
 $error
 

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 ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
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
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

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

25 {
26 global $DIC;
27
28 $this->rbac = $DIC->rbac();
29 $this->error = $DIC['ilErr'];
30
31 $this->type = 'frma';
32 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
33 $this->lng->loadLanguageModule('forum');
34 }
error($a_errmsg)
set error message @access public
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and error().

+ Here is the call graph for this function:

Member Function Documentation

◆ addToExternalSettingsForm()

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

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

261 {
262 switch ($a_form_id) {
264
265 $fields = array(
266 'enable_fora_statistics' => array($this->settings->get('enable_fora_statistics', false), ilAdministrationSettingsFormHandler::VALUE_BOOL),
267 'enable_anonymous_fora' => array($this->settings->get('enable_anonymous_fora', false), ilAdministrationSettingsFormHandler::VALUE_BOOL)
268 );
269
270 return array(array("editSettings", $fields));
271
273 $fields = array(
274 'adm_captcha_anonymous_short' => array(ilCaptchaUtil::isActiveForForum(), ilAdministrationSettingsFormHandler::VALUE_BOOL)
275 );
276
277 return array('obj_frma' => array('editSettings', $fields));
278 }
279 }
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 93 of file class.ilObjForumAdministrationGUI.php.

94 {
95 $this->tabs_gui->activateTab('settings');
96
97 if (!$form) {
98 $form = $this->getSettingsForm();
99 $this->populateForm($form);
100 }
101
102 $this->tpl->setContent($form->getHtml());
103 }

References 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 39 of file class.ilObjForumAdministrationGUI.php.

40 {
41 if (!$this->rbac->system()->checkAccess('visible,read', $this->object->getRefId())) {
42 $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
43 }
44
45 $next_class = $this->ctrl->getNextClass($this);
46 $cmd = $this->ctrl->getCmd();
47
48 $this->prepareOutput();
49
50 switch ($next_class) {
51 case 'ilpermissiongui':
52 $this->tabs_gui->setTabActive('perm_settings');
53 $this->ctrl->forwardCommand(new ilPermissionGUI($this));
54 break;
55
56 default:
57 if (!$cmd || $cmd == 'view') {
58 $cmd = 'editSettings';
59 }
60
61 $this->$cmd();
62 break;
63 }
64 return true;
65 }
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.

References error(), and 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 70 of file class.ilObjForumAdministrationGUI.php.

71 {
72 if ($this->rbac->system()->checkAccess('visible,read', $this->object->getRefId())) {
73 $this->tabs_gui->addTarget(
74 'settings',
75 $this->ctrl->getLinkTarget($this, 'editSettings'),
76 array('editSettings', 'view')
77 );
78 }
79
80 if ($this->rbac->system()->checkAccess('edit_permission', $this->object->getRefId())) {
81 $this->tabs_gui->addTarget(
82 'perm_settings',
83 $this->ctrl->getLinkTargetByClass('ilpermissiongui', 'perm'),
84 array(),
85 'ilpermissiongui'
86 );
87 }
88 }

◆ getSettingsForm()

ilObjForumAdministrationGUI::getSettingsForm ( )
protected
Returns
ilPropertyFormGUI

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

166 {
167 $form = new ilPropertyFormGUI();
168 $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
169 $form->setTitle($this->lng->txt('settings'));
170
171 $frm_radio = new ilRadioGroupInputGUI($this->lng->txt('frm_displayed_infos'), 'forum_overview');
172 $frm_radio->addOption(new ilRadioOption($this->lng->txt('new') . ', ' . $this->lng->txt('is_read') . ', ' . $this->lng->txt('unread'), '0'));
173 $frm_radio->addOption(new ilRadioOption($this->lng->txt('is_read') . ', ' . $this->lng->txt('unread'), '1'));
174 $frm_radio->setInfo($this->lng->txt('frm_disp_info_desc'));
175 $form->addItem($frm_radio);
176
177 $check = new ilCheckboxInputGui($this->lng->txt('enable_fora_statistics'), 'fora_statistics');
178 $check->setInfo($this->lng->txt('enable_fora_statistics_desc'));
179 $form->addItem($check);
180
181 $check = new ilCheckboxInputGui($this->lng->txt('enable_anonymous_fora'), 'anonymous_fora');
182 $check->setInfo($this->lng->txt('enable_anonymous_fora_desc'));
183 $form->addItem($check);
184
185 $file_upload = new ilRadioGroupInputGUI(
186 $this->lng->txt('file_upload_allowed_fora'),
187 'file_upload_allowed_fora'
188 );
189 $option_all_forums = new ilRadioOption(
190 $this->lng->txt('file_upload_option_allow'),
192 $this->lng->txt('file_upload_option_allow_info')
193 );
194 $file_upload->addOption($option_all_forums);
195
196 $option_per_forum = new ilRadioOption(
197 $this->lng->txt('file_upload_option_disallow'),
199 $this->lng->txt('file_upload_allowed_fora_desc')
200 );
201 $file_upload->addOption($option_per_forum);
202
203 $form->addItem($file_upload);
204
205 if (ilCronManager::isJobActive('frm_notification')) {
208 $form,
209 $this
210 );
211 } else {
212 $notifications = new ilCheckboxInputGui($this->lng->txt('cron_forum_notification'), 'forum_notification');
213 $notifications->setInfo($this->lng->txt('cron_forum_notification_desc'));
214 $notifications->setValue(1);
215 $form->addItem($notifications);
216 }
217
218 $check = new ilCheckboxInputGui($this->lng->txt('enable_send_attachments'), 'send_attachments_by_mail');
219 $check->setInfo($this->lng->txt('enable_send_attachments_desc'));
220 $check->setValue(1);
221 $form->addItem($check);
222
223 $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym');
224 $cap->setInfo($this->lng->txt('adm_captcha_anonymous_frm'));
225 $cap->setValue(1);
227 $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
228 }
229 $form->addItem($cap);
230
231 $drafts = new ilCheckboxInputGUI($this->lng->txt('adm_save_drafts'), 'save_post_drafts');
232 $drafts->setInfo($this->lng->txt('adm_save_drafts_desc'));
233 $drafts->setValue(1);
234
235 $autosave_drafts = new ilCheckboxInputGUI($this->lng->txt('adm_autosave_drafts'), 'autosave_drafts');
236 $autosave_drafts->setInfo($this->lng->txt('adm_autosave_drafts_desc'));
237 $autosave_drafts->setValue(1);
238
239 $autosave_interval = new ilNumberInputGUI($this->lng->txt('adm_autosave_ival'), 'autosave_drafts_ival');
240 $autosave_interval->allowDecimals(false);
241 $autosave_interval->setMinValue(30);
242 $autosave_interval->setMaxValue(60 * 60);
243 $autosave_interval->setSize(10);
244 $autosave_interval->setSuffix($this->lng->txt('seconds'));
245 $autosave_drafts->addSubItem($autosave_interval);
246 $drafts->addSubItem($autosave_drafts);
247 $form->addItem($drafts);
248
249 if ($this->checkPermissionBool("write")) {
250 $form->addCommandButton('saveSettings', $this->lng->txt('save'));
251 }
252
253 return $form;
254 }
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 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 144 of file class.ilObjForumAdministrationGUI.php.

145 {
146 $frma_set = new ilSetting('frma');
147
148 $form->setValuesByArray(array(
149 'forum_overview' => (bool) $frma_set->get('forum_overview', false),
150 'fora_statistics' => (bool) $this->settings->get('enable_fora_statistics', false),
151 'anonymous_fora' => (bool) $this->settings->get('enable_anonymous_fora', false),
152 'forum_notification' => (int) $this->settings->get('forum_notification') === 1 ? true : false,
153 'activate_captcha_anonym' => ilCaptchaUtil::isActiveForForum(),
154 'file_upload_allowed_fora' => (int) $this->settings->get('file_upload_allowed_fora', ilForumProperties::FILE_UPLOAD_GLOBALLY_ALLOWED),
155 'save_post_drafts' => (int) $this->settings->get('save_post_drafts', 0),
156 'autosave_drafts' => (int) $this->settings->get('autosave_drafts', 0),
157 'autosave_drafts_ival' => (int) $this->settings->get('autosave_drafts_ival', 30),
158 'send_attachments_by_mail' => (bool) $this->settings->get('send_attachments_by_mail', false)
159 ));
160 }
setValuesByArray($a_values, $a_restrict_to_value_keys=false)
Set form values from an array.
ILIAS Setting Class.

References ilForumProperties\FILE_UPLOAD_GLOBALLY_ALLOWED, and ilPropertyFormGUI\setValuesByArray().

Referenced by editSettings().

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

◆ saveSettings()

ilObjForumAdministrationGUI::saveSettings ( )

Save settings.

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

109 {
110 $this->checkPermission("write");
111
112 $form = $this->getSettingsForm();
113 if (!$form->checkInput()) {
114 $form->setValuesByPost();
115 $this->editSettings($form);
116 return;
117 }
118
119 $frma_set = new ilSetting('frma');
120 $frma_set->set('forum_overview', $form->getInput('forum_overview'));
121 $this->settings->set('file_upload_allowed_fora', (int) $form->getInput('file_upload_allowed_fora'));
122 $this->settings->set('send_attachments_by_mail', (int) $form->getInput('send_attachments_by_mail'));
123 $this->settings->set('enable_fora_statistics', (int) $form->getInput('fora_statistics'));
124 $this->settings->set('enable_anonymous_fora', (int) $form->getInput('anonymous_fora'));
125
126 if (!ilCronManager::isJobActive('frm_notification')) {
127 $this->settings->set('forum_notification', (int) $form->getInput('forum_notification'));
128 }
129
130 ilCaptchaUtil::setActiveForForum((bool) $form->getInput('activate_captcha_anonym'));
131
132 $this->settings->set('save_post_drafts', (int) $form->getInput('save_post_drafts'));
133 $this->settings->set('autosave_drafts', (int) $form->getInput('autosave_drafts'));
134 $this->settings->set('autosave_drafts_ival', (int) $form->getInput('autosave_drafts_ival'));
135
136 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
137 $form->setValuesByPost();
138 $this->editSettings($form);
139 }
editSettings(ilPropertyFormGUI $form=null)
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.

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

+ Here is the call graph for this function:

Field Documentation

◆ $error

ilObjForumAdministrationGUI::$error
private

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

◆ $rbac

ilObjForumAdministrationGUI::$rbac
private

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


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