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)
 
 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 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 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 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 public More...
 
 setAdminTabs ()
 set admin tabs 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.

References $_GET, $_POST, ilObjectGUI\$data, $ilCtrl, $ilErr, ilObjectGUI\$lng, ilObjectGUI\$ref_id, $result, $row, $tbl, ilObjectGUI\$tpl, ilObjectGUI\$tree, ilObject\_getAllReferences(), ilObject\_getIcon(), ilObject\_lookupObjectId(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilForumTopic\_lookupTitle(), ilTabsGUI\addTarget(), exit, ilObject\getId(), ilObject\getRefId(), ilObjectGUI\getTabs(), hideToolbar(), ilUtil\infoPanel(), isHierarchicalView(), ilUtil\redirect(), ilUtil\sendInfo(), ilUtil\sendSuccess(), showThreadsObject(), ilForumProperties\VIEW_DATE, and ilForumProperties\VIEW_TREE.

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  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getRefId()
get reference id public
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ askForPostActivationObject()

ilObjForumGUI::askForPostActivationObject ( )

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

References setDisplayConfirmPostActivation().

1177  {
1178  if($this->is_moderator)
1179  {
1180  $this->setDisplayConfirmPostActivation(true);
1181  }
1182 
1183  $this->viewThreadObject();
1184  }
setDisplayConfirmPostActivation($status=0)
+ Here is the call graph for this function:

◆ cancelMergeThreads()

ilObjForumGUI::cancelMergeThreads ( )

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

References showThreadsObject().

4899  {
4900  $this->showThreadsObject();
4901  }
+ Here is the call graph for this function:

◆ cancelObject()

ilObjForumGUI::cancelObject (   $in_rep = false)

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

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

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.
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ cancelPostObject()

◆ checkEnableColumnEdit()

ilObjForumGUI::checkEnableColumnEdit ( )

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

References ilObjectGUI\$lng, ilColumnGUI\setBlockProperty(), ilObjectGUI\setColumnSettings(), and ilColumnGUI\setRepositoryMode().

3832  {
3833  return false;
3834  }
+ Here is the call graph for this function:

◆ cloneWizardPageObject()

ilObjForumGUI::cloneWizardPageObject ( )

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

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

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  }
const SORT_TITLE
$_POST['username']
Definition: cron.php:12
$_SESSION["AccountId"]
createObject()
create new object form
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _getThreads($a_obj_id, $a_sort_mode=self::SORT_DATE)
Get thread infos of object.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
+ Here is the call graph for this function:

◆ confirmMergeThreadsObject()

ilObjForumGUI::confirmMergeThreadsObject ( )

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

References $_GET, $_POST, ilObjectGUI\$lng, ilForumTopic\_lookupDate(), ilForumTopic\_lookupTitle(), ilForumTopic\lookupForumIdByTopicId(), ilForum\mergeThreads(), mergeThreadsObject(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilUtil\sendSuccess(), and showThreadsObject().

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  }
static _lookupDate($thread_id)
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file) ...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _lookupTitle($a_topic_id)
Looks up the title/subject of a topic/thread.
static lookupForumIdByTopicId($a_topic_id)
Confirmation screen class.
+ 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.

References $display_confirm_post_activation, $ilUser, and ilUtil\sendInfo().

Referenced by setTreeStateAsynchObject().

1192  {
1194  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchTreeChildrenAsyncObject()

ilObjForumGUI::fetchTreeChildrenAsyncObject ( )

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

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

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  }
Class Forum core functions for forum.
static getTreeNodeHtml($object, ilObjForumGUI $gui, $pageHits)
Returns the html used for a single forum tree node public.
exit
Definition: login.php:54
$_SESSION["AccountId"]
$_GET["client_id"]
static encode($mixed, $suppress_native=false)
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjForumGUI::getEditFormCustomValues ( Array &  $a_values)
protected

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

References $_POST, $_SESSION, $ilSetting, ilPropertyFormGUI\getInput(), ilObjectGUI\updateCustom(), ilForumProperties\VIEW_DATE, ilForumProperties\VIEW_DATE_ASC, ilForumProperties\VIEW_DATE_DESC, and ilForumProperties\VIEW_TREE.

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  }
+ Here is the call graph for this function:

◆ getForumExplorer()

ilObjForumGUI::getForumExplorer ( )

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

Referenced by setTreeStateAsynchObject().

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.
+ Here is the caller graph for this function:

◆ getForumObjects()

ilObjForumGUI::getForumObjects ( )
private

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

References $forumObjects, and $object.

Referenced by cancelPostObject(), quotePostObject(), quoteTopLevelPostObject(), and setTreeStateAsynchObject().

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.
+ Here is the caller graph for this function:

◆ getIcon()

ilObjForumGUI::getIcon (   $user_toggle_noti)

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

References $ilErr, ilObjectGUI\$tpl, ilObjectGUI\$tree, getUserNotificationTableData(), initNotificationSettingsForm(), and ilForumNotification\setAdminForce().

Referenced by getUserNotificationTableData().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getModifiedReOnSubject()

ilObjForumGUI::getModifiedReOnSubject (   $on_reply = false)
private

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

References $_GET, $_POST, $_SESSION, $ilias, $ilSetting, $ilUser, ilObjectGUI\$lng, $objCurrentTopic, $result, ilObjectGUI\$tpl, ilObjectGUI\$tree, ilHtmlPurifierFactory\_getInstanceByType(), ilObjectGUI\executeCommand(), ilUtil\getImagePath(), ilObjectFactory\getInstanceByRefId(), hideToolbar(), mergeThreadsObject(), ilUtil\sendInfo(), ilUtil\sendSuccess(), ilTextAreaInputGUI\setCols(), ilFileWizardInputGUI\setFilenames(), ilFormPropertyGUI\setInfo(), ilTextInputGUI\setMaxLength(), ilFormPropertyGUI\setRequired(), and ilNonEditableValueGUI\setValue().

Referenced by setTreeStateAsynchObject().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getReplyEditForm()

ilObjForumGUI::getReplyEditForm ( )
private
Returns
ilPropertyFormGUI

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

References $replyEditForm.

Referenced by quotePostObject(), quoteTopLevelPostObject(), and setTreeStateAsynchObject().

1540  {
1541  if(null === $this->replyEditForm)
1542  {
1543  $this->initReplyEditForm();
1544  }
1545 
1546  return $this->replyEditForm;
1547  }
+ Here is the caller graph for this function:

◆ getSubTabs()

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

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

References $_GET, $cmd, $ilUser, $is_moderator, ilObjectGUI\$lng, $tbl, ilLinkButton\getInstance(), hideToolbar(), and ilAccessKey\MARK_ALL_READ.

Referenced by showThreadsObject(), and sortThreadsObject().

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  }
+ Here is the call graph for this function:
+ 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.

References ilForumTopic\_lookupTitle(), and ilFormPropertyGUI\setRequired().

Referenced by updateThreadObject().

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.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ 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.

References $_GET, $_POST, $ilCtrl, $ilErr, $ilUser, $lg, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjUser\_lookupLogin(), ilObjUser\_lookupName(), ilUtil\formCheckbox(), getIcon(), ilUtil\getImagePath(), ilObjectGUI\initHeaderAction(), isParentObjectCrsOrGrp(), isUserAllowedToDeactivateNotification(), ilForumNotification\isUserToggleNotification(), ilUtil\sendInfo(), ilUtil\sendSuccess(), and ilForumNotification\setUserId().

Referenced by getIcon().

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  }
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
getIcon($user_toggle_noti)
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleFormInput()

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

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

References ilUtil\stripSlashes().

Referenced by quoteTopLevelPostObject(), setTopicCreateDefaultValues(), and setTreeStateAsynchObject().

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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hideToolbar()

ilObjForumGUI::hideToolbar (   $a_flag = null)
private

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

References $hideToolbar.

Referenced by afterSave(), getModifiedReOnSubject(), and getSubTabs().

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

References $_POST, $ilErr, $info, ilForumNotification\deleteNotificationAllUsers(), initNotificationSettingsForm(), ilUtil\sendSuccess(), and updateUserNotifications().

3952  {
3953  $this->ctrl->setCmd('showSummary');
3954  $this->ctrl->setCmdClass('ilinfoscreengui');
3955  $this->infoScreen();
3956  }
+ Here is the call graph for this function:

◆ initForumCreateForm()

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

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

References ilRadioOption\addSubItem(), ilUtil\getImagePath(), ilTextAreaInputGUI\setCols(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilTextInputGUI\setSize(), ilCheckboxInputGUI\setValue(), ilObject\TITLE_LENGTH, ilForumProperties\VIEW_DATE, ilForumProperties\VIEW_DATE_ASC, ilForumProperties\VIEW_DATE_DESC, and ilForumProperties\VIEW_TREE.

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 an option in a radio group.
This class represents a property form user interface.
const TITLE_LENGTH
max length of object title
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Info.
setInfo($a_info)
Set Information Text.
This class represents a property in a property form.
addSubItem($a_item)
Add Subitem.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setValue($a_value)
Set Value.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
redirection script todo: (a better solution should control the processing via a xml file) ...
This class represents a text area property in a property form.
+ Here is the call graph for this function:

◆ initNotificationSettingsForm()

ilObjForumGUI::initNotificationSettingsForm ( )
private

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

References ilRadioOption\addSubItem(), and ilCheckboxInputGUI\setValue().

Referenced by getIcon(), and infoScreenObject().

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  }
This class represents an option in a radio group.
This class represents a property form user interface.
This class represents a checkbox property in a property form.
This class represents a property in a property form.
addSubItem($a_item)
Add Subitem.
setValue($a_value)
Set Value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSessionStorage()

ilObjForumGUI::initSessionStorage ( )
protected

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

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

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  }
$_GET["client_id"]
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ isHierarchicalView()

ilObjForumGUI::isHierarchicalView ( )
private
Returns
bool

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

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

Referenced by afterSave(), and setTreeStateAsynchObject().

160  {
161  return (
162  $_SESSION['viewmode'] == 'answers' ||
164  ) || !(
165  $_SESSION['viewmode'] == 'date' ||
167  );
168  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

◆ isParentObjectCrsOrGrp()

ilObjForumGUI::isParentObjectCrsOrGrp ( )
private

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

References $ilErr, $ilSetting, ilObjectGUI\$lng, ilObjectGUI\$tree, ilGroupParticipants\_getInstanceByObjId(), ilCourseParticipants\_getInstanceByObjId(), ilDesktopItemHandling\addToDeskObject(), ilDesktopItemGUI\addToDesktop(), ilObjectFactory\getInstanceByRefId(), ilUtil\sendSuccess(), and showThreadsObject().

Referenced by getUserNotificationTableData(), and isUserAllowedToDeactivateNotification().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isTopLevelReplyCommand()

ilObjForumGUI::isTopLevelReplyCommand ( )
private

◆ isUserAllowedToDeactivateNotification()

ilObjForumGUI::isUserAllowedToDeactivateNotification ( )

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

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

Referenced by getUserNotificationTableData().

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  }
$_GET["client_id"]
Class ilForumNotification.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mergeThreadsObject()

ilObjForumGUI::mergeThreadsObject ( )

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

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

Referenced by confirmMergeThreadsObject(), and getModifiedReOnSubject().

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  }
static _lookupObjIdForForumId($a_for_id)
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
$tbl
Definition: example_048.php:81
Class ilForumTopicTableGUI.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file) ...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ 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.

References $GLOBALS, $objCurrentPost, and ilUtil\sendInfo().

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  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
+ Here is the call graph for this function:

◆ prepareFormOutput()

ilObjForumGUI::prepareFormOutput (   $a_text)

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

References ilUtil\prepareFormOutput().

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 public
+ Here is the call graph for this function:

◆ quotePostObject()

ilObjForumGUI::quotePostObject ( )

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

References $_GET, $_POST, $html, ilRTE\_replaceMediaObjectImageSrc(), exit, getForumObjects(), and getReplyEditForm().

Referenced by quoteTopLevelPostObject().

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  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quoteTopLevelPostObject()

◆ removeFromDeskObject()

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

Implements ilDesktopItemHandling.

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

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

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 sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static removeFromDesktop()
Remove item from personal desktop public.
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ saveThreadSortingObject()

ilObjForumGUI::saveThreadSortingObject ( )

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

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

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  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
+ 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.

Referenced by askForPostActivationObject().

1187  {
1188  $this->display_confirm_post_activation = $status;
1189  }
+ Here is the caller graph for this function:

◆ setSideBlocks()

ilObjForumGUI::setSideBlocks ( )
protected

{}

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

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

Referenced by isTopLevelReplyCommand(), showThreadsObject(), and sortThreadsObject().

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  }
static getSearchBlockHTML($a_title)
Get standar search block html.
getRightColumnHTML()
Display right column.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
+ 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.

References $file, $GLOBALS, $ilUser, ilObjectGUI\$lng, ilObjMediaObject\_exists(), ilRTE\_getMediaObjects(), ilObjMediaObject\_removeUsage(), ilRTE\_replaceMediaObjectImageSrc(), ilObjMediaObject\_saveUsage(), handleFormInput(), ilUtil\sendInfo(), ilUtil\sendSuccess(), showThreadsObject(), and ilFileDataForum\storeUploadedFile().

3613  {
3614  $this->create_topic_form_gui->setValuesByArray(array(
3615  'subject' => '',
3616  'message' => '',
3617  'userfile' => '',
3618  'notify' => 0,
3619  'notify_posts' => 0
3620  ));
3621  }
+ Here is the call graph for this function:

◆ setTreeStateAsynchObject()

ilObjForumGUI::setTreeStateAsynchObject ( )

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

References $_GET, $_POST, $_SESSION, ilObjectGUI\$actions, $file, $ilCtrl, $ilUser, $is_moderator, ilObjectGUI\$lng, $mobs, $params, $path, ilObjectGUI\$tpl, $url, ilObjMediaObject\_exists(), ilObjMediaObject\_getMobsOfObject(), ilForum\_isModerator(), ilObjMediaObject\_removeUsage(), ilRTE\_replaceMediaObjectImageSrc(), ilObjectGUI\addHeaderAction(), ilGlyphGUI\ATTACHMENT, ilUtil\deliverFile(), displayConfirmPostActivation(), exit, ilGlyphGUI\get(), ilObjectGUI\getCreationMode(), getForumExplorer(), getForumObjects(), ilLinkButton\getInstance(), ilSplitButtonGUI\getInstance(), getModifiedReOnSubject(), getReplyEditForm(), handleFormInput(), ilForumPost\isActivated(), isHierarchicalView(), isTopLevelReplyCommand(), ilUtil\Linkbar(), ilAccessKey\MARK_ALL_READ, ilUtil\sendFailure(), ilUtil\sendInfo(), ilUtil\sendSuccess(), ilUtil\switchColor(), ilForumProperties\VIEW_DATE, ilForumProperties\VIEW_DATE_ASC, and ilForumProperties\VIEW_TREE.

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  }
exit
Definition: login.php:54
$_SESSION["AccountId"]
$_GET["client_id"]
+ Here is the call graph for this function:

◆ showThreadsObject()

ilObjForumGUI::showThreadsObject ( )

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

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

Referenced by afterSave(), cancelMergeThreads(), confirmMergeThreadsObject(), isParentObjectCrsOrGrp(), isTopLevelReplyCommand(), mergeThreadsObject(), removeFromDeskObject(), saveThreadSortingObject(), setTopicCreateDefaultValues(), and updateThreadObject().

601  {
602  $this->getSubTabs('showThreads');
603  $this->setSideBlocks();
604  $this->getCenterColumnHTML();
605  }
getSubTabs($subtab='showThreads')
getCenterColumnHTML()
Get center column.
+ 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.

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

607  {
608  $this->getSubTabs('sortThreads');
609  $this->setSideBlocks();
610  $this->getCenterColumnHTML(true);
611  }
getSubTabs($subtab='showThreads')
getCenterColumnHTML()
Get center column.
+ 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.

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

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  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static lookupForumIdByObjId($obj_id)
redirection script todo: (a better solution should control the processing via a xml file) ...
getThreadEditingForm($a_thread_id)
+ 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.

References ilForumNotification\_getModerators().

Referenced by infoScreenObject().

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  }
_getModerators($a_ref_id)
get all users assigned to local role il_frm_moderator_<frm_ref_id> (static)
Class ilForumNotification.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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.

Referenced by getModifiedReOnSubject().

◆ $is_moderator

ilObjForumGUI::$is_moderator = false
private

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

Referenced by getSubTabs(), and setTreeStateAsynchObject().

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

Referenced by performPostActivationObject(), and quoteTopLevelPostObject().

◆ $objCurrentTopic

ilObjForumGUI::$objCurrentTopic
private

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

Referenced by getModifiedReOnSubject().

◆ $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: