ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 
 performPostAndChildPostsActivationObject ()
 
 performPostActivationObject ()
 
 cancelPostActivationObject ()
 
 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 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...
 
 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)
 
- 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...
 
 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

◆ askForPostActivationObject()

ilObjForumGUI::askForPostActivationObject ( )

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

References setDisplayConfirmPostActivation().

1119  {
1120  if($this->is_moderator)
1121  {
1122  $this->setDisplayConfirmPostActivation(true);
1123  }
1124 
1125  $this->viewThreadObject();
1126  }
setDisplayConfirmPostActivation($status=0)
+ Here is the call graph for this function:

◆ cancelMergeThreads()

ilObjForumGUI::cancelMergeThreads ( )

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

References showThreadsObject().

4638  {
4639  $this->showThreadsObject();
4640  }
+ Here is the call graph for this function:

◆ cancelObject()

ilObjForumGUI::cancelObject (   $in_rep = false)

◆ cancelPostActivationObject()

ilObjForumGUI::cancelPostActivationObject ( )

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

1114  {
1115  $this->viewThreadObject();
1116  }

◆ cancelPostObject()

ilObjForumGUI::cancelPostObject ( )

◆ checkEnableColumnEdit()

ilObjForumGUI::checkEnableColumnEdit ( )

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

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

3571  {
3572  return false;
3573  }
+ Here is the call graph for this function:

◆ cloneWizardPageObject()

ilObjForumGUI::cloneWizardPageObject ( )

Definition at line 3600 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.

3601  {
3602  global $ilObjDataCache;
3603 
3604  if (!$_POST['clone_source'])
3605  {
3606  ilUtil::sendInfo($this->lng->txt('select_one'));
3607  if (isset($_SESSION['wizard_search_title']))
3608  {
3609  $this->searchCloneSourceObject();
3610  }
3611  else
3612  {
3613  $this->createObject();
3614  }
3615  return false;
3616  }
3617  $source_id = $_POST['clone_source'];
3618 
3619  $new_type = $_REQUEST['new_type'];
3620  $this->ctrl->setParameter($this, 'clone_source', (int) $_POST['clone_source']);
3621  $this->ctrl->setParameter($this, 'new_type', $new_type);
3622 
3623  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.frm_wizard_page.html', 'Modules/Forum');
3624  $this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
3625  $this->tpl->setVariable('TYPE_IMG', ilUtil::getImagePath('icon_'.$new_type.'.png'));
3626  $this->tpl->setVariable('ALT_IMG', $this->lng->txt('obj_'.$new_type));
3627  $this->tpl->setVariable('TXT_DUPLICATE', $this->lng->txt('frm_wizard_page'));
3628  $this->tpl->setVariable('INFO_THREADS', $this->lng->txt('fmr_copy_threads_info'));
3629  $this->tpl->setVariable('THREADS', $this->lng->txt('forums_threads'));
3630 
3631  $forum_id = $ilObjDataCache->lookupObjId((int) $_POST['clone_source']);
3632  include_once('Modules/Forum/classes/class.ilForum.php');
3633  $threads = ilForum::_getThreads($forum_id, ilForum::SORT_TITLE);
3634  foreach ($threads as $thread_id => $title)
3635  {
3636  $this->tpl->setCurrentBlock('thread_row');
3637  $this->tpl->setVariable('CHECK_THREAD', ilUtil::formCheckbox(0, 'cp_options['.$source_id.'][threads][]', $thread_id));
3638  $this->tpl->setVariable('NAME_THREAD', $title);
3639  $this->tpl->parseCurrentBlock();
3640  }
3641  $this->tpl->setVariable('SELECT_ALL', $this->lng->txt('select_all'));
3642  $this->tpl->setVariable('JS_FIELD', 'cp_options['.$source_id.'][threads]');
3643  $this->tpl->setVariable('BTN_COPY', $this->lng->txt('obj_'.$new_type.'_duplicate'));
3644  if (isset($_SESSION['wizard_search_title']))
3645  {
3646  $this->tpl->setVariable('BACK_CMD', 'searchCloneSource');
3647  }
3648  else
3649  {
3650  $this->tpl->setVariable('BACK_CMD', 'create');
3651  }
3652  $this->tpl->setVariable('BTN_BACK', $this->lng->txt('btn_back'));
3653  }
< 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']
const SORT_TITLE
$_POST['username']
Definition: cron.php:12
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 4541 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().

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

◆ displayConfirmPostActivation()

ilObjForumGUI::displayConfirmPostActivation ( )

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

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

Referenced by setTreeStateAsynchObject().

1134  {
1136  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchTreeChildrenAsyncObject()

ilObjForumGUI::fetchTreeChildrenAsyncObject ( )

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

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

1865  {
1866  include_once 'Services/JSON/classes/class.ilJsonUtil.php';
1867  include_once 'Modules/Forum/classes/class.ilForumExplorer.php';
1868 
1869  $response = new stdClass();
1870  $response->success = false;
1871 
1872  if( $_GET['nodeId'] )
1873  {
1874  $response->success = true;
1875  $response->children = array();
1876 
1877  $key = array_search((int)$_GET['nodeId'], (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
1878  if( false === $key )
1879  {
1880  $_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes'][] = (int)$_GET['nodeId'];
1881  }
1882 
1883  $children = $this->objCurrentTopic->getNestedSetPostChildren(
1884  (int)$_GET['nodeId'],
1885  (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']
1886  );
1887 
1888  $frm = new ilForum();
1889  $pageHits = $frm->getPageHits();
1890 
1891  $fetchedNodes = array();
1892 
1893  foreach( $children as $child )
1894  {
1895  if($child['parent_pos'] != (int)$_GET['nodeId'] &&
1896  !in_array($child['parent_pos'], $fetchedNodes))
1897  {
1898  continue;
1899  }
1900 
1901  $fetchedNodes[] = $child['pos_pk'];
1902 
1903  $this->ctrl->setParameter($this, 'thr_pk', (int)$_GET['thr_pk']);
1904 
1906  $child,
1907  $this,
1908  $pageHits
1909  );
1910 
1911  $responseChild = new stdClass();
1912  $responseChild->nodeId = $child['pos_pk'];
1913  $responseChild->parentId = $child['parent_pos'];
1914  $responseChild->hasChildren = ($child['children'] >= 1);
1915  $responseChild->fetchedWithChildren = in_array((int)$child['pos_pk'], (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
1916  $responseChild->html = $html;
1917 
1918  $response->children[] = $responseChild;
1919  }
1920  }
1921 
1922  echo ilJsonUtil::encode($response);
1923  exit();
1924  }
< 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']
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
$_GET["client_id"]
static encode($mixed, $suppress_native=false)
+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjForumGUI::getEditFormCustomValues ( Array &  $a_values)
protected

Definition at line 352 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.

353  {
354  $a_values["desc"] = $this->object->getLongDescription();
355  $a_values['default_view'] = $this->objProperties->getDefaultView();
356  $a_values['anonymized'] = $this->objProperties->isAnonymized();
357  $a_values['statistics_enabled'] = $this->objProperties->isStatisticEnabled();
358  $a_values['post_activation'] = $this->objProperties->isPostActivationEnabled();
359  $a_values['subject_setting'] = $this->objProperties->getSubjectSetting();
360  $a_values['mark_mod_posts'] = $this->objProperties->getMarkModeratorPosts();
361  $a_values['thread_sorting'] = $this->objProperties->getThreadSorting();
362 
363  $default_view =
364  in_array((int)$this->objProperties->getDefaultView(), array(ilForumProperties::VIEW_DATE_ASC, ilForumProperties::VIEW_DATE_DESC))
367  $a_values['default_view'] = $default_view;
368 
369  $default_view_sort_dir =
370  (int)$this->objProperties->getDefaultView() != (int)ilForumProperties::VIEW_TREE
371  ? (int)$this->objProperties->getDefaultView()
373 
374  $a_values['default_view_sort_dir'] = $default_view_sort_dir;
375  }
+ Here is the call graph for this function:

◆ getForumExplorer()

ilObjForumGUI::getForumExplorer ( )

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

Referenced by setTreeStateAsynchObject().

1852  {
1853  include_once 'Modules/Forum/classes/class.ilForumExplorer.php';
1854 
1855  $explorer = new ilForumExplorer(
1856  $this,
1857  $this->objCurrentTopic,
1858  $this->objProperties
1859  );
1860 
1861  return $explorer->render()->getHtml();
1862  }
Class ilForumExplorer class for explorer view of forum posts.
+ Here is the caller graph for this function:

◆ getForumObjects()

ilObjForumGUI::getForumObjects ( )
private

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

References $forumObjects, $object, ilObject\getId(), and ilObject\getRefId().

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

1834  {
1835  if(null === $this->forumObjects)
1836  {
1837  $forumObj = $this->object;
1838  $file_obj = new ilFileDataForum($forumObj->getId(), $this->objCurrentPost->getId());
1839  $frm = $forumObj->Forum;
1840  $frm->setForumId($forumObj->getId());
1841  $frm->setForumRefId($forumObj->getRefId());
1842 
1843  $this->forumObjects['forumObj'] = $forumObj;
1844  $this->forumObjects['frm'] = $frm;
1845  $this->forumObjects['file_obj'] = $file_obj;
1846  }
1847 
1848  return $this->forumObjects;
1849  }
This class handles all operations on files for the forum object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIcon()

ilObjForumGUI::getIcon (   $user_toggle_noti)

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

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

Referenced by getUserNotificationTableData().

3846  {
3847  $icon = $user_toggle_noti
3848  ? "<img src=\"".ilUtil::getImagePath("icon_ok.png")."\" alt=\"".$this->lng->txt("enabled")."\" title=\"".$this->lng->txt("enabled")."\" border=\"0\" vspace=\"0\"/>"
3849  : "<img src=\"".ilUtil::getImagePath("icon_not_ok.png")."\" alt=\"".$this->lng->txt("disabled")."\" title=\"".$this->lng->txt("disabled")."\" border=\"0\" vspace=\"0\"/>";
3850  return $icon;
3851  }
+ 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 2849 of file class.ilObjForumGUI.php.

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

Referenced by setTreeStateAsynchObject().

2850  {
2851  $subject = $this->objCurrentPost->getSubject();
2852  $re_txt = $this->lng->txt('post_reply');
2853 
2854  $re_txt_with_num = str_replace(':', '(',$re_txt);
2855  $search_length = strlen($re_txt_with_num);
2856  $comp = substr_compare($re_txt_with_num, substr($subject, 0 , $search_length), 0, $search_length);
2857 
2858  if($comp == 0)
2859  {
2860  $modified_subject = $subject;
2861  if($on_reply == true)
2862  {
2863  // i.e. $subject = "Re(12):"
2864  $str_pos_start = strpos($subject, '(');
2865  $str_pos_end = strpos($subject, ')');
2866 
2867  $length = ((int)$str_pos_end - (int)$str_pos_start);
2868  $str_pos_start++;
2869  $txt_number = substr($subject, $str_pos_start, $length - 1);
2870 
2871  if(is_numeric($txt_number))
2872  {
2873  $re_count = (int)$txt_number + 1;
2874  $modified_subject = substr($subject, 0, $str_pos_start) . $re_count . substr($subject, $str_pos_end);
2875  }
2876  }
2877  }
2878  else
2879  {
2880  $re_count = substr_count($subject, $re_txt);
2881  if($re_count >= 1 && $on_reply == true)
2882  {
2883  $subject = str_replace($re_txt, '', $subject);
2884 
2885  // i.e. $subject = "Re: Re: Re: ... " -> "Re(4):"
2886  $re_count++;
2887  $modified_subject = sprintf($this->lng->txt('post_reply_count'), $re_count).' '.trim($subject);
2888  }
2889  else if($re_count >= 1 && $on_reply == false)
2890  {
2891  // possibility to modify the subject only for output
2892  // i.e. $subject = "Re: Re: Re: ... " -> "Re(3):"
2893  $modified_subject = sprintf($this->lng->txt('post_reply_count'), $re_count).' '.trim($subject);
2894  }
2895  else if($re_count == 0)
2896  {
2897  // the first reply to a thread
2898  $modified_subject = $this->lng->txt('post_reply').' '. $this->objCurrentPost->getSubject();
2899  }
2900  }
2901  return $modified_subject;
2902  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getReplyEditForm()

ilObjForumGUI::getReplyEditForm ( )
private

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

References $_GET, $_POST, $_SESSION, $file, $ilUser, ilObjectGUI\$lng, $replyEditForm, ilObjMediaObject\_exists(), ilRTE\_getMediaObjects(), ilObjMediaObject\_getMobsOfObject(), ilObjMediaObject\_removeUsage(), ilRTE\_replaceMediaObjectImageSrc(), ilObjMediaObject\_saveUsage(), ilNewsItem\getFirstNewsIdForContext(), getForumObjects(), ilObject\getId(), ilObjectGUI\getTitlesByRefId(), handleFormInput(), and ilUtil\sendSuccess().

Referenced by quotePostObject(), and setTreeStateAsynchObject().

1490  {
1491  if(null === $this->replyEditForm)
1492  {
1493  $this->initReplyEditForm();
1494  }
1495 
1496  return $this->replyEditForm;
1497  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSubTabs()

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

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

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

Referenced by showThreadsObject(), and sortThreadsObject().

534  {
535  global $ilTabs;
536 
537  if($this->objProperties->getThreadSorting() == 1 && $this->is_moderator)
538  {
539  $ilTabs->addSubTabTarget('show', $this->ctrl->getLinkTarget($this, 'showThreads'), 'showThreads', get_class($this), '', $subtab=='showThreads'? true : false );
540  $ilTabs->addSubTabTarget('sorting_header', $this->ctrl->getLinkTarget($this, 'sortThreads'), 'sortThreads', get_class($this), '', $subtab=='sortThreads'? true : false );
541  }
542  }
+ 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 421 of file class.ilObjForumGUI.php.

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

Referenced by updateThreadObject().

422  {
423  $form = new ilPropertyFormGUI();
424  $this->ctrl->setParameter($this, 'thr_pk', $a_thread_id);
425  $form->setFormAction($this->ctrl->getFormAction($this, 'updateThread'));
426 
427  $ti_prop = new ilTextInputGUI($this->lng->txt('title'), 'title');
428  $ti_prop->setRequired(true);
429  $ti_prop->setMaxLength(255);
430  $ti_prop->setSize(50);
431  $form->addItem($ti_prop);
432 
433  $form->addCommandButton('updateThread', $this->lng->txt('save'));
434  $form->addCommandButton('showThreads', $this->lng->txt('cancel'));
435 
436  return $form;
437  }
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 3920 of file class.ilObjForumGUI.php.

References $_GET, $_POST, $ilCtrl, $ilErr, $ilUser, 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().

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

References ilUtil\stripSlashes().

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

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

References $hideToolbar.

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

1776  {
1777  if(null === $a_flag)
1778  {
1779  return $this->hideToolbar;
1780  }
1781 
1782  $this->hideToolbar = $a_flag;
1783  return $this;
1784  }
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 3690 of file class.ilObjForumGUI.php.

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

3691  {
3692  $this->ctrl->setCmd('showSummary');
3693  $this->ctrl->setCmdClass('ilinfoscreengui');
3694  $this->infoScreen();
3695  }
+ Here is the call graph for this function:

◆ initForumCreateForm()

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

Definition at line 619 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.

620  {
621  $this->create_form_gui = new ilPropertyFormGUI();
622  $this->create_form_gui->setTableWidth('600px');
623 
624  $this->create_form_gui->setTitle($this->lng->txt('frm_new'));
625  $this->create_form_gui->setTitleIcon(ilUtil::getImagePath('icon_frm.png'));
626 
627  // form action
628  $this->ctrl->setParameter($this, 'new_type', $object_type);
629  $this->create_form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
630 
631  // title
632  $title_gui = new ilTextInputGUI($this->lng->txt('title'), 'title');
633  $title_gui->setSize(min(40, ilObject::TITLE_LENGTH));
634  $title_gui->setMaxLength(ilObject::TITLE_LENGTH);
635  $this->create_form_gui->addItem($title_gui);
636 
637  // description
638  $description_gui = new ilTextAreaInputGUI($this->lng->txt('desc'), 'desc');
639  $description_gui->setCols(40);
640  $description_gui->setRows(2);
641  $this->create_form_gui->addItem($description_gui);
642 
643  // view sorting threads
644  $sorting_threads_gui = new ilRadioGroupInputGUI($this->lng->txt('frm_sorting_threads'), 'thread_sorting');
645  $sort_dat = new ilRadioOption($this->lng->txt('order_by').' '.$this->lng->txt('date'), 0);
646  $sorting_threads_gui->addOption($sort_dat);
647 
648  $sort_man = new ilRadioOption($this->lng->txt('sorting_manual_sticky'), 1);
649  $sorting_threads_gui->addOption($sort_man);
650  $sorting_threads_gui->setInfo($this->lng->txt('sticky_threads_always_on_top'));
651  $this->create_form_gui->addItem($sorting_threads_gui);
652 
653  // view
654  $view_group_gui = new ilRadioGroupInputGUI($this->lng->txt('frm_default_view'), 'sort');
655  $view_hir = new ilRadioOption($this->lng->txt('order_by').' '.$this->lng->txt('answers'), ilForumProperties::VIEW_TREE);
656  $view_group_gui->addOption($view_hir);
657  $view_dat = new ilRadioOption($this->lng->txt('order_by').' '.$this->lng->txt('date'), ilForumProperties::VIEW_DATE);
658  $view_group_gui->addOption($view_dat);
659  $this->create_form_gui->addItem($view_group_gui);
660  $view_direction_group_gui = new ilRadioGroupInputGUI('', 'default_view_sort_dir');
661  $view_desc = new ilRadioOption($this->lng->txt('frm_post_sort_desc'), ilForumProperties::VIEW_DATE_DESC);
662  $view_direction_group_gui->addOption($view_desc);
663  $view_asc = new ilRadioOption($this->lng->txt('frm_post_sort_asc'), ilForumProperties::VIEW_DATE_ASC);
664  $view_direction_group_gui->addOption($view_asc);
665  $view_dat->addSubItem($view_direction_group_gui);
666 
667  // anonymized or not
668  $anonymize_gui = new ilCheckboxInputGUI($this->lng->txt('frm_anonymous_posting'), 'anonymized');
669  $anonymize_gui->setInfo($this->lng->txt('frm_anonymous_posting_desc'));
670  $anonymize_gui->setValue(1);
671 
672  if($this->ilias->getSetting('enable_anonymous_fora', false))
673  $anonymize_gui->setDisabled(true);
674  $this->create_form_gui->addItem($anonymize_gui);
675 
676  // statistics enabled or not
677  $statistics_gui = new ilCheckboxInputGUI($this->lng->txt('frm_statistics_enabled'), 'statistics_enabled');
678  $statistics_gui->setInfo($this->lng->txt('frm_statistics_enabled_desc'));
679  $statistics_gui->setValue(1);
680  if(!$this->ilias->getSetting('enable_fora_statistics', false))
681  $statistics_gui->setDisabled(true);
682  $this->create_form_gui->addItem($statistics_gui);
683 
684  $cb_prop = new ilCheckboxInputGUI($this->lng->txt('activate_new_posts'), 'post_activation');
685  $cb_prop->setValue('1');
686  $cb_prop->setInfo($this->lng->txt('post_activation_desc'));
687  $this->create_form_gui->addItem($cb_prop);
688 
689  $this->create_form_gui->addCommandButton('save', $this->lng->txt('save'));
690  $this->create_form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
691  }
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 3810 of file class.ilObjForumGUI.php.

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

Referenced by getIcon(), and infoScreenObject().

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

References $_GET, $_POST, $cmd, $ilCtrl, $ilSetting, $ret, $sess, ilObjectGUI\addHeaderAction(), ilPropertyFormGUI\addItem(), ilRadioGroupInputGUI\addOption(), ilRadioOption\addSubItem(), ilObjectGUI\executeCommand(), exit, ilSession\get(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilObjectGUI\initEditCustomForm(), ilObjectGUI\prepareOutput(), ilSession\set(), ilCheckboxInputGUI\setValue(), showThreadsObject(), ilForumProperties\VIEW_DATE, ilForumProperties\VIEW_DATE_ASC, ilForumProperties\VIEW_DATE_DESC, and ilForumProperties\VIEW_TREE.

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  }
$_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:

◆ isParentObjectCrsOrGrp()

ilObjForumGUI::isParentObjectCrsOrGrp ( )
private

Definition at line 4362 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().

4363  {
4364  global $tree;
4365 
4366  // check if there a parent-node is a grp or crs
4367  $grp_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
4368  $crs_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
4369 
4370  if($grp_ref_id == 0 && $crs_ref_id == 0)
4371  {
4372  return false;
4373  }
4374  return true;
4375  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isUserAllowedToDeactivateNotification()

ilObjForumGUI::isUserAllowedToDeactivateNotification ( )

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

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

Referenced by getUserNotificationTableData().

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

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

Referenced by confirmMergeThreadsObject(), and getModifiedReOnSubject().

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

References ilUtil\sendInfo().

1103  {
1104  if($this->is_moderator)
1105  {
1106  $this->objCurrentPost->activatePost();
1107  ilUtil::sendInfo($this->lng->txt('forums_post_was_activated'), true);
1108  }
1109 
1110  $this->viewThreadObject();
1111  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ performPostAndChildPostsActivationObject()

ilObjForumGUI::performPostAndChildPostsActivationObject ( )

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

References ilUtil\sendInfo().

1092  {
1093  if($this->is_moderator)
1094  {
1095  $this->objCurrentPost->activatePostAndChildPosts();
1096  ilUtil::sendInfo($this->lng->txt('forums_post_and_children_were_activated'), true);
1097  }
1098 
1099  $this->viewThreadObject();
1100  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ prepareFormOutput()

ilObjForumGUI::prepareFormOutput (   $a_text)

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

References ilUtil\prepareFormOutput().

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

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

1787  {
1788  if(!is_array($_POST['del_file'])) $_POST['del_file'] = array();
1789 
1790  if($this->objCurrentTopic->isClosed())
1791  {
1792  $_GET['action'] = '';
1793  return $this->viewThreadObject();
1794  }
1795 
1796  $oReplyEditForm = $this->getReplyEditForm();
1797 
1798  // remove mandatory fields
1799  $oReplyEditForm->getItemByPostVar('subject')->setRequired(false);
1800  $oReplyEditForm->getItemByPostVar('message')->setRequired(false);
1801 
1802  $oReplyEditForm->checkInput();
1803 
1804  // add mandatory fields
1805  $oReplyEditForm->getItemByPostVar('subject')->setRequired(true);
1806  $oReplyEditForm->getItemByPostVar('message')->setRequired(true);
1807 
1808  $_GET['action'] = 'showreply';
1809 
1810  $this->viewThreadObject();
1811  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
+ Here is the call graph for this function:

◆ removeFromDeskObject()

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

Implements ilDesktopItemHandling.

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

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

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

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

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

◆ setDisplayConfirmPostActivation()

ilObjForumGUI::setDisplayConfirmPostActivation (   $status = 0)

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

Referenced by askForPostActivationObject().

1129  {
1130  $this->display_confirm_post_activation = $status;
1131  }
+ Here is the caller graph for this function:

◆ setTopicCreateDefaultValues()

ilObjForumGUI::setTopicCreateDefaultValues ( )
private

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

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

3352  {
3353  $this->create_topic_form_gui->setValuesByArray(array(
3354  'subject' => '',
3355  'message' => '',
3356  'userfile' => '',
3357  'notify' => 0,
3358  'notify_posts' => 0
3359  ));
3360  }
+ Here is the call graph for this function:

◆ setTreeStateAsynchObject()

ilObjForumGUI::setTreeStateAsynchObject ( )

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

References $_GET, $_POST, $_SESSION, $file, $ilCtrl, $ilUser, $is_moderator, ilObjectGUI\$lng, $mobs, $path, ilObjectGUI\$tpl, ilObjMediaObject\_exists(), ilObjMediaObject\_getMobsOfObject(), ilForum\_isModerator(), ilObjMediaObject\_removeUsage(), ilRTE\_replaceMediaObjectImageSrc(), ilObjectGUI\addHeaderAction(), ilUtil\deliverFile(), displayConfirmPostActivation(), exit, ilObjectGUI\getCreationMode(), getForumExplorer(), getForumObjects(), ilObject\getId(), ilUtil\getImagePath(), getModifiedReOnSubject(), ilObject\getRefId(), getReplyEditForm(), handleFormInput(), ilUtil\Linkbar(), ilAccessKey\MARK_ALL_READ, ilUtil\sendFailure(), ilUtil\sendInfo(), ilUtil\switchColor(), ilForumProperties\VIEW_DATE, ilForumProperties\VIEW_DATE_ASC, and ilForumProperties\VIEW_TREE.

1927  {
1928  include_once 'Services/JSON/classes/class.ilJsonUtil.php';
1929 
1930  $response = new stdClass();
1931  $response->success = true;
1932 
1933  if( $_GET['nodeId'] )
1934  {
1935  if( $_GET['nodeId'] > 0 )
1936  {
1937  $key = array_search((int)$_GET['nodeId'], (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
1938  if( false === $key )
1939  {
1940  $_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes'][] = (int)$_GET['nodeId'];
1941  }
1942  }
1943  else
1944  {
1945  $key = array_search((int)abs($_GET['nodeId']), (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
1946  if( false !== $key )
1947  {
1948  unset($_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes'][$key]);
1949  }
1950  }
1951  }
1952 
1953  // Guarantee continuous keys
1954  shuffle($_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
1955  exit();
1956  }
< 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']
exit
Definition: login.php:54
$_GET["client_id"]
+ Here is the call graph for this function:

◆ showThreadsObject()

ilObjForumGUI::showThreadsObject ( )

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

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

Referenced by cancelMergeThreads(), cancelObject(), confirmMergeThreadsObject(), initSessionStorage(), isParentObjectCrsOrGrp(), mergeThreadsObject(), removeFromDeskObject(), saveThreadSortingObject(), setTopicCreateDefaultValues(), and updateThreadObject().

520  {
521  $this->getSubTabs('showThreads');
522  $this->tpl->setRightContent($this->getRightColumnHTML());
523  $this->getCenterColumnHTML();
524  }
getSubTabs($subtab='showThreads')
getCenterColumnHTML()
Get center column.
getRightColumnHTML()
Display right column.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sortThreadsObject()

ilObjForumGUI::sortThreadsObject ( )

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

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

526  {
527  $this->getSubTabs('sortThreads');
528  $this->tpl->setRightContent($this->getRightColumnHTML());
529  $this->getCenterColumnHTML(true);
530  }
getSubTabs($subtab='showThreads')
getCenterColumnHTML()
Get center column.
getRightColumnHTML()
Display right column.
+ Here is the call graph for this function:

◆ toggleStickinessObject()

ilObjForumGUI::toggleStickinessObject ( )

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

1160  {
1161  if($this->is_moderator)
1162  {
1163  if($this->objCurrentTopic->isSticky())
1164  {
1165  $this->objCurrentTopic->unmakeSticky();
1166  }
1167  else
1168  {
1169  $this->objCurrentTopic->makeSticky();
1170  }
1171  }
1172 
1173  $this->viewThreadObject();
1174  }

◆ updateThreadObject()

ilObjForumGUI::updateThreadObject ( )

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

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

472  {
473  if(!$this->is_moderator)
474  {
475  $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
476  }
477 
478  if(!$this->objCurrentTopic->getId())
479  {
480  $this->showThreadsObject();
481  return;
482  }
483 
484  $forum_id = ilObjForum::lookupForumIdByObjId($this->object->getId());
485  if($this->objCurrentTopic->getForumId() != $forum_id)
486  {
487  $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
488  }
489 
490  $form = $this->getThreadEditingForm($this->objCurrentTopic->getId());
491  if(!$form->checkInput())
492  {
493  $form->setValuesByPost();
494  $this->editThreadObject($this->objCurrentTopic->getId(), $form);
495  return;
496  }
497 
498  $this->objCurrentTopic->setSubject($form->getInput('title'));
499  $this->objCurrentTopic->updateThreadTitle();
500 
501  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
502  $this->showThreadsObject();
503  }
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 3774 of file class.ilObjForumGUI.php.

References ilForumNotification\_getModerators().

Referenced by infoScreenObject().

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

Referenced by getModifiedReOnSubject().

◆ $is_moderator

ilObjForumGUI::$is_moderator = false
private

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

Referenced by getSubTabs(), and setTreeStateAsynchObject().

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

Referenced by getModifiedReOnSubject().

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