ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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 ()
 
 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...
 
 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)
 
- 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)
 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

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

Detailed Description

Member Function Documentation

◆ afterSave()

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

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

731 {
732 ilUtil::sendSuccess($this->lng->txt('frm_added'), true);
733 $this->ctrl->setParameter($this, 'ref_id', $forumObj->getRefId());
734 ilUtil::redirect($this->ctrl->getLinkTarget($this, 'createThread', '', false, false));
735 }
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 1114 of file class.ilObjForumGUI.php.

1115 {
1116 if($this->is_moderator)
1117 {
1119 }
1120
1121 $this->viewThreadObject();
1122 }
setDisplayConfirmPostActivation($status=0)

References setDisplayConfirmPostActivation().

+ Here is the call graph for this function:

◆ cancelMergeThreads()

ilObjForumGUI::cancelMergeThreads ( )

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

4641 {
4642 $this->showThreadsObject();
4643 }

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 721 of file class.ilObjForumGUI.php.

722 {
723 ilUtil::sendInfo($this->lng->txt('msg_cancel'), true);
724 ilUtil::redirect('ilias.php?baseClass=ilRepositoryGUI&cmd=frameset&ref_id='.$_GET['ref_id']);
725 }
$_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 1172 of file class.ilObjForumGUI.php.

1173 {
1174 $_GET['action'] = '';
1175
1176 $this->viewThreadObject();
1177 }

References $_GET.

◆ checkEnableColumnEdit()

ilObjForumGUI::checkEnableColumnEdit ( )

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

3574 {
3575 return false;
3576 }

◆ cloneWizardPageObject()

ilObjForumGUI::cloneWizardPageObject ( )

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

3604 {
3605 global $ilObjDataCache;
3606
3607 if (!$_POST['clone_source'])
3608 {
3609 ilUtil::sendInfo($this->lng->txt('select_one'));
3610 if (isset($_SESSION['wizard_search_title']))
3611 {
3612 $this->searchCloneSourceObject();
3613 }
3614 else
3615 {
3616 $this->createObject();
3617 }
3618 return false;
3619 }
3620 $source_id = $_POST['clone_source'];
3621
3622 $new_type = $_REQUEST['new_type'];
3623 $this->ctrl->setParameter($this, 'clone_source', (int) $_POST['clone_source']);
3624 $this->ctrl->setParameter($this, 'new_type', $new_type);
3625
3626 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.frm_wizard_page.html', 'Modules/Forum');
3627 $this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
3628 $this->tpl->setVariable('TYPE_IMG', ilUtil::getImagePath('icon_'.$new_type.'.svg'));
3629 $this->tpl->setVariable('ALT_IMG', $this->lng->txt('obj_'.$new_type));
3630 $this->tpl->setVariable('TXT_DUPLICATE', $this->lng->txt('frm_wizard_page'));
3631 $this->tpl->setVariable('INFO_THREADS', $this->lng->txt('fmr_copy_threads_info'));
3632 $this->tpl->setVariable('THREADS', $this->lng->txt('forums_threads'));
3633
3634 $forum_id = $ilObjDataCache->lookupObjId((int) $_POST['clone_source']);
3635 include_once('Modules/Forum/classes/class.ilForum.php');
3636 $threads = ilForum::_getThreads($forum_id, ilForum::SORT_TITLE);
3637 foreach ($threads as $thread_id => $title)
3638 {
3639 $this->tpl->setCurrentBlock('thread_row');
3640 $this->tpl->setVariable('CHECK_THREAD', ilUtil::formCheckbox(0, 'cp_options['.$source_id.'][threads][]', $thread_id));
3641 $this->tpl->setVariable('NAME_THREAD', $title);
3642 $this->tpl->parseCurrentBlock();
3643 }
3644 $this->tpl->setVariable('SELECT_ALL', $this->lng->txt('select_all'));
3645 $this->tpl->setVariable('JS_FIELD', 'cp_options['.$source_id.'][threads]');
3646 $this->tpl->setVariable('BTN_COPY', $this->lng->txt('obj_'.$new_type.'_duplicate'));
3647 if (isset($_SESSION['wizard_search_title']))
3648 {
3649 $this->tpl->setVariable('BACK_CMD', 'searchCloneSource');
3650 }
3651 else
3652 {
3653 $this->tpl->setVariable('BACK_CMD', 'create');
3654 }
3655 $this->tpl->setVariable('BTN_BACK', $this->lng->txt('btn_back'));
3656 }
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
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
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 4544 of file class.ilObjForumGUI.php.

4545 {
4546 if(!$this->is_moderator)
4547 {
4548 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
4549 }
4550
4551 if(!isset($_GET['merge_thread_id']) || !(int)$_GET['merge_thread_id'] || !is_array($_POST['thread_ids']) || count($_POST['thread_ids']) != 1)
4552 {
4553 ilUtil::sendFailure($this->lng->txt('select_one'));
4554 $this->mergeThreadsObject();
4555 return;
4556 }
4557
4558 $source_thread_id = (int)$_GET['merge_thread_id'];
4559 $target_thread_id = (int)current($_POST['thread_ids']);
4560
4561 if($source_thread_id == $target_thread_id)
4562 {
4563 ilUtil::sendFailure($this->lng->txt('error_same_thread_ids'));
4564 $this->showThreadsObject();
4565 return;
4566 }
4567
4568 if(ilForumTopic::lookupForumIdByTopicId($source_thread_id) != ilForumTopic::lookupForumIdByTopicId($target_thread_id))
4569 {
4570 ilUtil::sendFailure($this->lng->txt('not_allowed_to_merge_into_another_forum'));
4571 $this->ctrl->clearParameters($this);
4572 $this->showThreadsObject();
4573 return;
4574 }
4575
4576 if(ilForumTopic::_lookupDate($source_thread_id) < ilForumTopic::_lookupDate($target_thread_id))
4577 {
4578 ilUtil::sendInfo($this->lng->txt('switch_threads_for_merge'));
4579 }
4580
4581 include_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
4582 $c_gui = new ilConfirmationGUI();
4583
4584 $c_gui->setFormAction($this->ctrl->getFormAction($this, 'performMergeThreads'));
4585 $c_gui->setHeaderText($this->lng->txt('frm_sure_merge_threads'));
4586 $c_gui->setCancel($this->lng->txt('cancel'), 'showThreads');
4587 $c_gui->setConfirm($this->lng->txt('confirm'), 'performMergeThreads');
4588
4589 $c_gui->addItem('thread_ids[]', $source_thread_id, sprintf($this->lng->txt('frm_merge_src'), ilForumTopic::_lookupTitle($source_thread_id)));
4590 $c_gui->addItem('thread_ids[]', $target_thread_id, sprintf($this->lng->txt('frm_merge_target'), ilForumTopic::_lookupTitle($target_thread_id)));
4591
4592 $this->tpl->setContent($c_gui->getHTML());
4593 return;
4594 }
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:

◆ displayConfirmPostActivation()

ilObjForumGUI::displayConfirmPostActivation ( )

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

1130 {
1132 }

References $display_confirm_post_activation.

◆ fetchTreeChildrenAsyncObject()

ilObjForumGUI::fetchTreeChildrenAsyncObject ( )

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

1834 {
1835 include_once 'Services/JSON/classes/class.ilJsonUtil.php';
1836 include_once 'Modules/Forum/classes/class.ilForumExplorer.php';
1837
1838 $response = new stdClass();
1839 $response->success = false;
1840
1841 if( $_GET['nodeId'] )
1842 {
1843 $response->success = true;
1844 $response->children = array();
1845
1846 $key = array_search((int)$_GET['nodeId'], (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
1847 if( false === $key )
1848 {
1849 $_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes'][] = (int)$_GET['nodeId'];
1850 }
1851
1852 $children = $this->objCurrentTopic->getNestedSetPostChildren(
1853 (int)$_GET['nodeId'],
1854 (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']
1855 );
1856
1857 $frm = new ilForum();
1858 $pageHits = $frm->getPageHits();
1859
1860 $fetchedNodes = array();
1861
1862 foreach( $children as $child )
1863 {
1864 if($child['parent_pos'] != (int)$_GET['nodeId'] &&
1865 !in_array($child['parent_pos'], $fetchedNodes))
1866 {
1867 continue;
1868 }
1869
1870 $fetchedNodes[] = $child['pos_pk'];
1871
1872 $this->ctrl->setParameter($this, 'thr_pk', (int)$_GET['thr_pk']);
1873
1875 $child,
1876 $this,
1877 $pageHits
1878 );
1879
1880 $responseChild = new stdClass();
1881 $responseChild->nodeId = $child['pos_pk'];
1882 $responseChild->parentId = $child['parent_pos'];
1883 $responseChild->hasChildren = ($child['children'] >= 1);
1884 $responseChild->fetchedWithChildren = in_array((int)$child['pos_pk'], (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
1885 $responseChild->html = $html;
1886
1887 $response->children[] = $responseChild;
1888 }
1889 }
1890
1891 echo ilJsonUtil::encode($response);
1892 exit();
1893 }
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)
exit
Definition: login.php:54

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

+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjForumGUI::getEditFormCustomValues ( Array &  $a_values)
protected

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

379 {
380 $a_values["desc"] = $this->object->getLongDescription();
381 $a_values['default_view'] = $this->objProperties->getDefaultView();
382 $a_values['anonymized'] = $this->objProperties->isAnonymized();
383 $a_values['statistics_enabled'] = $this->objProperties->isStatisticEnabled();
384 $a_values['post_activation'] = $this->objProperties->isPostActivationEnabled();
385 $a_values['subject_setting'] = $this->objProperties->getSubjectSetting();
386 $a_values['mark_mod_posts'] = $this->objProperties->getMarkModeratorPosts();
387 $a_values['thread_sorting'] = $this->objProperties->getThreadSorting();
388 $a_values['thread_rating'] = $this->objProperties->isIsThreadRatingEnabled();
389
390 $default_view =
391 in_array((int)$this->objProperties->getDefaultView(), array(ilForumProperties::VIEW_DATE_ASC, ilForumProperties::VIEW_DATE_DESC))
394 $a_values['default_view'] = $default_view;
395
396 $default_view_sort_dir =
397 (int)$this->objProperties->getDefaultView() != (int)ilForumProperties::VIEW_TREE
398 ? (int)$this->objProperties->getDefaultView()
400
401 $a_values['default_view_sort_dir'] = $default_view_sort_dir;
402 }

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

◆ getForumExplorer()

ilObjForumGUI::getForumExplorer ( )

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

1821 {
1822 include_once 'Modules/Forum/classes/class.ilForumExplorer.php';
1823
1824 $explorer = new ilForumExplorer(
1825 $this,
1826 $this->objCurrentTopic,
1827 $this->objProperties
1828 );
1829
1830 return $explorer->render()->getHtml();
1831 }
Class ilForumExplorer class for explorer view of forum posts.

◆ getForumObjects()

ilObjForumGUI::getForumObjects ( )
private

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

1803 {
1804 if(null === $this->forumObjects)
1805 {
1806 $forumObj = $this->object;
1807 $file_obj = new ilFileDataForum($forumObj->getId(), $this->objCurrentPost->getId());
1808 $frm = $forumObj->Forum;
1809 $frm->setForumId($forumObj->getId());
1810 $frm->setForumRefId($forumObj->getRefId());
1811
1812 $this->forumObjects['forumObj'] = $forumObj;
1813 $this->forumObjects['frm'] = $frm;
1814 $this->forumObjects['file_obj'] = $file_obj;
1815 }
1816
1817 return $this->forumObjects;
1818 }
This class handles all operations on files for the forum object.

References $forumObjects, and $object.

◆ getIcon()

ilObjForumGUI::getIcon (   $user_toggle_noti)

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

3849 {
3850 $icon = $user_toggle_noti
3851 ? "<img src=\"".ilUtil::getImagePath("icon_ok.svg")."\" alt=\"".$this->lng->txt("enabled")."\" title=\"".$this->lng->txt("enabled")."\" border=\"0\" vspace=\"0\"/>"
3852 : "<img src=\"".ilUtil::getImagePath("icon_not_ok.svg")."\" alt=\"".$this->lng->txt("disabled")."\" title=\"".$this->lng->txt("disabled")."\" border=\"0\" vspace=\"0\"/>";
3853 return $icon;
3854 }

Referenced by getUserNotificationTableData().

+ Here is the caller graph for this function:

◆ getModifiedReOnSubject()

ilObjForumGUI::getModifiedReOnSubject (   $on_reply = false)
private

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

2830 {
2831 $subject = $this->objCurrentPost->getSubject();
2832 $re_txt = $this->lng->txt('post_reply');
2833
2834 $re_txt_with_num = str_replace(':', '(',$re_txt);
2835 $search_length = strlen($re_txt_with_num);
2836 $comp = substr_compare($re_txt_with_num, substr($subject, 0 , $search_length), 0, $search_length);
2837
2838 if($comp == 0)
2839 {
2840 $modified_subject = $subject;
2841 if($on_reply == true)
2842 {
2843 // i.e. $subject = "Re(12):"
2844 $str_pos_start = strpos($subject, '(');
2845 $str_pos_end = strpos($subject, ')');
2846
2847 $length = ((int)$str_pos_end - (int)$str_pos_start);
2848 $str_pos_start++;
2849 $txt_number = substr($subject, $str_pos_start, $length - 1);
2850
2851 if(is_numeric($txt_number))
2852 {
2853 $re_count = (int)$txt_number + 1;
2854 $modified_subject = substr($subject, 0, $str_pos_start) . $re_count . substr($subject, $str_pos_end);
2855 }
2856 }
2857 }
2858 else
2859 {
2860 $re_count = substr_count($subject, $re_txt);
2861 if($re_count >= 1 && $on_reply == true)
2862 {
2863 $subject = str_replace($re_txt, '', $subject);
2864
2865 // i.e. $subject = "Re: Re: Re: ... " -> "Re(4):"
2866 $re_count++;
2867 $modified_subject = sprintf($this->lng->txt('post_reply_count'), $re_count).' '.trim($subject);
2868 }
2869 else if($re_count >= 1 && $on_reply == false)
2870 {
2871 // possibility to modify the subject only for output
2872 // i.e. $subject = "Re: Re: Re: ... " -> "Re(3):"
2873 $modified_subject = sprintf($this->lng->txt('post_reply_count'), $re_count).' '.trim($subject);
2874 }
2875 else if($re_count == 0)
2876 {
2877 // the first reply to a thread
2878 $modified_subject = $this->lng->txt('post_reply').' '. $this->objCurrentPost->getSubject();
2879 }
2880 }
2881 return $modified_subject;
2882 }

◆ getReplyEditForm()

ilObjForumGUI::getReplyEditForm ( )
private

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

1457 {
1458 if(null === $this->replyEditForm)
1459 {
1460 $this->initReplyEditForm();
1461 }
1462
1463 return $this->replyEditForm;
1464 }

References $replyEditForm.

Referenced by quotePostObject().

+ Here is the caller graph for this function:

◆ getSubTabs()

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

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

562 {
563 global $ilTabs;
564
565 if($this->objProperties->getThreadSorting() == 1 && $this->is_moderator)
566 {
567 $ilTabs->addSubTabTarget('show', $this->ctrl->getLinkTarget($this, 'showThreads'), 'showThreads', get_class($this), '', $subtab=='showThreads'? true : false );
568 $ilTabs->addSubTabTarget('sorting_header', $this->ctrl->getLinkTarget($this, 'sortThreads'), 'sortThreads', get_class($this), '', $subtab=='sortThreads'? true : false );
569 }
570 }

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 449 of file class.ilObjForumGUI.php.

450 {
451 $form = new ilPropertyFormGUI();
452 $this->ctrl->setParameter($this, 'thr_pk', $a_thread_id);
453 $form->setFormAction($this->ctrl->getFormAction($this, 'updateThread'));
454
455 $ti_prop = new ilTextInputGUI($this->lng->txt('title'), 'title');
456 $ti_prop->setRequired(true);
457 $ti_prop->setMaxLength(255);
458 $ti_prop->setSize(50);
459 $form->addItem($ti_prop);
460
461 $form->addCommandButton('updateThread', $this->lng->txt('save'));
462 $form->addCommandButton('showThreads', $this->lng->txt('cancel'));
463
464 return $form;
465 }
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 3923 of file class.ilObjForumGUI.php.

3924 {
3925 $counter = 0;
3926 $users = array();
3927 foreach($user_ids as $user_id)
3928 {
3929 $frm_noti->setUserId($user_id);
3930 $user_toggle_noti = $frm_noti->isUserToggleNotification();
3931 $icon_ok = $this->getIcon(!$user_toggle_noti);
3932
3933 $users[$counter]['user_id'] = ilUtil::formCheckbox(0, 'user_id[]', $user_id);
3934 $users[$counter]['login'] = ilObjUser::_lookupLogin($user_id);
3935 $name = ilObjUser::_lookupName($user_id);
3936 $users[$counter]['firstname'] = $name['firstname'];
3937 $users[$counter]['lastname'] = $name['lastname'];
3938 $users[$counter]['user_toggle_noti'] = $icon_ok;
3939 $counter++;
3940 }
3941 return $users;
3942 }
getIcon($user_toggle_noti)
_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 3670 of file class.ilObjForumGUI.php.

3671 {
3672 $a_text = str_replace("<", "&lt;", $a_text);
3673 $a_text = str_replace(">", "&gt;", $a_text);
3674 if($a_stripslashes)
3675 $a_text = ilUtil::stripSlashes($a_text);
3676
3677 return $a_text;
3678 }
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 1743 of file class.ilObjForumGUI.php.

1744 {
1745 if(null === $a_flag)
1746 {
1747 return $this->hideToolbar;
1748 }
1749
1750 $this->hideToolbar = $a_flag;
1751 return $this;
1752 }
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 3693 of file class.ilObjForumGUI.php.

3694 {
3695 $this->ctrl->setCmd('showSummary');
3696 $this->ctrl->setCmdClass('ilinfoscreengui');
3697 $this->infoScreen();
3698 }

◆ initForumCreateForm()

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

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

648 {
649 $this->create_form_gui = new ilPropertyFormGUI();
650 $this->create_form_gui->setTableWidth('600px');
651
652 $this->create_form_gui->setTitle($this->lng->txt('frm_new'));
653 $this->create_form_gui->setTitleIcon(ilUtil::getImagePath('icon_frm.svg'));
654
655 // form action
656 $this->ctrl->setParameter($this, 'new_type', $object_type);
657 $this->create_form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
658
659 // title
660 $title_gui = new ilTextInputGUI($this->lng->txt('title'), 'title');
661 $title_gui->setSize(min(40, ilObject::TITLE_LENGTH));
662 $title_gui->setMaxLength(ilObject::TITLE_LENGTH);
663 $this->create_form_gui->addItem($title_gui);
664
665 // description
666 $description_gui = new ilTextAreaInputGUI($this->lng->txt('desc'), 'desc');
667 $description_gui->setCols(40);
668 $description_gui->setRows(2);
669 $this->create_form_gui->addItem($description_gui);
670
671 // view sorting threads
672 $sorting_threads_gui = new ilRadioGroupInputGUI($this->lng->txt('frm_sorting_threads'), 'thread_sorting');
673 $sort_dat = new ilRadioOption($this->lng->txt('order_by').' '.$this->lng->txt('date'), 0);
674 $sorting_threads_gui->addOption($sort_dat);
675
676 $sort_man = new ilRadioOption($this->lng->txt('sorting_manual_sticky'), 1);
677 $sorting_threads_gui->addOption($sort_man);
678 $sorting_threads_gui->setInfo($this->lng->txt('sticky_threads_always_on_top'));
679 $this->create_form_gui->addItem($sorting_threads_gui);
680
681 // view
682 $view_group_gui = new ilRadioGroupInputGUI($this->lng->txt('frm_default_view'), 'sort');
683 $view_hir = new ilRadioOption($this->lng->txt('order_by').' '.$this->lng->txt('answers'), ilForumProperties::VIEW_TREE);
684 $view_group_gui->addOption($view_hir);
685 $view_dat = new ilRadioOption($this->lng->txt('order_by').' '.$this->lng->txt('date'), ilForumProperties::VIEW_DATE);
686 $view_group_gui->addOption($view_dat);
687 $this->create_form_gui->addItem($view_group_gui);
688 $view_direction_group_gui = new ilRadioGroupInputGUI('', 'default_view_sort_dir');
689 $view_desc = new ilRadioOption($this->lng->txt('frm_post_sort_desc'), ilForumProperties::VIEW_DATE_DESC);
690 $view_direction_group_gui->addOption($view_desc);
691 $view_asc = new ilRadioOption($this->lng->txt('frm_post_sort_asc'), ilForumProperties::VIEW_DATE_ASC);
692 $view_direction_group_gui->addOption($view_asc);
693 $view_dat->addSubItem($view_direction_group_gui);
694
695 // anonymized or not
696 $anonymize_gui = new ilCheckboxInputGUI($this->lng->txt('frm_anonymous_posting'), 'anonymized');
697 $anonymize_gui->setInfo($this->lng->txt('frm_anonymous_posting_desc'));
698 $anonymize_gui->setValue(1);
699
700 if($this->ilias->getSetting('enable_anonymous_fora', false))
701 $anonymize_gui->setDisabled(true);
702 $this->create_form_gui->addItem($anonymize_gui);
703
704 // statistics enabled or not
705 $statistics_gui = new ilCheckboxInputGUI($this->lng->txt('frm_statistics_enabled'), 'statistics_enabled');
706 $statistics_gui->setInfo($this->lng->txt('frm_statistics_enabled_desc'));
707 $statistics_gui->setValue(1);
708 if(!$this->ilias->getSetting('enable_fora_statistics', false))
709 $statistics_gui->setDisabled(true);
710 $this->create_form_gui->addItem($statistics_gui);
711
712 $cb_prop = new ilCheckboxInputGUI($this->lng->txt('activate_new_posts'), 'post_activation');
713 $cb_prop->setValue('1');
714 $cb_prop->setInfo($this->lng->txt('post_activation_desc'));
715 $this->create_form_gui->addItem($cb_prop);
716
717 $this->create_form_gui->addCommandButton('save', $this->lng->txt('save'));
718 $this->create_form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
719 }
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 3813 of file class.ilObjForumGUI.php.

3814 {
3815 if(null === $this->notificationSettingsForm)
3816 {
3817 $form = new ilPropertyFormGUI();
3818 $form->setFormAction($this->ctrl->getFormAction($this, 'updateNotificationSettings'));
3819 $form->setTitle($this->lng->txt('forums_notification_settings'));
3820
3821 $radio_grp = new ilRadioGroupInputGUI('','notification_type');
3822 $radio_grp->setValue('default');
3823
3824 $opt_default = new ilRadioOption($this->lng->txt("user_decides_notification"), 'default');
3825 $opt_0 = new ilRadioOption($this->lng->txt("settings_for_all_members"), 'all_users');
3826 $opt_1 = new ilRadioOption($this->lng->txt("settings_per_users"), 'per_user');
3827
3828 $radio_grp->addOption($opt_default, 'default');
3829 $radio_grp->addOption($opt_0, 'all_users');
3830 $radio_grp->addOption($opt_1, 'per_user');
3831
3832 $chb_2 = new ilCheckboxInputGUI($this->lng->txt('user_toggle_noti'), 'usr_toggle');
3833 $chb_2->setValue(1);
3834
3835 $opt_0->addSubItem($chb_2);
3836 $form->addItem($radio_grp);
3837
3838 $form->addCommandButton('updateNotificationSettings', $this->lng->txt('save'));
3839
3840 $this->notificationSettingsForm = $form;
3841
3842 return false;
3843 }
3844
3845 return true;
3846 }

◆ initSessionStorage()

ilObjForumGUI::initSessionStorage ( )
protected

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

140 {
141 $sess = ilSession::get('frm');
142 if(!is_array($sess))
143 {
144 $sess = array();
145 ilSession::set('frm', $sess);
146 }
147
148 if(isset($_GET['thr_fk']) && !is_array($sess[(int)$_GET['thr_fk']]))
149 {
150 $sess[(int)$_GET['thr_fk']] = array();
151 ilSession::set('frm', $sess);
152 }
153 }
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:

◆ isParentObjectCrsOrGrp()

ilObjForumGUI::isParentObjectCrsOrGrp ( )
private

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

4366 {
4367 global $tree;
4368
4369 // check if there a parent-node is a grp or crs
4370 $grp_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
4371 $crs_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
4372
4373 if($grp_ref_id == 0 && $crs_ref_id == 0)
4374 {
4375 return false;
4376 }
4377 return true;
4378 }

References ilObjectGUI\$tree.

Referenced by isUserAllowedToDeactivateNotification().

+ Here is the caller graph for this function:

◆ isUserAllowedToDeactivateNotification()

ilObjForumGUI::isUserAllowedToDeactivateNotification ( )

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

4335 {
4336 if($this->objProperties->getNotificationType() == 'default')
4337 {
4338 return true;
4339 }
4340
4341 if($this->objProperties->isUserToggleNoti() == 0)
4342 {
4343 return true;
4344 }
4345
4346 if($this->isParentObjectCrsOrGrp());
4347 {
4348 global $ilUser;
4349
4350 include_once 'Modules/Forum/classes/class.ilForumNotification.php';
4351
4352 $frm_noti = new ilForumNotification((int) $_GET['ref_id']);
4353 $frm_noti->setUserId($ilUser->getId());
4354
4355 $user_toggle = (int)$frm_noti->isUserToggleNotification();
4356 if($user_toggle == 0)
4357 {
4358 return true;
4359 }
4360 }
4361
4362 return false;
4363 }
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 4479 of file class.ilObjForumGUI.php.

4480 {
4481 if(!$this->is_moderator)
4482 {
4483 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
4484 }
4485
4486 $selected_thread_id = 0;
4487 if(isset($_GET['merge_thread_id']) && (int)$_GET['merge_thread_id'])
4488 {
4489 $selected_thread_id = (int)$_GET['merge_thread_id'];
4490 }
4491 else if(isset($_POST['thread_ids']) && count((array)$_POST['thread_ids']) == 1)
4492 {
4493 $selected_thread_id = (int)current($_POST['thread_ids']);
4494 }
4495 else
4496 {
4497 ilUtil::sendInfo($this->lng->txt('select_one'));
4498 $this->showThreadsObject();
4499 return;
4500 }
4501
4502 if($selected_thread_id)
4503 {
4504 $frm = $this->object->Forum;
4505 $frm->setForumId($this->object->getId());
4506 $frm->setForumRefId($this->object->getRefId());
4507
4508 $selected_thread_obj = new ilForumTopic($selected_thread_id);
4509
4510 if(ilForum::_lookupObjIdForForumId($selected_thread_obj->getForumId()) != $frm->getForumId())
4511 {
4512 ilUtil::sendFailure($this->lng->txt('not_allowed_to_merge_into_another_forum'));
4513 $this->showThreadsObject();
4514 return;
4515 }
4516
4517 $frm->setMDB2Wherecondition('top_frm_fk = %s ', array('integer'), array($frm->getForumId()));
4518
4519 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.forums_threads_liste.html', 'Modules/Forum');
4520
4521 $topicData = $frm->getOneTopic();
4522 if($topicData)
4523 {
4524 include_once 'Modules/Forum/classes/class.ilForumTopicTableGUI.php';
4525 $this->ctrl->setParameter($this, 'merge_thread_id', $selected_thread_id);
4526 $tbl = new ilForumTopicTableGUI($this, 'mergeThreads', '', (int)$_GET['ref_id'], $topicData, $this->is_moderator, $this->forum_overview_setting);
4527 $tbl->setSelectedThread($selected_thread_obj);
4528 $tbl->setMapper($frm)->fetchData();
4529 $tbl->populate();
4530 $this->tpl->setVariable('THREADS_TABLE', $tbl->getHTML());
4531 }
4532 else
4533 {
4534 ilUtil::sendFailure($this->lng->txt('select_one'));
4535 $this->showThreadsObject();
4536 return;
4537 }
4538 }
4539 }
Class ilForumTopicTableGUI.
static _lookupObjIdForForumId($a_for_id)

References $_GET, $_POST, 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 1103 of file class.ilObjForumGUI.php.

1104 {
1105 if($this->is_moderator)
1106 {
1107 $this->objCurrentPost->activatePost();
1108 ilUtil::sendInfo($this->lng->txt('forums_post_was_activated'), true);
1109 }
1110
1111 $this->viewThreadObject();
1112 }

References ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ prepareFormOutput()

ilObjForumGUI::prepareFormOutput (   $a_text)

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

3681 {
3682 $a_text = str_replace("&lt;", "<", $a_text);
3683 $a_text = str_replace("&gt;", ">", $a_text);
3684 $a_text = ilUtil::prepareFormOutput($a_text);
3685 return $a_text;
3686 }
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 1754 of file class.ilObjForumGUI.php.

1755 {
1756 if(!is_array($_POST['del_file'])) $_POST['del_file'] = array();
1757
1758 if($this->objCurrentTopic->isClosed())
1759 {
1760 $_GET['action'] = '';
1761 return $this->viewThreadObject();
1762 }
1763
1764 $oReplyEditForm = $this->getReplyEditForm();
1765
1766 // remove mandatory fields
1767 $oReplyEditForm->getItemByPostVar('subject')->setRequired(false);
1768 $oReplyEditForm->getItemByPostVar('message')->setRequired(false);
1769
1770 $oReplyEditForm->checkInput();
1771
1772 // add mandatory fields
1773 $oReplyEditForm->getItemByPostVar('subject')->setRequired(true);
1774 $oReplyEditForm->getItemByPostVar('message')->setRequired(true);
1775
1776 $_GET['action'] = 'showreply';
1777
1778 $this->viewThreadObject();
1779 }

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

+ Here is the call graph for this function:

◆ removeFromDeskObject()

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

Implements ilDesktopItemHandling.

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

4446 {
4447 global $ilSetting, $lng;
4448
4449 if((int)$ilSetting->get('disable_my_offers'))
4450 {
4451 $this->showThreadsObject();
4452 return;
4453 }
4454
4455 include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
4457 ilUtil::sendSuccess($lng->txt("removed_from_desktop"));
4458 $this->showThreadsObject();
4459 }
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 4461 of file class.ilObjForumGUI.php.

4462 {
4463 $_POST['thread_sorting'] ? $thread_sorting = $_POST['thread_sorting'] :$thread_sorting = array();
4464
4465 foreach($thread_sorting as $thr_pk=>$sorting_value)
4466 {
4467 $sorting_value = str_replace(',','.',$sorting_value);
4468 $sorting_value = (float)$sorting_value * 100;
4469 $this->object->setThreadSorting($thr_pk,$sorting_value);
4470 }
4471 ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
4472 $this->showThreadsObject();
4473 return true;
4474 }

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

+ Here is the call graph for this function:

◆ setDisplayConfirmPostActivation()

ilObjForumGUI::setDisplayConfirmPostActivation (   $status = 0)

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

1125 {
1126 $this->display_confirm_post_activation = $status;
1127 }

Referenced by askForPostActivationObject().

+ Here is the caller graph for this function:

◆ setTopicCreateDefaultValues()

ilObjForumGUI::setTopicCreateDefaultValues ( )
private

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

3354 {
3355 $this->create_topic_form_gui->setValuesByArray(array(
3356 'subject' => '',
3357 'message' => '',
3358 'userfile' => '',
3359 'notify' => 0,
3360 'notify_posts' => 0
3361 ));
3362 }

◆ setTreeStateAsynchObject()

ilObjForumGUI::setTreeStateAsynchObject ( )

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

1896 {
1897 include_once 'Services/JSON/classes/class.ilJsonUtil.php';
1898
1899 $response = new stdClass();
1900 $response->success = true;
1901
1902 if( $_GET['nodeId'] )
1903 {
1904 if( $_GET['nodeId'] > 0 )
1905 {
1906 $key = array_search((int)$_GET['nodeId'], (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
1907 if( false === $key )
1908 {
1909 $_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes'][] = (int)$_GET['nodeId'];
1910 }
1911 }
1912 else
1913 {
1914 $key = array_search((int)abs($_GET['nodeId']), (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
1915 if( false !== $key )
1916 {
1917 unset($_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes'][$key]);
1918 }
1919 }
1920 }
1921
1922 // Guarantee continuous keys
1923 shuffle($_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
1924 exit();
1925 }

References $_GET, $_SESSION, and exit.

◆ showThreadsObject()

ilObjForumGUI::showThreadsObject ( )

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

548 {
549 $this->getSubTabs('showThreads');
550 $this->tpl->setRightContent($this->getRightColumnHTML());
551 $this->getCenterColumnHTML();
552 }
getSubTabs($subtab='showThreads')
getRightColumnHTML()
Display right column.
getCenterColumnHTML()
Get center column.

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

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 553 of file class.ilObjForumGUI.php.

554 {
555 $this->getSubTabs('sortThreads');
556 $this->tpl->setRightContent($this->getRightColumnHTML());
557 $this->getCenterColumnHTML(true);
558 }

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

+ Here is the call graph for this function:

◆ toggleStickinessObject()

ilObjForumGUI::toggleStickinessObject ( )

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

1156 {
1157 if($this->is_moderator)
1158 {
1159 if($this->objCurrentTopic->isSticky())
1160 {
1161 $this->objCurrentTopic->unmakeSticky();
1162 }
1163 else
1164 {
1165 $this->objCurrentTopic->makeSticky();
1166 }
1167 }
1168
1169 $this->viewThreadObject();
1170 }

◆ updateThreadObject()

ilObjForumGUI::updateThreadObject ( )

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

500 {
501 if(!$this->is_moderator)
502 {
503 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
504 }
505
506 if(!$this->objCurrentTopic->getId())
507 {
508 $this->showThreadsObject();
509 return;
510 }
511
512 $forum_id = ilObjForum::lookupForumIdByObjId($this->object->getId());
513 if($this->objCurrentTopic->getForumId() != $forum_id)
514 {
515 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
516 }
517
518 $form = $this->getThreadEditingForm($this->objCurrentTopic->getId());
519 if(!$form->checkInput())
520 {
521 $form->setValuesByPost();
522 $this->editThreadObject($this->objCurrentTopic->getId(), $form);
523 return;
524 }
525
526 $this->objCurrentTopic->setSubject($form->getInput('title'));
527 $this->objCurrentTopic->updateThreadTitle();
528
529 ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
530 $this->showThreadsObject();
531 }
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 3777 of file class.ilObjForumGUI.php.

3778 {
3779 include_once 'Modules/Forum/classes/class.ilForumNotification.php';
3780
3781 $oParticipants = $this->getParticipantsObject();
3782
3783 $frm_noti = new ilForumNotification($this->object->getRefId());
3784 $moderator_ids = $frm_noti->_getModerators($this->object->getRefId());
3785
3786 $admin_ids = $oParticipants->getAdmins();
3787 $member_ids = $oParticipants->getMembers();
3788 $tutor_ids = $oParticipants->getTutors();
3789
3790 $all_forum_users = array_merge($moderator_ids, $admin_ids, $member_ids, $tutor_ids);
3791 $all_forum_users= array_unique($all_forum_users);
3792
3793 $all_notis = $frm_noti->read();
3794
3795 foreach($all_forum_users as $user_id)
3796 {
3797 $frm_noti->setUserId($user_id);
3798
3799 $frm_noti->setAdminForce(1);
3800 $frm_noti->setUserToggle($this->objProperties->isUserToggleNoti());
3801
3802 if(array_key_exists($user_id, $all_notis) && $update_all_users)
3803 {
3804 $frm_noti->update();
3805 }
3806 else if($frm_noti->existsNotification() == false)
3807 {
3808 $frm_noti->insertAdminForce();
3809 }
3810 }
3811 }

Field Documentation

◆ $confirmation_gui_html

ilObjForumGUI::$confirmation_gui_html = ''
private

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

◆ $create_form_gui

ilObjForumGUI::$create_form_gui
private

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

◆ $create_topic_form_gui

ilObjForumGUI::$create_topic_form_gui
private

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

◆ $display_confirm_post_activation

ilObjForumGUI::$display_confirm_post_activation = 0
private

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

Referenced by displayConfirmPostActivation().

◆ $forum_overview_setting

ilObjForumGUI::$forum_overview_setting = null
private

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

◆ $forumObjects

ilObjForumGUI::$forumObjects
private

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

Referenced by getForumObjects().

◆ $hideToolbar

ilObjForumGUI::$hideToolbar = false
private

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

Referenced by hideToolbar().

◆ $ilias

ilObjForumGUI::$ilias

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

◆ $is_moderator

ilObjForumGUI::$is_moderator = false
private

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

◆ $notificationSettingsForm

ilObjForumGUI::$notificationSettingsForm
private

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

◆ $objCurrentPost

ilObjForumGUI::$objCurrentPost
private

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

◆ $objCurrentTopic

ilObjForumGUI::$objCurrentTopic
private

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

◆ $object

ilObjForumGUI::$object

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

Referenced by getForumObjects().

◆ $objProperties

ilObjForumGUI::$objProperties

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

◆ $replyEditForm

ilObjForumGUI::$replyEditForm
private

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

Referenced by getReplyEditForm().


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