ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjForumGUI Class Reference

Class ilObjForumGUI. More...

+ Inheritance diagram for ilObjForumGUI:
+ Collaboration diagram for ilObjForumGUI:

Public Member Functions

 updateThreadObject ()
 
 showThreadsObject ()
 
 sortThreadsObject ()
 
 getSubTabs ($subtab='showThreads')
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 performPostActivationObject ()
 
 askForPostActivationObject ()
 
 setDisplayConfirmPostActivation ($status=0)
 
 displayConfirmPostActivation ()
 
 toggleStickinessObject ()
 
 cancelPostObject ()
 
 createToLevelPostObject ()
 
 saveTopLevelPostObject ()
 
 quoteTopLevelPostObject ()
 
 quotePostObject ()
 
 getForumExplorer ()
 
 fetchTreeChildrenAsyncObject ()
 
 setTreeStateAsynchObject ()
 
 checkEnableColumnEdit ()
 
 cloneWizardPageObject ()
 
 handleFormInput ($a_text, $a_stripslashes=true)
 
 prepareFormOutput ($a_text)
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 getIcon ($user_toggle_noti)
 
 isUserAllowedToDeactivateNotification ()
 
 removeFromDeskObject ()
 
 saveThreadSortingObject ()
 
 mergeThreadsObject ()
 
 confirmMergeThreadsObject ()
 
 cancelMergeThreads ()
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 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...
 
 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...
 
- Public Member Functions inherited from ilDesktopItemHandling
 addToDeskObject ()
 Add desktop item @access public. More...
 
 removeFromDeskObject ()
 Remove from desktop @access public. More...
 

Data Fields

 $objProperties
 
 $object
 
 $ilias
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $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 Member Functions

 initSessionStorage ()
 
 getEditFormCustomValues (Array &$a_values)
 
 afterSave (ilObjForum $forumObj)
 
 setSideBlocks ()
 {} More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 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...
 
 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...
 
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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 Member Functions

 isHierarchicalView ()
 
 isTopLevelReplyCommand ()
 
 getThreadEditingForm ($a_thread_id)
 
 initForumCreateForm ($object_type)
 
 getReplyEditForm ()
 
 hideToolbar ($a_flag=null)
 
 getForumObjects ()
 
 getModifiedReOnSubject ($on_reply=false)
 
 setTopicCreateDefaultValues ()
 
 updateUserNotifications ($update_all_users=false)
 
 initNotificationSettingsForm ()
 
 getUserNotificationTableData ($user_ids, ilForumNotification $frm_noti)
 
 isParentObjectCrsOrGrp ()
 

Private Attributes

 $objCurrentTopic
 
 $objCurrentPost
 
 $display_confirm_post_activation = 0
 
 $is_moderator = false
 
 $create_form_gui
 
 $create_topic_form_gui
 
 $replyEditForm
 
 $notificationSettingsForm
 
 $hideToolbar = false
 
 $forum_overview_setting = null
 
 $forumObjects
 
 $confirmation_gui_html = ''
 

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...
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Detailed Description

Member Function Documentation

◆ afterSave()

ilObjForumGUI::afterSave ( ilObjForum  $forumObj)
protected
Parameters
ilObjForum$forumObj

Definition at line 787 of file class.ilObjForumGUI.php.

788 {
789 ilUtil::sendSuccess($this->lng->txt('frm_added'), true);
790 $this->ctrl->setParameter($this, 'ref_id', $forumObj->getRefId());
791 ilUtil::redirect($this->ctrl->getLinkTarget($this, 'createThread', '', false, false));
792 }
getRefId()
get reference id @access public
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script

References ilObject\getRefId(), ilUtil\redirect(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ askForPostActivationObject()

ilObjForumGUI::askForPostActivationObject ( )

Definition at line 1176 of file class.ilObjForumGUI.php.

1177 {
1178 if($this->is_moderator)
1179 {
1181 }
1182
1183 $this->viewThreadObject();
1184 }
setDisplayConfirmPostActivation($status=0)

References setDisplayConfirmPostActivation().

+ Here is the call graph for this function:

◆ cancelMergeThreads()

ilObjForumGUI::cancelMergeThreads ( )

Definition at line 4898 of file class.ilObjForumGUI.php.

4899 {
4900 $this->showThreadsObject();
4901 }

References showThreadsObject().

+ Here is the call graph for this function:

◆ cancelObject()

ilObjForumGUI::cancelObject (   $in_rep = false)

cancel action and go back to previous page @access public

Reimplemented from ilObjectGUI.

Definition at line 778 of file class.ilObjForumGUI.php.

779 {
780 ilUtil::sendInfo($this->lng->txt('msg_cancel'), true);
781 ilUtil::redirect('ilias.php?baseClass=ilRepositoryGUI&cmd=frameset&ref_id='.$_GET['ref_id']);
782 }
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_GET, ilUtil\redirect(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ cancelPostObject()

ilObjForumGUI::cancelPostObject ( )

Definition at line 1234 of file class.ilObjForumGUI.php.

1235 {
1236 $_GET['action'] = '';
1237 $this->viewThreadObject();
1238 }

References $_GET.

◆ checkEnableColumnEdit()

ilObjForumGUI::checkEnableColumnEdit ( )

Definition at line 3831 of file class.ilObjForumGUI.php.

3832 {
3833 return false;
3834 }

◆ cloneWizardPageObject()

ilObjForumGUI::cloneWizardPageObject ( )

Definition at line 3861 of file class.ilObjForumGUI.php.

3862 {
3863 global $ilObjDataCache;
3864
3865 if (!$_POST['clone_source'])
3866 {
3867 ilUtil::sendInfo($this->lng->txt('select_one'));
3868 if (isset($_SESSION['wizard_search_title']))
3869 {
3870 $this->searchCloneSourceObject();
3871 }
3872 else
3873 {
3874 $this->createObject();
3875 }
3876 return false;
3877 }
3878 $source_id = $_POST['clone_source'];
3879
3880 $new_type = $_REQUEST['new_type'];
3881 $this->ctrl->setParameter($this, 'clone_source', (int) $_POST['clone_source']);
3882 $this->ctrl->setParameter($this, 'new_type', $new_type);
3883
3884 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.frm_wizard_page.html', 'Modules/Forum');
3885 $this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
3886 $this->tpl->setVariable('TYPE_IMG', ilUtil::getImagePath('icon_'.$new_type.'.svg'));
3887 $this->tpl->setVariable('ALT_IMG', $this->lng->txt('obj_'.$new_type));
3888 $this->tpl->setVariable('TXT_DUPLICATE', $this->lng->txt('frm_wizard_page'));
3889 $this->tpl->setVariable('INFO_THREADS', $this->lng->txt('fmr_copy_threads_info'));
3890 $this->tpl->setVariable('THREADS', $this->lng->txt('forums_threads'));
3891
3892 $forum_id = $ilObjDataCache->lookupObjId((int) $_POST['clone_source']);
3893 include_once('Modules/Forum/classes/class.ilForum.php');
3894 $threads = ilForum::_getThreads($forum_id, ilForum::SORT_TITLE);
3895 foreach ($threads as $thread_id => $title)
3896 {
3897 $this->tpl->setCurrentBlock('thread_row');
3898 $this->tpl->setVariable('CHECK_THREAD', ilUtil::formCheckbox(0, 'cp_options['.$source_id.'][threads][]', $thread_id));
3899 $this->tpl->setVariable('NAME_THREAD', $title);
3900 $this->tpl->parseCurrentBlock();
3901 }
3902 $this->tpl->setVariable('SELECT_ALL', $this->lng->txt('select_all'));
3903 $this->tpl->setVariable('JS_FIELD', 'cp_options['.$source_id.'][threads]');
3904 $this->tpl->setVariable('BTN_COPY', $this->lng->txt('obj_'.$new_type.'_duplicate'));
3905 if (isset($_SESSION['wizard_search_title']))
3906 {
3907 $this->tpl->setVariable('BACK_CMD', 'searchCloneSource');
3908 }
3909 else
3910 {
3911 $this->tpl->setVariable('BACK_CMD', 'create');
3912 }
3913 $this->tpl->setVariable('BTN_BACK', $this->lng->txt('btn_back'));
3914 }
$_SESSION["AccountId"]
const SORT_TITLE
static _getThreads($a_obj_id, $a_sort_mode=self::SORT_DATE)
Get thread infos of object.
createObject()
create new object form
static formCheckbox($checked, $varname, $value, $disabled=false)
??? @access public
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$_POST['username']
Definition: cron.php:12
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

References $_POST, $_REQUEST, $_SESSION, ilForum\_getThreads(), ilObjectGUI\createObject(), ilUtil\formCheckbox(), ilUtil\getImagePath(), ilUtil\sendInfo(), and ilForum\SORT_TITLE.

+ Here is the call graph for this function:

◆ confirmMergeThreadsObject()

ilObjForumGUI::confirmMergeThreadsObject ( )

Definition at line 4802 of file class.ilObjForumGUI.php.

4803 {
4804 if(!$this->is_moderator)
4805 {
4806 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
4807 }
4808
4809 if(!isset($_GET['merge_thread_id']) || !(int)$_GET['merge_thread_id'] || !is_array($_POST['thread_ids']) || count($_POST['thread_ids']) != 1)
4810 {
4811 ilUtil::sendFailure($this->lng->txt('select_one'));
4812 $this->mergeThreadsObject();
4813 return;
4814 }
4815
4816 $source_thread_id = (int)$_GET['merge_thread_id'];
4817 $target_thread_id = (int)current($_POST['thread_ids']);
4818
4819 if($source_thread_id == $target_thread_id)
4820 {
4821 ilUtil::sendFailure($this->lng->txt('error_same_thread_ids'));
4822 $this->showThreadsObject();
4823 return;
4824 }
4825
4826 if(ilForumTopic::lookupForumIdByTopicId($source_thread_id) != ilForumTopic::lookupForumIdByTopicId($target_thread_id))
4827 {
4828 ilUtil::sendFailure($this->lng->txt('not_allowed_to_merge_into_another_forum'));
4829 $this->ctrl->clearParameters($this);
4830 $this->showThreadsObject();
4831 return;
4832 }
4833
4834 if(ilForumTopic::_lookupDate($source_thread_id) < ilForumTopic::_lookupDate($target_thread_id))
4835 {
4836 ilUtil::sendInfo($this->lng->txt('switch_threads_for_merge'));
4837 }
4838
4839 include_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
4840 $c_gui = new ilConfirmationGUI();
4841
4842 $c_gui->setFormAction($this->ctrl->getFormAction($this, 'performMergeThreads'));
4843 $c_gui->setHeaderText($this->lng->txt('frm_sure_merge_threads'));
4844 $c_gui->setCancel($this->lng->txt('cancel'), 'showThreads');
4845 $c_gui->setConfirm($this->lng->txt('confirm'), 'performMergeThreads');
4846
4847 $c_gui->addItem('thread_ids[]', $source_thread_id, sprintf($this->lng->txt('frm_merge_src'), ilForumTopic::_lookupTitle($source_thread_id)));
4848 $c_gui->addItem('thread_ids[]', $target_thread_id, sprintf($this->lng->txt('frm_merge_target'), ilForumTopic::_lookupTitle($target_thread_id)));
4849
4850 $this->tpl->setContent($c_gui->getHTML());
4851 return;
4852 }
Confirmation screen class.
static lookupForumIdByTopicId($a_topic_id)
static _lookupDate($thread_id)
static _lookupTitle($a_topic_id)
Looks up the title/subject of a topic/thread.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file)

References $_GET, $_POST, ilForumTopic\_lookupDate(), ilForumTopic\_lookupTitle(), ilForumTopic\lookupForumIdByTopicId(), mergeThreadsObject(), ilUtil\sendFailure(), ilUtil\sendInfo(), and showThreadsObject().

+ Here is the call graph for this function:

◆ createToLevelPostObject()

ilObjForumGUI::createToLevelPostObject ( )

Definition at line 1552 of file class.ilObjForumGUI.php.

1553 {
1554 $this->viewThreadObject();
1555 return;
1556 }

◆ displayConfirmPostActivation()

ilObjForumGUI::displayConfirmPostActivation ( )

Definition at line 1191 of file class.ilObjForumGUI.php.

1192 {
1194 }

References $display_confirm_post_activation.

◆ fetchTreeChildrenAsyncObject()

ilObjForumGUI::fetchTreeChildrenAsyncObject ( )

Definition at line 1948 of file class.ilObjForumGUI.php.

1949 {
1950 include_once 'Services/JSON/classes/class.ilJsonUtil.php';
1951 include_once 'Modules/Forum/classes/class.ilForumExplorer.php';
1952
1953 $response = new stdClass();
1954 $response->success = false;
1955
1956 if( $_GET['nodeId'] )
1957 {
1958 $response->success = true;
1959 $response->children = array();
1960
1961 $key = array_search((int)$_GET['nodeId'], (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
1962 if( false === $key )
1963 {
1964 $_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes'][] = (int)$_GET['nodeId'];
1965 }
1966
1967 $children = $this->objCurrentTopic->getNestedSetPostChildren(
1968 (int)$_GET['nodeId'],
1969 (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']
1970 );
1971
1972 $frm = new ilForum();
1973 $pageHits = $frm->getPageHits();
1974
1975 $fetchedNodes = array();
1976
1977 foreach( $children as $child )
1978 {
1979 if($child['parent_pos'] != (int)$_GET['nodeId'] &&
1980 !in_array($child['parent_pos'], $fetchedNodes))
1981 {
1982 continue;
1983 }
1984
1985 $fetchedNodes[] = $child['pos_pk'];
1986
1987 $this->ctrl->setParameter($this, 'thr_pk', (int)$_GET['thr_pk']);
1988
1990 $child,
1991 $this,
1992 $pageHits
1993 );
1994
1995 $responseChild = new stdClass();
1996 $responseChild->nodeId = $child['pos_pk'];
1997 $responseChild->parentId = $child['parent_pos'];
1998 $responseChild->hasChildren = ($child['children'] >= 1);
1999 $responseChild->fetchedWithChildren = in_array((int)$child['pos_pk'], (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
2000 $responseChild->html = $html;
2001
2002 $response->children[] = $responseChild;
2003 }
2004 }
2005
2006 echo ilJsonUtil::encode($response);
2007 exit();
2008 }
static getTreeNodeHtml($object, ilObjForumGUI $gui, $pageHits)
Returns the html used for a single forum tree node @access public.
Class Forum core functions for forum.
static encode($mixed, $suppress_native=false)
$html
Definition: example_001.php:87
exit
Definition: login.php:54

References $_GET, $_SESSION, $html, ilJsonUtil\encode(), exit, and ilForumExplorer\getTreeNodeHtml().

+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjForumGUI::getEditFormCustomValues ( Array &  $a_values)
protected

Definition at line 426 of file class.ilObjForumGUI.php.

427 {
428 $a_values["desc"] = $this->object->getLongDescription();
429 $a_values['default_view'] = $this->objProperties->getDefaultView();
430 $a_values['anonymized'] = $this->objProperties->isAnonymized();
431 $a_values['statistics_enabled'] = $this->objProperties->isStatisticEnabled();
432 $a_values['post_activation'] = $this->objProperties->isPostActivationEnabled();
433 $a_values['subject_setting'] = $this->objProperties->getSubjectSetting();
434 $a_values['mark_mod_posts'] = $this->objProperties->getMarkModeratorPosts();
435 $a_values['thread_sorting'] = $this->objProperties->getThreadSorting();
436 $a_values['thread_rating'] = $this->objProperties->isIsThreadRatingEnabled();
437
438 $default_view =
439 in_array((int)$this->objProperties->getDefaultView(), array(ilForumProperties::VIEW_DATE_ASC, ilForumProperties::VIEW_DATE_DESC))
442 $a_values['default_view'] = $default_view;
443
444 $default_view_sort_dir =
445 (int)$this->objProperties->getDefaultView() != (int)ilForumProperties::VIEW_TREE
446 ? (int)$this->objProperties->getDefaultView()
448
449 $a_values['default_view_sort_dir'] = $default_view_sort_dir;
450 $a_values['file_upload_allowed'] = (bool)$this->objProperties->getFileUploadAllowed();
451 }

References ilForumProperties\VIEW_DATE, ilForumProperties\VIEW_DATE_ASC, ilForumProperties\VIEW_DATE_DESC, and ilForumProperties\VIEW_TREE.

◆ getForumExplorer()

ilObjForumGUI::getForumExplorer ( )

Definition at line 1935 of file class.ilObjForumGUI.php.

1936 {
1937 include_once 'Modules/Forum/classes/class.ilForumExplorer.php';
1938
1939 $explorer = new ilForumExplorer(
1940 $this,
1941 $this->objCurrentTopic,
1942 $this->objProperties
1943 );
1944
1945 return $explorer->render()->getHtml();
1946 }
Class ilForumExplorer class for explorer view of forum posts.

◆ getForumObjects()

ilObjForumGUI::getForumObjects ( )
private

Definition at line 1917 of file class.ilObjForumGUI.php.

1918 {
1919 if(null === $this->forumObjects)
1920 {
1921 $forumObj = $this->object;
1922 $file_obj = new ilFileDataForum($forumObj->getId(), $this->objCurrentPost->getId());
1923 $frm = $forumObj->Forum;
1924 $frm->setForumId($forumObj->getId());
1925 $frm->setForumRefId($forumObj->getRefId());
1926
1927 $this->forumObjects['forumObj'] = $forumObj;
1928 $this->forumObjects['frm'] = $frm;
1929 $this->forumObjects['file_obj'] = $file_obj;
1930 }
1931
1932 return $this->forumObjects;
1933 }
This class handles all operations on files for the forum object.

References $forumObjects, and $object.

◆ getIcon()

ilObjForumGUI::getIcon (   $user_toggle_noti)

Definition at line 4106 of file class.ilObjForumGUI.php.

4107 {
4108 $icon = $user_toggle_noti
4109 ? "<img src=\"".ilUtil::getImagePath("icon_ok.svg")."\" alt=\"".$this->lng->txt("enabled")."\" title=\"".$this->lng->txt("enabled")."\" border=\"0\" vspace=\"0\"/>"
4110 : "<img src=\"".ilUtil::getImagePath("icon_not_ok.svg")."\" alt=\"".$this->lng->txt("disabled")."\" title=\"".$this->lng->txt("disabled")."\" border=\"0\" vspace=\"0\"/>";
4111 return $icon;
4112 }

Referenced by getUserNotificationTableData().

+ Here is the caller graph for this function:

◆ getModifiedReOnSubject()

ilObjForumGUI::getModifiedReOnSubject (   $on_reply = false)
private

Definition at line 3086 of file class.ilObjForumGUI.php.

3087 {
3088 $subject = $this->objCurrentPost->getSubject();
3089 $re_txt = $this->lng->txt('post_reply');
3090
3091 $re_txt_with_num = str_replace(':', '(',$re_txt);
3092 $search_length = strlen($re_txt_with_num);
3093 $comp = substr_compare($re_txt_with_num, substr($subject, 0 , $search_length), 0, $search_length);
3094
3095 if($comp == 0)
3096 {
3097 $modified_subject = $subject;
3098 if($on_reply == true)
3099 {
3100 // i.e. $subject = "Re(12):"
3101 $str_pos_start = strpos($subject, '(');
3102 $str_pos_end = strpos($subject, ')');
3103
3104 $length = ((int)$str_pos_end - (int)$str_pos_start);
3105 $str_pos_start++;
3106 $txt_number = substr($subject, $str_pos_start, $length - 1);
3107
3108 if(is_numeric($txt_number))
3109 {
3110 $re_count = (int)$txt_number + 1;
3111 $modified_subject = substr($subject, 0, $str_pos_start) . $re_count . substr($subject, $str_pos_end);
3112 }
3113 }
3114 }
3115 else
3116 {
3117 $re_count = substr_count($subject, $re_txt);
3118 if($re_count >= 1 && $on_reply == true)
3119 {
3120 $subject = str_replace($re_txt, '', $subject);
3121
3122 // i.e. $subject = "Re: Re: Re: ... " -> "Re(4):"
3123 $re_count++;
3124 $modified_subject = sprintf($this->lng->txt('post_reply_count'), $re_count).' '.trim($subject);
3125 }
3126 else if($re_count >= 1 && $on_reply == false)
3127 {
3128 // possibility to modify the subject only for output
3129 // i.e. $subject = "Re: Re: Re: ... " -> "Re(3):"
3130 $modified_subject = sprintf($this->lng->txt('post_reply_count'), $re_count).' '.trim($subject);
3131 }
3132 else if($re_count == 0)
3133 {
3134 // the first reply to a thread
3135 $modified_subject = $this->lng->txt('post_reply').' '. $this->objCurrentPost->getSubject();
3136 }
3137 }
3138 return $modified_subject;
3139 }

◆ getReplyEditForm()

ilObjForumGUI::getReplyEditForm ( )
private
Returns
ilPropertyFormGUI

Definition at line 1539 of file class.ilObjForumGUI.php.

1540 {
1541 if(null === $this->replyEditForm)
1542 {
1543 $this->initReplyEditForm();
1544 }
1545
1546 return $this->replyEditForm;
1547 }

References $replyEditForm.

Referenced by quotePostObject().

+ Here is the caller graph for this function:

◆ getSubTabs()

ilObjForumGUI::getSubTabs (   $subtab = 'showThreads')

Definition at line 614 of file class.ilObjForumGUI.php.

615 {
616 global $ilTabs;
617
618 if($this->objProperties->getThreadSorting() == 1 && $this->is_moderator)
619 {
620 $ilTabs->addSubTabTarget('show', $this->ctrl->getLinkTarget($this, 'showThreads'), 'showThreads', get_class($this), '', $subtab=='showThreads'? true : false );
621 $ilTabs->addSubTabTarget('sorting_header', $this->ctrl->getLinkTarget($this, 'sortThreads'), 'sortThreads', get_class($this), '', $subtab=='sortThreads'? true : false );
622 }
623 }

Referenced by showThreadsObject(), and sortThreadsObject().

+ Here is the caller graph for this function:

◆ getThreadEditingForm()

ilObjForumGUI::getThreadEditingForm (   $a_thread_id)
private
Parameters
int$a_thread_id
Returns
ilPropertyFormGUI

Definition at line 502 of file class.ilObjForumGUI.php.

503 {
504 $form = new ilPropertyFormGUI();
505 $this->ctrl->setParameter($this, 'thr_pk', $a_thread_id);
506 $form->setFormAction($this->ctrl->getFormAction($this, 'updateThread'));
507
508 $ti_prop = new ilTextInputGUI($this->lng->txt('title'), 'title');
509 $ti_prop->setRequired(true);
510 $ti_prop->setMaxLength(255);
511 $ti_prop->setSize(50);
512 $form->addItem($ti_prop);
513
514 $form->addCommandButton('updateThread', $this->lng->txt('save'));
515 $form->addCommandButton('showThreads', $this->lng->txt('cancel'));
516
517 return $form;
518 }
This class represents a property form user interface.
This class represents a text property in a property form.

Referenced by updateThreadObject().

+ Here is the caller graph for this function:

◆ getUserNotificationTableData()

ilObjForumGUI::getUserNotificationTableData (   $user_ids,
ilForumNotification  $frm_noti 
)
private

Definition at line 4181 of file class.ilObjForumGUI.php.

4182 {
4183 $counter = 0;
4184 $users = array();
4185 foreach($user_ids as $user_id)
4186 {
4187 $frm_noti->setUserId($user_id);
4188 $user_toggle_noti = $frm_noti->isUserToggleNotification();
4189 $icon_ok = $this->getIcon(!$user_toggle_noti);
4190
4191 $users[$counter]['user_id'] = ilUtil::formCheckbox(0, 'user_id[]', $user_id);
4192 $users[$counter]['login'] = ilObjUser::_lookupLogin($user_id);
4193 $name = ilObjUser::_lookupName($user_id);
4194 $users[$counter]['firstname'] = $name['firstname'];
4195 $users[$counter]['lastname'] = $name['lastname'];
4196 $users[$counter]['user_toggle_noti'] = $icon_ok;
4197 $counter++;
4198 }
4199 return $users;
4200 }
getIcon($user_toggle_noti)
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name

References ilObjUser\_lookupLogin(), ilObjUser\_lookupName(), ilUtil\formCheckbox(), getIcon(), ilForumNotification\isUserToggleNotification(), and ilForumNotification\setUserId().

+ Here is the call graph for this function:

◆ handleFormInput()

ilObjForumGUI::handleFormInput (   $a_text,
  $a_stripslashes = true 
)

Definition at line 3928 of file class.ilObjForumGUI.php.

3929 {
3930 $a_text = str_replace("<", "&lt;", $a_text);
3931 $a_text = str_replace(">", "&gt;", $a_text);
3932 if($a_stripslashes)
3933 $a_text = ilUtil::stripSlashes($a_text);
3934
3935 return $a_text;
3936 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ hideToolbar()

ilObjForumGUI::hideToolbar (   $a_flag = null)
private

Definition at line 1858 of file class.ilObjForumGUI.php.

1859 {
1860 if(null === $a_flag)
1861 {
1862 return $this->hideToolbar;
1863 }
1864
1865 $this->hideToolbar = $a_flag;
1866 return $this;
1867 }
hideToolbar($a_flag=null)

References $hideToolbar, and hideToolbar().

Referenced by hideToolbar().

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

◆ infoScreenObject()

ilObjForumGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 3951 of file class.ilObjForumGUI.php.

3952 {
3953 $this->ctrl->setCmd('showSummary');
3954 $this->ctrl->setCmdClass('ilinfoscreengui');
3955 $this->infoScreen();
3956 }

◆ initForumCreateForm()

ilObjForumGUI::initForumCreateForm (   $object_type)
private
Parameters
string$object_type

Definition at line 704 of file class.ilObjForumGUI.php.

705 {
706 $this->create_form_gui = new ilPropertyFormGUI();
707 $this->create_form_gui->setTableWidth('600px');
708
709 $this->create_form_gui->setTitle($this->lng->txt('frm_new'));
710 $this->create_form_gui->setTitleIcon(ilUtil::getImagePath('icon_frm.svg'));
711
712 // form action
713 $this->ctrl->setParameter($this, 'new_type', $object_type);
714 $this->create_form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
715
716 // title
717 $title_gui = new ilTextInputGUI($this->lng->txt('title'), 'title');
718 $title_gui->setSize(min(40, ilObject::TITLE_LENGTH));
719 $title_gui->setMaxLength(ilObject::TITLE_LENGTH);
720 $this->create_form_gui->addItem($title_gui);
721
722 // description
723 $description_gui = new ilTextAreaInputGUI($this->lng->txt('desc'), 'desc');
724 $description_gui->setCols(40);
725 $description_gui->setRows(2);
726 $this->create_form_gui->addItem($description_gui);
727
728 // view sorting threads
729 $sorting_threads_gui = new ilRadioGroupInputGUI($this->lng->txt('frm_sorting_threads'), 'thread_sorting');
730 $sort_dat = new ilRadioOption($this->lng->txt('order_by').' '.$this->lng->txt('date'), 0);
731 $sorting_threads_gui->addOption($sort_dat);
732
733 $sort_man = new ilRadioOption($this->lng->txt('sorting_manual_sticky'), 1);
734 $sorting_threads_gui->addOption($sort_man);
735 $sorting_threads_gui->setInfo($this->lng->txt('sticky_threads_always_on_top'));
736 $this->create_form_gui->addItem($sorting_threads_gui);
737
738 // view
739 $view_group_gui = new ilRadioGroupInputGUI($this->lng->txt('frm_default_view'), 'sort');
740 $view_hir = new ilRadioOption($this->lng->txt('order_by').' '.$this->lng->txt('answers'), ilForumProperties::VIEW_TREE);
741 $view_group_gui->addOption($view_hir);
742 $view_dat = new ilRadioOption($this->lng->txt('order_by').' '.$this->lng->txt('date'), ilForumProperties::VIEW_DATE);
743 $view_group_gui->addOption($view_dat);
744 $this->create_form_gui->addItem($view_group_gui);
745 $view_direction_group_gui = new ilRadioGroupInputGUI('', 'default_view_sort_dir');
746 $view_desc = new ilRadioOption($this->lng->txt('frm_post_sort_desc'), ilForumProperties::VIEW_DATE_DESC);
747 $view_direction_group_gui->addOption($view_desc);
748 $view_asc = new ilRadioOption($this->lng->txt('frm_post_sort_asc'), ilForumProperties::VIEW_DATE_ASC);
749 $view_direction_group_gui->addOption($view_asc);
750 $view_dat->addSubItem($view_direction_group_gui);
751
752 // anonymized or not
753 $anonymize_gui = new ilCheckboxInputGUI($this->lng->txt('frm_anonymous_posting'), 'anonymized');
754 $anonymize_gui->setInfo($this->lng->txt('frm_anonymous_posting_desc'));
755 $anonymize_gui->setValue(1);
756
757 if($this->ilias->getSetting('enable_anonymous_fora', false))
758 $anonymize_gui->setDisabled(true);
759 $this->create_form_gui->addItem($anonymize_gui);
760
761 // statistics enabled or not
762 $statistics_gui = new ilCheckboxInputGUI($this->lng->txt('frm_statistics_enabled'), 'statistics_enabled');
763 $statistics_gui->setInfo($this->lng->txt('frm_statistics_enabled_desc'));
764 $statistics_gui->setValue(1);
765 if(!$this->ilias->getSetting('enable_fora_statistics', false))
766 $statistics_gui->setDisabled(true);
767 $this->create_form_gui->addItem($statistics_gui);
768
769 $cb_prop = new ilCheckboxInputGUI($this->lng->txt('activate_new_posts'), 'post_activation');
770 $cb_prop->setValue('1');
771 $cb_prop->setInfo($this->lng->txt('post_activation_desc'));
772 $this->create_form_gui->addItem($cb_prop);
773
774 $this->create_form_gui->addCommandButton('save', $this->lng->txt('save'));
775 $this->create_form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
776 }
This class represents a checkbox property in a property form.
const TITLE_LENGTH
max length of object title
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a text area property in a property form.

References ilUtil\getImagePath(), ilObject\TITLE_LENGTH, ilForumProperties\VIEW_DATE, ilForumProperties\VIEW_DATE_ASC, ilForumProperties\VIEW_DATE_DESC, and ilForumProperties\VIEW_TREE.

+ Here is the call graph for this function:

◆ initNotificationSettingsForm()

ilObjForumGUI::initNotificationSettingsForm ( )
private

Definition at line 4071 of file class.ilObjForumGUI.php.

4072 {
4073 if(null === $this->notificationSettingsForm)
4074 {
4075 $form = new ilPropertyFormGUI();
4076 $form->setFormAction($this->ctrl->getFormAction($this, 'updateNotificationSettings'));
4077 $form->setTitle($this->lng->txt('forums_notification_settings'));
4078
4079 $radio_grp = new ilRadioGroupInputGUI('','notification_type');
4080 $radio_grp->setValue('default');
4081
4082 $opt_default = new ilRadioOption($this->lng->txt("user_decides_notification"), 'default');
4083 $opt_0 = new ilRadioOption($this->lng->txt("settings_for_all_members"), 'all_users');
4084 $opt_1 = new ilRadioOption($this->lng->txt("settings_per_users"), 'per_user');
4085
4086 $radio_grp->addOption($opt_default, 'default');
4087 $radio_grp->addOption($opt_0, 'all_users');
4088 $radio_grp->addOption($opt_1, 'per_user');
4089
4090 $chb_2 = new ilCheckboxInputGUI($this->lng->txt('user_toggle_noti'), 'usr_toggle');
4091 $chb_2->setValue(1);
4092
4093 $opt_0->addSubItem($chb_2);
4094 $form->addItem($radio_grp);
4095
4096 $form->addCommandButton('updateNotificationSettings', $this->lng->txt('save'));
4097
4098 $this->notificationSettingsForm = $form;
4099
4100 return false;
4101 }
4102
4103 return true;
4104 }

◆ initSessionStorage()

ilObjForumGUI::initSessionStorage ( )
protected

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

141 {
142 $sess = ilSession::get('frm');
143 if(!is_array($sess))
144 {
145 $sess = array();
146 ilSession::set('frm', $sess);
147 }
148
149 if(isset($_GET['thr_fk']) && !is_array($sess[(int)$_GET['thr_fk']]))
150 {
151 $sess[(int)$_GET['thr_fk']] = array();
152 ilSession::set('frm', $sess);
153 }
154 }
static set($a_var, $a_val)
Set a value.
static get($a_var)
Get a value.

References $_GET, $sess, ilSession\get(), and ilSession\set().

+ Here is the call graph for this function:

◆ isHierarchicalView()

ilObjForumGUI::isHierarchicalView ( )
private
Returns
bool

Definition at line 159 of file class.ilObjForumGUI.php.

160 {
161 return (
162 $_SESSION['viewmode'] == 'answers' ||
164 ) || !(
165 $_SESSION['viewmode'] == 'date' ||
167 );
168 }

References $_SESSION, ilForumProperties\VIEW_DATE, and ilForumProperties\VIEW_TREE.

◆ isParentObjectCrsOrGrp()

ilObjForumGUI::isParentObjectCrsOrGrp ( )
private

Definition at line 4623 of file class.ilObjForumGUI.php.

4624 {
4625 global $tree;
4626
4627 // check if there a parent-node is a grp or crs
4628 $grp_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
4629 $crs_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
4630
4631 if($grp_ref_id == 0 && $crs_ref_id == 0)
4632 {
4633 return false;
4634 }
4635 return true;
4636 }

References ilObjectGUI\$tree.

Referenced by isUserAllowedToDeactivateNotification().

+ Here is the caller graph for this function:

◆ isTopLevelReplyCommand()

ilObjForumGUI::isTopLevelReplyCommand ( )
private
Returns
bool

Definition at line 173 of file class.ilObjForumGUI.php.

174 {
175 return in_array(
176 strtolower($this->ctrl->getCmd()),
177 array_map('strtolower', array('createToLevelPost', 'quoteTopLevelPost', 'saveTopLevelPost'))
178 );
179 }

◆ isUserAllowedToDeactivateNotification()

ilObjForumGUI::isUserAllowedToDeactivateNotification ( )

Definition at line 4592 of file class.ilObjForumGUI.php.

4593 {
4594 if($this->objProperties->getNotificationType() == 'default')
4595 {
4596 return true;
4597 }
4598
4599 if($this->objProperties->isUserToggleNoti() == 0)
4600 {
4601 return true;
4602 }
4603
4604 if($this->isParentObjectCrsOrGrp());
4605 {
4606 global $ilUser;
4607
4608 include_once 'Modules/Forum/classes/class.ilForumNotification.php';
4609
4610 $frm_noti = new ilForumNotification((int) $_GET['ref_id']);
4611 $frm_noti->setUserId($ilUser->getId());
4612
4613 $user_toggle = (int)$frm_noti->isUserToggleNotification();
4614 if($user_toggle == 0)
4615 {
4616 return true;
4617 }
4618 }
4619
4620 return false;
4621 }
Class ilForumNotification.
global $ilUser
Definition: imgupload.php:15

References $_GET, $ilUser, and isParentObjectCrsOrGrp().

+ Here is the call graph for this function:

◆ mergeThreadsObject()

ilObjForumGUI::mergeThreadsObject ( )

Definition at line 4737 of file class.ilObjForumGUI.php.

4738 {
4739 if(!$this->is_moderator)
4740 {
4741 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
4742 }
4743
4744 $selected_thread_id = 0;
4745 if(isset($_GET['merge_thread_id']) && (int)$_GET['merge_thread_id'])
4746 {
4747 $selected_thread_id = (int)$_GET['merge_thread_id'];
4748 }
4749 else if(isset($_POST['thread_ids']) && count((array)$_POST['thread_ids']) == 1)
4750 {
4751 $selected_thread_id = (int)current($_POST['thread_ids']);
4752 }
4753 else
4754 {
4755 ilUtil::sendInfo($this->lng->txt('select_one'));
4756 $this->showThreadsObject();
4757 return;
4758 }
4759
4760 if($selected_thread_id)
4761 {
4762 $frm = $this->object->Forum;
4763 $frm->setForumId($this->object->getId());
4764 $frm->setForumRefId($this->object->getRefId());
4765
4766 $selected_thread_obj = new ilForumTopic($selected_thread_id);
4767
4768 if(ilForum::_lookupObjIdForForumId($selected_thread_obj->getForumId()) != $frm->getForumId())
4769 {
4770 ilUtil::sendFailure($this->lng->txt('not_allowed_to_merge_into_another_forum'));
4771 $this->showThreadsObject();
4772 return;
4773 }
4774
4775 $frm->setMDB2Wherecondition('top_frm_fk = %s ', array('integer'), array($frm->getForumId()));
4776
4777 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.forums_threads_liste.html', 'Modules/Forum');
4778
4779 $topicData = $frm->getOneTopic();
4780 if($topicData)
4781 {
4782 include_once 'Modules/Forum/classes/class.ilForumTopicTableGUI.php';
4783 $this->ctrl->setParameter($this, 'merge_thread_id', $selected_thread_id);
4784 $tbl = new ilForumTopicTableGUI($this, 'mergeThreads', '', (int)$_GET['ref_id'], $topicData, $this->is_moderator, $this->forum_overview_setting);
4785 $tbl->setSelectedThread($selected_thread_obj);
4786 $tbl->setMapper($frm)->fetchData();
4787 $tbl->populate();
4788 $this->tpl->setVariable('THREADS_TABLE', $tbl->getHTML());
4789 }
4790 else
4791 {
4792 ilUtil::sendFailure($this->lng->txt('select_one'));
4793 $this->showThreadsObject();
4794 return;
4795 }
4796 }
4797 }
Class ilForumTopicTableGUI.
static _lookupObjIdForForumId($a_for_id)
$tbl
Definition: example_048.php:81

References $_GET, $_POST, $tbl, ilForum\_lookupObjIdForForumId(), ilUtil\sendFailure(), ilUtil\sendInfo(), and showThreadsObject().

Referenced by confirmMergeThreadsObject().

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

◆ performPostActivationObject()

ilObjForumGUI::performPostActivationObject ( )

Definition at line 1157 of file class.ilObjForumGUI.php.

1158 {
1159 if($this->is_moderator)
1160 {
1161 $this->objCurrentPost->activatePost();
1162 $GLOBALS['ilAppEventHandler']->raise(
1163 'Modules/Forum',
1164 'activatedPost',
1165 array(
1166 'ref_id' => $this->object->getRefId(),
1167 'post' => $this->objCurrentPost
1168 )
1169 );
1170 ilUtil::sendInfo($this->lng->txt('forums_post_was_activated'), true);
1171 }
1172
1173 $this->viewThreadObject();
1174 }
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

References $GLOBALS, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ prepareFormOutput()

ilObjForumGUI::prepareFormOutput (   $a_text)

Definition at line 3938 of file class.ilObjForumGUI.php.

3939 {
3940 $a_text = str_replace("&lt;", "<", $a_text);
3941 $a_text = str_replace("&gt;", ">", $a_text);
3942 $a_text = ilUtil::prepareFormOutput($a_text);
3943 return $a_text;
3944 }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public

References ilUtil\prepareFormOutput().

+ Here is the call graph for this function:

◆ quotePostObject()

ilObjForumGUI::quotePostObject ( )

Definition at line 1869 of file class.ilObjForumGUI.php.

1870 {
1871 if(!is_array($_POST['del_file'])) $_POST['del_file'] = array();
1872
1873 if($this->objCurrentTopic->isClosed())
1874 {
1875 $_GET['action'] = '';
1876 return $this->viewThreadObject();
1877 }
1878
1879 $oReplyEditForm = $this->getReplyEditForm();
1880
1881 // remove mandatory fields
1882 $oReplyEditForm->getItemByPostVar('subject')->setRequired(false);
1883 $oReplyEditForm->getItemByPostVar('message')->setRequired(false);
1884
1885 $oReplyEditForm->checkInput();
1886
1887 // add mandatory fields
1888 $oReplyEditForm->getItemByPostVar('subject')->setRequired(true);
1889 $oReplyEditForm->getItemByPostVar('message')->setRequired(true);
1890
1891 $_GET['action'] = 'showreply';
1892
1893 $this->viewThreadObject();
1894 }

References $_GET, $_POST, and getReplyEditForm().

Referenced by quoteTopLevelPostObject().

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

◆ quoteTopLevelPostObject()

ilObjForumGUI::quoteTopLevelPostObject ( )

Definition at line 1570 of file class.ilObjForumGUI.php.

1571 {
1572 $this->quotePostObject();
1573 return;
1574 }

References quotePostObject().

+ Here is the call graph for this function:

◆ removeFromDeskObject()

ilObjForumGUI::removeFromDeskObject ( )
See also
ilDesktopItemHandling::removeFromDesk()

Implements ilDesktopItemHandling.

Definition at line 4703 of file class.ilObjForumGUI.php.

4704 {
4705 global $ilSetting, $lng;
4706
4707 if((int)$ilSetting->get('disable_my_offers'))
4708 {
4709 $this->showThreadsObject();
4710 return;
4711 }
4712
4713 include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
4715 ilUtil::sendSuccess($lng->txt("removed_from_desktop"));
4716 $this->showThreadsObject();
4717 }
static removeFromDesktop()
Remove item from personal desktop @access public.
global $ilSetting
Definition: privfeed.php:40

References $ilSetting, ilObjectGUI\$lng, ilDesktopItemGUI\removeFromDesktop(), ilUtil\sendSuccess(), and showThreadsObject().

+ Here is the call graph for this function:

◆ saveThreadSortingObject()

ilObjForumGUI::saveThreadSortingObject ( )

Definition at line 4719 of file class.ilObjForumGUI.php.

4720 {
4721 $_POST['thread_sorting'] ? $thread_sorting = $_POST['thread_sorting'] :$thread_sorting = array();
4722
4723 foreach($thread_sorting as $thr_pk=>$sorting_value)
4724 {
4725 $sorting_value = str_replace(',','.',$sorting_value);
4726 $sorting_value = (float)$sorting_value * 100;
4727 $this->object->setThreadSorting($thr_pk,$sorting_value);
4728 }
4729 ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
4730 $this->showThreadsObject();
4731 return true;
4732 }

References $_POST, ilUtil\sendSuccess(), and showThreadsObject().

+ Here is the call graph for this function:

◆ saveTopLevelPostObject()

ilObjForumGUI::saveTopLevelPostObject ( )

Definition at line 1561 of file class.ilObjForumGUI.php.

1562 {
1563 $this->savePostObject();
1564 return;
1565 }

◆ setDisplayConfirmPostActivation()

ilObjForumGUI::setDisplayConfirmPostActivation (   $status = 0)

Definition at line 1186 of file class.ilObjForumGUI.php.

1187 {
1188 $this->display_confirm_post_activation = $status;
1189 }

Referenced by askForPostActivationObject().

+ Here is the caller graph for this function:

◆ setSideBlocks()

ilObjForumGUI::setSideBlocks ( )
protected

{}

Definition at line 4906 of file class.ilObjForumGUI.php.

4907 {
4908 $rgt_content = '';
4909 if(!$GLOBALS['ilCtrl']->isAsynch())
4910 {
4911 require_once 'Services/Search/classes/class.ilRepositoryObjectSearchGUI.php';
4912 $rgt_content = ilRepositoryObjectSearchGUI::getSearchBlockHTML($this->lng->txt('frm_search'));
4913 }
4914 $this->tpl->setRightContent($rgt_content . $this->getRightColumnHTML());
4915 }
getRightColumnHTML()
Display right column.
static getSearchBlockHTML($a_title)
Get standar search block html.

References $GLOBALS, ilObjectGUI\getRightColumnHTML(), and ilRepositoryObjectSearchGUI\getSearchBlockHTML().

Referenced by showThreadsObject(), and sortThreadsObject().

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

◆ setTopicCreateDefaultValues()

ilObjForumGUI::setTopicCreateDefaultValues ( )
private

Definition at line 3612 of file class.ilObjForumGUI.php.

3613 {
3614 $this->create_topic_form_gui->setValuesByArray(array(
3615 'subject' => '',
3616 'message' => '',
3617 'userfile' => '',
3618 'notify' => 0,
3619 'notify_posts' => 0
3620 ));
3621 }

◆ setTreeStateAsynchObject()

ilObjForumGUI::setTreeStateAsynchObject ( )

Definition at line 2010 of file class.ilObjForumGUI.php.

2011 {
2012 include_once 'Services/JSON/classes/class.ilJsonUtil.php';
2013
2014 $response = new stdClass();
2015 $response->success = true;
2016
2017 if( $_GET['nodeId'] )
2018 {
2019 if( $_GET['nodeId'] > 0 )
2020 {
2021 $key = array_search((int)$_GET['nodeId'], (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
2022 if( false === $key )
2023 {
2024 $_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes'][] = (int)$_GET['nodeId'];
2025 }
2026 }
2027 else
2028 {
2029 $key = array_search((int)abs($_GET['nodeId']), (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
2030 if( false !== $key )
2031 {
2032 unset($_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes'][$key]);
2033 }
2034 }
2035 }
2036
2037 // Guarantee continuous keys
2038 shuffle($_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
2039 exit();
2040 }

References $_GET, $_SESSION, and exit.

◆ showThreadsObject()

ilObjForumGUI::showThreadsObject ( )

Definition at line 600 of file class.ilObjForumGUI.php.

601 {
602 $this->getSubTabs('showThreads');
603 $this->setSideBlocks();
604 $this->getCenterColumnHTML();
605 }
getSubTabs($subtab='showThreads')
getCenterColumnHTML()
Get center column.

References ilObjectGUI\getCenterColumnHTML(), getSubTabs(), and setSideBlocks().

Referenced by cancelMergeThreads(), confirmMergeThreadsObject(), mergeThreadsObject(), removeFromDeskObject(), saveThreadSortingObject(), and updateThreadObject().

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

◆ sortThreadsObject()

ilObjForumGUI::sortThreadsObject ( )

Definition at line 606 of file class.ilObjForumGUI.php.

607 {
608 $this->getSubTabs('sortThreads');
609 $this->setSideBlocks();
610 $this->getCenterColumnHTML(true);
611 }

References ilObjectGUI\getCenterColumnHTML(), getSubTabs(), and setSideBlocks().

+ Here is the call graph for this function:

◆ toggleStickinessObject()

ilObjForumGUI::toggleStickinessObject ( )

Definition at line 1217 of file class.ilObjForumGUI.php.

1218 {
1219 if($this->is_moderator)
1220 {
1221 if($this->objCurrentTopic->isSticky())
1222 {
1223 $this->objCurrentTopic->unmakeSticky();
1224 }
1225 else
1226 {
1227 $this->objCurrentTopic->makeSticky();
1228 }
1229 }
1230
1231 $this->viewThreadObject();
1232 }

◆ updateThreadObject()

ilObjForumGUI::updateThreadObject ( )

Definition at line 552 of file class.ilObjForumGUI.php.

553 {
554 if(!$this->is_moderator)
555 {
556 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
557 }
558
559 if(!$this->objCurrentTopic->getId())
560 {
561 $this->showThreadsObject();
562 return;
563 }
564
565 $forum_id = ilObjForum::lookupForumIdByObjId($this->object->getId());
566 if($this->objCurrentTopic->getForumId() != $forum_id)
567 {
568 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
569 }
570
571 $form = $this->getThreadEditingForm($this->objCurrentTopic->getId());
572 if(!$form->checkInput())
573 {
574 $form->setValuesByPost();
575 $this->editThreadObject($this->objCurrentTopic->getId(), $form);
576 return;
577 }
578
579 $this->objCurrentTopic->setSubject($form->getInput('title'));
580 $this->objCurrentTopic->updateThreadTitle();
581
582 ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
583 $this->showThreadsObject();
584 }
getThreadEditingForm($a_thread_id)
static lookupForumIdByObjId($obj_id)

References getThreadEditingForm(), ilObjForum\lookupForumIdByObjId(), ilUtil\sendSuccess(), and showThreadsObject().

+ Here is the call graph for this function:

◆ updateUserNotifications()

ilObjForumGUI::updateUserNotifications (   $update_all_users = false)
private

Definition at line 4035 of file class.ilObjForumGUI.php.

4036 {
4037 include_once 'Modules/Forum/classes/class.ilForumNotification.php';
4038
4039 $oParticipants = $this->getParticipantsObject();
4040
4041 $frm_noti = new ilForumNotification($this->object->getRefId());
4042 $moderator_ids = $frm_noti->_getModerators($this->object->getRefId());
4043
4044 $admin_ids = $oParticipants->getAdmins();
4045 $member_ids = $oParticipants->getMembers();
4046 $tutor_ids = $oParticipants->getTutors();
4047
4048 $all_forum_users = array_merge($moderator_ids, $admin_ids, $member_ids, $tutor_ids);
4049 $all_forum_users= array_unique($all_forum_users);
4050
4051 $all_notis = $frm_noti->read();
4052
4053 foreach($all_forum_users as $user_id)
4054 {
4055 $frm_noti->setUserId($user_id);
4056
4057 $frm_noti->setAdminForce(1);
4058 $frm_noti->setUserToggle($this->objProperties->isUserToggleNoti());
4059
4060 if(array_key_exists($user_id, $all_notis) && $update_all_users)
4061 {
4062 $frm_noti->update();
4063 }
4064 else if($frm_noti->existsNotification() == false)
4065 {
4066 $frm_noti->insertAdminForce();
4067 }
4068 }
4069 }

Field Documentation

◆ $confirmation_gui_html

ilObjForumGUI::$confirmation_gui_html = ''
private

Definition at line 103 of file class.ilObjForumGUI.php.

◆ $create_form_gui

ilObjForumGUI::$create_form_gui
private

Definition at line 58 of file class.ilObjForumGUI.php.

◆ $create_topic_form_gui

ilObjForumGUI::$create_topic_form_gui
private

Definition at line 63 of file class.ilObjForumGUI.php.

◆ $display_confirm_post_activation

ilObjForumGUI::$display_confirm_post_activation = 0
private

Definition at line 48 of file class.ilObjForumGUI.php.

Referenced by displayConfirmPostActivation().

◆ $forum_overview_setting

ilObjForumGUI::$forum_overview_setting = null
private

Definition at line 83 of file class.ilObjForumGUI.php.

◆ $forumObjects

ilObjForumGUI::$forumObjects
private

Definition at line 98 of file class.ilObjForumGUI.php.

Referenced by getForumObjects().

◆ $hideToolbar

ilObjForumGUI::$hideToolbar = false
private

Definition at line 78 of file class.ilObjForumGUI.php.

Referenced by hideToolbar().

◆ $ilias

ilObjForumGUI::$ilias

Definition at line 93 of file class.ilObjForumGUI.php.

◆ $is_moderator

ilObjForumGUI::$is_moderator = false
private

Definition at line 53 of file class.ilObjForumGUI.php.

◆ $notificationSettingsForm

ilObjForumGUI::$notificationSettingsForm
private

Definition at line 73 of file class.ilObjForumGUI.php.

◆ $objCurrentPost

ilObjForumGUI::$objCurrentPost
private

Definition at line 43 of file class.ilObjForumGUI.php.

◆ $objCurrentTopic

ilObjForumGUI::$objCurrentTopic
private

Definition at line 38 of file class.ilObjForumGUI.php.

◆ $object

ilObjForumGUI::$object

Definition at line 88 of file class.ilObjForumGUI.php.

Referenced by getForumObjects().

◆ $objProperties

ilObjForumGUI::$objProperties

Definition at line 33 of file class.ilObjForumGUI.php.

◆ $replyEditForm

ilObjForumGUI::$replyEditForm
private

Definition at line 68 of file class.ilObjForumGUI.php.

Referenced by getReplyEditForm().


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