ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjForumGUI Class Reference

Class ilObjForumGUI. More...

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

Public Member Functions

 ilObjForumGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
executeCommand ()
 Execute Command.
 updateObject ()
 updates object entry in object_data
 editObject ()
 edit object
 markAllReadObject ()
 showThreadsObject ()
 list threads of forum
 getContent ()
 createObject ($subbmitted_form= '')
 creation form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 performImportObject ()
 saveObject ($a_prevent_redirect=false)
 save object public
 getTabs (&$tabs_gui)
 get tabs abstract method.
 showStatisticsObject ()
 called from GUI
 _goto ($a_target, $a_thread=0, $a_posting=0)
 redirect script
 performDeleteThreadsObject ()
 confirmDeleteThreads ()
 showThreadFramesetObject ()
 Output forum frameset.
 showExplorerObject ()
 Show Forum Explorer.
 prepareThreadScreen ($a_forum_obj)
 performPostAndChildPostsActivationObject ()
 performPostActivationObject ()
 cancelPostActivationObject ()
 askForPostActivationObject ()
 setDisplayConfirmPostActivation ($status=0)
 displayConfirmPostActivation ()
 toggleThreadNotificationObject ()
 Toggle thread notification for current user in notification tab view.
 toggleStickinessObject ()
 Toggle sticky attribute of a thread.
 cancelPostObject ()
 getDeleteFormHTML ()
 getActivationFormHTML ()
 getDeactivationFormHTML ()
 getCensorshipFormHTML ()
 savePostObject ()
 quotePostObject ()
 getQuotationHTMLAsynchObject ()
 doReloadTreeObject ()
 viewThreadObject ()
 View single thread.
 showUserObject ()
 Show user profile.
 performThreadsActionObject ()
 Perform form action in threads list.
 performMoveThreadsObject ()
 cancelMoveThreadsObject ()
 confirmMoveThreadsObject ()
 searchForumsObject ()
 moveThreadsObject ($confirm=false)
 createThreadObject ()
 New Thread form.
 addThreadObject ($a_prevent_redirect=false)
 Add New Thread.
 enableForumNotificationObject ()
 Show Notification Tab.
 disableForumNotificationObject ()
 Disable forum notification.
 checkEnableColumnEdit ()
 No editing allowd in forums.
 setColumnSettings ($column_gui)
 Set column settings.
 copyWizardHasOptions ($a_mode)
 public
 cloneWizardPageObject ()
 Show selection of starting threads.
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 handleFormInput ($a_text, $a_stripslashes=true)
 Handle subject and message text input.
 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
 infoScreen ()
 show information screen
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 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
 getCreationMode ()
 get creation mode
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 createObject ()
 create new object form
 saveObject ()
 save object
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.

Private Member Functions

 initForumCreateForm ($object_type)
 private
 setForumCreateDefaultValues ()
 private
 initForumImportForm ($object_type)
 private
 __initFileObject ()
 __initParserObject ($a_xml_file)
 initReplyEditForm ()
 getReplyEditForm ()
 reloadTree ($a_flag=null)
 hideToolbar ($a_flag=null)
 getForumObjects ()
 initTopicCreateForm ()
 setTopicCreateDefaultValues ()
 private
 getUserInstance ($a_usr_id)
 Caching method for user instances.

Private Attributes

 $objProperties = null
 $objCurrentTopic = null
 $objCurrentPost = null
 $display_confirm_post_deactivation = 0
 $display_confirm_post_activation = 0
 $is_moderator = false
 $action = null
 $create_form_gui = null
 $create_import_gui = null
 $create_topic_form_gui = null
 $reloadTree = false
 $hideToolbar = false

Additional Inherited Members

- 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
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __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
 __showClipboardTable ($a_result_set, $a_from="")
 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
 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.
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 Add an object search in case the number of existing objects is too big to offer a selection list.
 searchCloneSourceObject ()
 Search clone source by title.
 buildCloneSelect ($existing_objs)
 Build a select box for clonable objects (permission write)
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 checkPermission ($a_perm, $a_cmd="")

Detailed Description

Member Function Documentation

ilObjForumGUI::__initFileObject ( )
private

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

Referenced by performImportObject().

{
include_once './Modules/Forum/classes/class.ilFileDataImportForum.php';
$this->file_obj =& new ilFileDataImportForum();
return true;
}

+ Here is the caller graph for this function:

ilObjForumGUI::__initParserObject (   $a_xml_file)
private

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

Referenced by performImportObject().

{
include_once './Modules/Forum/classes/class.ilForumImportParser.php';
$this->parser_obj =& new ilForumImportParser($a_xml_file, $this->ref_id);
return true;
}

+ Here is the caller graph for this function:

ilObjForumGUI::_goto (   $a_target,
  $a_thread = 0,
  $a_posting = 0 
)

redirect script

Parameters
string$a_target

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

References $_GET, $ilErr, ilObjectGUI\$lng, ilObjectGUI\$ref_id, ilObject\_getAllReferences(), ilObject\_lookupObjectId(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, ilUtil\redirect(), and ilUtil\sendInfo().

{
global $ilAccess, $ilErr, $lng;
if ($ilAccess->checkAccess('read', '', $a_target))
{
if ($a_thread != 0)
{
$objTopic = new ilForumTopic($a_thread);
if ($objTopic->getFrmObjId() &&
$objTopic->getFrmObjId() != ilObject::_lookupObjectId($a_target))
{
$ref_ids = ilObject::_getAllReferences($objTopic->getFrmObjId());
foreach ($ref_ids as $ref_id)
{
if ($ilAccess->checkAccess('read,visible', '', $ref_id))
{
$new_ref_id = $ref_id;
break;
}
}
if (isset($new_ref_id) && $new_ref_id != $a_target)
{
ilUtil::redirect(ILIAS_HTTP_PATH."/goto.php?target=frm_".$new_ref_id."_".$a_thread."_".$a_posting);
}
}
$_GET['ref_id'] = $a_target;
$_GET['pos_pk'] = $a_posting;
$_GET['thr_pk'] = $a_thread;
$_GET['cmdClass'] = 'ilObjForumGUI';
$_GET['cmd'] = 'showThreadFrameset';
//include_once('forums_frameset.php');
include_once('repository.php');
exit();
}
else
{
$_GET['ref_id'] = $a_target;
include_once('repository.php');
exit();
}
}
else if ($ilAccess->checkAccess('read', '', ROOT_FOLDER_ID))
{
$_GET['cmd'] = 'frameset';
$_GET['target'] = '';
$_GET['ref_id'] = ROOT_FOLDER_ID;
ilUtil::sendInfo(sprintf($lng->txt('msg_no_perm_read_item'),
include('repository.php');
exit();
}
$ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
}

+ Here is the call graph for this function:

ilObjForumGUI::addLocatorItems ( )

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

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

References $_GET.

{
global $ilLocator;
if (is_object($this->object))
{
$ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ''), '', $_GET['ref_id']);
}
}
ilObjForumGUI::addThreadObject (   $a_prevent_redirect = false)

Add New Thread.

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

References $_GET, $file, ilObjectGUI\$lng, ilObjMediaObject\_exists(), ilRTE\_getMediaObjects(), ilObjMediaObject\_removeUsage(), ilRTE\_replaceMediaObjectImageSrc(), ilObjMediaObject\_saveUsage(), handleFormInput(), initTopicCreateForm(), ilUtil\sendSuccess(), and ilFileDataForum\storeUploadedFile().

{
global $ilUser, $ilAccess;
$forumObj = new ilObjForum((int)$_GET['ref_id']);
$frm = $forumObj->Forum;
$frm->setForumId($forumObj->getId());
$frm->setForumRefId($forumObj->getRefId());
if(!$ilAccess->checkAccess('add_thread,add_post', '', $forumObj->getRefId()))
{
$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
$frm->setMDB2WhereCondition('top_frm_fk = %s ', array('integer'), array($frm->getForumId()));
$topicData = $frm->getOneTopic();
if($this->create_topic_form_gui->checkInput())
{
if($this->objProperties->isAnonymized())
{
if(!strlen($this->create_topic_form_gui->getInput('alias')))
{
$user_alias = $this->lng->txt('forums_anonymous');
}
else
{
$user_alias = $this->create_topic_form_gui->getInput('alias');
}
}
else
{
$user_alias = $ilUser->getLogin();
}
// build new thread
$newPost = $frm->generateThread(
$topicData['top_pk'],
($this->objProperties->isAnonymized() ? 0 : $ilUser->getId()),
$this->handleFormInput($this->create_topic_form_gui->getInput('subject'), false),
ilRTE::_replaceMediaObjectImageSrc($this->create_topic_form_gui->getInput('message'), 0),
$this->create_topic_form_gui->getItemByPostVar('notify') ? (int)$this->create_topic_form_gui->getInput('notify') : 0,
$this->create_topic_form_gui->getItemByPostVar('notify_posts') ? (int)$this->create_topic_form_gui->getInput('notify_posts') : 0,
$user_alias
);
$file = $_FILES['userfile'];
// file upload
if(is_array($file) && !empty($file))
{
$tmp_file_obj =& new ilFileDataForum($forumObj->getId(), $newPost);
$tmp_file_obj->storeUploadedFile($file);
}
// Visit-Counter
$frm->setDbTable('frm_data');
$frm->setMDB2WhereCondition('top_pk = %s ', array('integer'), array($topicData['top_pk']));
$frm->updateVisits($topicData['top_pk']);
$frm->setMDB2WhereCondition('thr_top_fk = %s AND thr_subject = %s AND thr_num_posts = 1 ',
array('integer', 'text'), array($topicData['top_pk'], $this->create_topic_form_gui->getInput('subject')));
// copy temporary media objects (frm~)
include_once 'Services/MediaObjects/classes/class.ilObjMediaObject.php';
$mediaObjects = ilRTE::_getMediaObjects($this->create_topic_form_gui->getInput('message'), 0);
foreach($mediaObjects as $mob)
{
{
ilObjMediaObject::_removeUsage($mob, 'frm~:html', $ilUser->getId());
ilObjMediaObject::_saveUsage($mob, 'frm:html', $newPost);
}
}
if(!$a_prevent_redirect)
{
ilUtil::sendSuccess($this->lng->txt('forums_thread_new_entry'), true);
$this->ctrl->redirect($this);
}
else
{
return $newPost;
}
}
else
{
$this->create_topic_form_gui->setValuesByPost();
return $this->tpl->setContent($this->create_topic_form_gui->getHTML());
}
}

+ Here is the call graph for this function:

ilObjForumGUI::askForPostActivationObject ( )

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

References $_GET, setDisplayConfirmPostActivation(), and viewThreadObject().

{
global $ilAccess;
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))
{
}
$this->viewThreadObject();
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::cancelMoveThreadsObject ( )

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

References $_SESSION, and ilObjectGUI\$lng.

{
global $ilAccess;
if (!$ilAccess->checkAccess('moderate_frm', '', $this->object->getRefId()))
{
$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
unset($_SESSION['threads2move']);
unset($_SESSION['forums_search_submitted']);
unset($_SESSION['frm_topic_paste_expand']);
$this->ctrl->redirect($this, 'showThreads');
return true;
}
ilObjForumGUI::cancelObject (   $in_rep = false)

cancel action and go back to previous page public

Reimplemented from ilObjectGUI.

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

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

{
ilUtil::sendInfo($this->lng->txt('msg_cancel'), true);
ilUtil::redirect('repository.php?cmd=frameset&ref_id='.$_GET['ref_id']);
}

+ Here is the call graph for this function:

ilObjForumGUI::cancelPostActivationObject ( )

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

References viewThreadObject().

{
$this->viewThreadObject();
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::cancelPostObject ( )

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

References $_GET, and viewThreadObject().

{
$_GET['action'] = '';
$this->viewThreadObject();
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::checkEnableColumnEdit ( )

No editing allowd in forums.

Notifications only.

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

{
return false;
}
ilObjForumGUI::cloneWizardPageObject ( )

Show selection of starting threads.

public

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

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

{
global $ilObjDataCache;
if (!$_POST['clone_source'])
{
ilUtil::sendInfo($this->lng->txt('select_one'));
if (isset($_SESSION['wizard_search_title']))
{
}
else
{
$this->createObject();
}
return false;
}
$source_id = $_POST['clone_source'];
$this->lng->loadLanguageModule('frm');
$new_type = $_REQUEST['new_type'];
$this->ctrl->setParameter($this, 'clone_source', (int) $_POST['clone_source']);
$this->ctrl->setParameter($this, 'new_type', $new_type);
$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.frm_wizard_page.html', 'Modules/Forum');
$this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
$this->tpl->setVariable('TYPE_IMG', ilUtil::getImagePath('icon_'.$new_type.'.gif'));
$this->tpl->setVariable('ALT_IMG', $this->lng->txt('obj_'.$new_type));
$this->tpl->setVariable('TXT_DUPLICATE', $this->lng->txt('frm_wizard_page'));
$this->tpl->setVariable('INFO_THREADS', $this->lng->txt('fmr_copy_threads_info'));
$this->tpl->setVariable('THREADS', $this->lng->txt('forums_threads'));
$forum_id = $ilObjDataCache->lookupObjId((int) $_POST['clone_source']);
include_once('Modules/Forum/classes/class.ilForum.php');
$threads = ilForum::_getThreads($forum_id, ilForum::SORT_TITLE);
foreach ($threads as $thread_id => $title)
{
$this->tpl->setCurrentBlock('thread_row');
$this->tpl->setVariable('CHECK_THREAD', ilUtil::formCheckbox(0, 'cp_options['.$source_id.'][threads][]', $thread_id));
$this->tpl->setVariable('NAME_THREAD', $title);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setVariable('SELECT_ALL', $this->lng->txt('select_all'));
$this->tpl->setVariable('JS_FIELD', 'cp_options['.$source_id.'][threads]');
$this->tpl->setVariable('BTN_COPY', $this->lng->txt('obj_'.$new_type.'_duplicate'));
if (isset($_SESSION['wizard_search_title']))
{
$this->tpl->setVariable('BACK_CMD', 'searchCloneSource');
}
else
{
$this->tpl->setVariable('BACK_CMD', 'create');
}
$this->tpl->setVariable('BTN_BACK', $this->lng->txt('btn_back'));
}

+ Here is the call graph for this function:

ilObjForumGUI::confirmDeleteThreads ( )

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

References $_GET, $_POST, ilObjectGUI\$lng, ilForumTopic\_lookupTitle(), hideToolbar(), ilUtil\sendInfo(), and showThreadsObject().

Referenced by performThreadsActionObject().

{
global $ilAccess;
if(!is_array($_POST['thread_ids']))
{
ilUtil::sendInfo($this->lng->txt('select_at_least_one_thread'));
return $this->showThreadsObject();
}
if(!$ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))
{
$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
return $this->showThreadsObject();
}
include_once('Services/Utilities/classes/class.ilConfirmationGUI.php');
$c_gui = new ilConfirmationGUI();
$c_gui->setFormAction($this->ctrl->getFormAction($this, 'performDeleteThreads'));
$c_gui->setHeaderText($this->lng->txt('frm_sure_delete_threads'));
$c_gui->setCancel($this->lng->txt('cancel'), 'showThreads');
$c_gui->setConfirm($this->lng->txt('confirm'), 'performDeleteThreads');
foreach((array)$_POST['thread_ids'] as $thread_id)
{
$c_gui->addItem('thread_ids[]', $thread_id, ilForumTopic::_lookupTitle($thread_id));
}
$this->confirmation_gui_html = $c_gui->getHTML();
$this->hideToolbar(true);
return $this->showThreadsObject();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjForumGUI::confirmMoveThreadsObject ( )

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

References $_POST, ilObjectGUI\$lng, hideToolbar(), moveThreadsObject(), and ilUtil\sendInfo().

{
global $lng, $ilAccess;
if (!$ilAccess->checkAccess('moderate_frm', '', $this->object->getRefId()))
{
$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
if (! (is_numeric($_POST['frm_ref_id']) && $_POST['frm_ref_id'] > 0))
{
ilUtil::sendInfo($lng->txt('no_forum_selected'));
return true;
}
$this->hideToolbar(true);
$this->moveThreadsObject(true);
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::copyWizardHasOptions (   $a_mode)

public

Parameters

Reimplemented from ilObjectGUI.

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

{
switch($a_mode)
{
case self::COPY_WIZARD_NEEDS_PAGE:
return true;
default:
return false;
}
}
ilObjForumGUI::createObject (   $subbmitted_form = '')

creation form

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

References $_GET, $_POST, ilMainMenuGUI\_checkAdministrationPermission(), ilObjectGUI\fillCloneTemplate(), initForumCreateForm(), initForumImportForm(), and setForumCreateDefaultValues().

{
global $rbacsystem;
$new_type = $_POST['new_type'] ? $_POST['new_type'] : $_GET['new_type'];
if(!$rbacsystem->checkAccess('create', $_GET['ref_id'], $new_type))
{
$this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.frm_create.html', 'Modules/Forum');
// create form
if($this->create_form_gui === null)
$this->initForumCreateForm($new_type);
if($subbmitted_form == 'create')
$this->create_form_gui->setValuesByPost();
else
$this->tpl->setVariable('CREATE_FORM', $this->create_form_gui->getHTML());
// show ilias 2 forum import for administrators only
include_once 'Services/MainMenu/classes/class.ilMainMenuGUI.php';
{
if($this->import_form_gui === null)
$this->initForumImportForm($new_type);
$this->tpl->setVariable('IMPORT_FORM', $this->import_form_gui->getHTML());
}
$this->fillCloneTemplate('DUPLICATE','frm');
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::createThreadObject ( )

New Thread form.

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

References $_GET, ilObjectGUI\$lng, initTopicCreateForm(), and setTopicCreateDefaultValues().

{
global $rbacsystem, $ilAccess, $lng;
if(!$ilAccess->checkAccess('add_thread,add_post', '', (int)$_GET['ref_id']))
{
$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
$this->tpl->setContent($this->create_topic_form_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjForumGUI::disableForumNotificationObject ( )

Disable forum notification.

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

References $_GET, and showThreadsObject().

{
global $ilUser;
$forumObj = new ilObjForum($_GET['ref_id']);
$frm =& $forumObj->Forum;
$frm->setForumId($forumObj->getId());
$frm->disableForumNotification($ilUser->getId());
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::displayConfirmPostActivation ( )

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

References $display_confirm_post_activation.

Referenced by viewThreadObject().

+ Here is the caller graph for this function:

ilObjForumGUI::doReloadTreeObject ( )

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

References reloadTree(), and viewThreadObject().

{
$this->reloadTree(true);
$this->viewThreadObject();
}

+ Here is the call graph for this function:

ilObjForumGUI::editObject ( )

edit object

public

Reimplemented from ilObjectGUI.

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

References $_GET, $ilSetting, ilRadioGroupInputGUI\addOption(), ilTextInputGUI\setValue(), ilCheckboxInputGUI\setValue(), and ilTextAreaInputGUI\setValue().

Referenced by updateObject().

{
global $ilAccess, $ilSetting;
if (!$ilAccess->checkAccess('write', '', $_GET['ref_id']))
{
$this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, 'update'));
$form->setTitle($this->lng->txt('edit_properties'));
$ti_prop = new ilTextInputGUI($this->lng->txt('title'), 'title');
$ti_prop->setValue($this->object->getTitle());
$form->addItem($ti_prop);
$tai_prop = new ilTextAreaInputGUI($this->lng->txt('desc'), 'desc');
$tai_prop->setValue($this->object->getLongDescription());
$tai_prop->setRows(5);
$tai_prop->setCols(50);
$form->addItem($tai_prop);
$rg_pro = new ilRadioGroupInputGUI($this->lng->txt('frm_default_view'), 'default_view');
$rg_pro->addOption(new ilRadioOption($this->lng->txt('order_by').' '.$this->lng->txt('answers'), '1'));
$rg_pro->addOption(new ilRadioOption($this->lng->txt('order_by').' '.$this->lng->txt('date'), '2'));
$rg_pro->setValue($this->objProperties->getDefaultView());
$form->addItem($rg_pro);
if (!$ilSetting->get('disable_anonymous_fora') || $this->objProperties->isAnonymized())
{
$cb_prop = new ilCheckboxInputGUI($this->lng->txt('frm_anonymous_posting'), 'anonymized');
$cb_prop->setValue('1');
$cb_prop->setInfo($this->lng->txt('frm_anonymous_posting_desc'));
$cb_prop->setChecked($this->objProperties->isAnonymized() ? 1 : 0);
$form->addItem($cb_prop);
}
if ($ilSetting->get('enable_fora_statistics', false))
{
$cb_prop = new ilCheckboxInputGUI($this->lng->txt('frm_statistics_enabled'), 'statistics_enabled');
$cb_prop->setValue('1');
$cb_prop->setInfo($this->lng->txt('frm_statistics_enabled_desc'));
$cb_prop->setChecked($this->objProperties->isStatisticEnabled() ? 1 : 0);
$form->addItem($cb_prop);
}
$cb_prop = new ilCheckboxInputGUI($this->lng->txt('activate_new_posts'), 'post_activation');
$cb_prop->setValue('1');
$cb_prop->setInfo($this->lng->txt('post_activation_desc'));
$cb_prop->setChecked($this->objProperties->isPostActivationEnabled() ? 1 : 0);
$form->addItem($cb_prop);
$form->addCommandButton('update', $this->lng->txt('save'));
$this->tpl->setVariable('ADM_CONTENT', $form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjForumGUI::enableForumNotificationObject ( )

Show Notification Tab.

Enable forum notification.

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

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

{
global $ilUser;
$forumObj = new ilObjForum($_GET['ref_id']);
$frm =& $forumObj->Forum;
$frm->setForumId($forumObj->getId());
$frm->enableForumNotification($ilUser->getId());
ilUtil::sendInfo($this->lng->txt('forums_forum_notification_enabled'));
return true;
}

+ Here is the call graph for this function:

& ilObjForumGUI::executeCommand ( )

Execute Command.

Reimplemented from ilObjectGUI.

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

References $_GET, $_POST, $cmd, $ilCtrl, $ret, exit, ilObjectGUI\getCreationMode(), infoScreen(), ilObjectGUI\prepareOutput(), and showThreadsObject().

Referenced by performThreadsActionObject().

{
global $ilNavigationHistory, $ilAccess, $ilCtrl;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$exclude_cmds = array('showExplorer', 'viewThread',
'showThreadNotification',
'cancelPostActivation', 'cancelPostDeactivation',
'performPostActivation', 'performPostDeactivation', 'performPostAndChildPostsActivation',
'askForPostActivation', 'askForPostDeactivation',
'toggleThreadNotification', 'toggleThreadNotificationTab',
'toggleStickiness', 'cancelPost', 'savePost', 'quotePost', 'getQuotationHTMLAsynch',
'doReloadTree'
);
if (!is_array($exclude_cmds) || !in_array($cmd, $exclude_cmds))
{
$this->prepareOutput();
}
// add entry to navigation history
if (!$this->getCreationMode() &&
$ilAccess->checkAccess('read', '', $_GET['ref_id']))
{
$ilNavigationHistory->addItem($_GET['ref_id'], 'repository.php?cmd=showThreads&ref_id='.$_GET['ref_id'], 'frm');
}
switch ($next_class)
{
case 'ilpermissiongui':
require_once('Services/AccessControl/classes/class.ilPermissionGUI.php');
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
case 'ilforumexportgui':
require_once('./Modules/Forum/classes/class.ilForumExportGUI.php');
$fex_gui =& new ilForumExportGUI($this);
$ret =& $this->ctrl->forwardCommand($fex_gui);
exit();
break;
case 'ilforummoderatorsgui':
require_once 'Modules/Forum/classes/class.ilForumModeratorsGUI.php';
$fm_gui = new ilForumModeratorsGUI($this);
$ret = $this->ctrl->forwardCommand($fm_gui);
exit();
break;
case 'ilinfoscreengui':
//$this->prepareOutput();
$this->infoScreen();
break;
case 'ilcolumngui':
break;
case 'ilpublicuserprofilegui':
include_once("./Services/User/classes/class.ilPublicUserProfileGUI.php");
$profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
$ret = $this->ctrl->forwardCommand($profile_gui);
break;
case 'ilobjectcopygui':
include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
$cp = new ilObjectCopyGUI($this);
$cp->setType('frm');
$this->ctrl->forwardCommand($cp);
break;
default:
if($_POST['selected_cmd'] != null)
{
$cmd = 'performThreadsAction';
}
//if (!$cmd )
else if (!$cmd && !$_POST['selected_cmd'] )
{
$cmd = 'showThreads';
}
$cmd .= 'Object';
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjForumGUI::getActivationFormHTML ( )

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

References $_GET, and ilObjectGUI\$lng.

Referenced by viewThreadObject().

{
global $lng;
$form_tpl = new ilTemplate('tpl.frm_activation_post_form.html', true, true, 'Modules/Forum');
$this->ctrl->setParameter($this, 'pos_pk', $this->objCurrentPost->getId());
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentPost->getThreadId());
$this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
$form_tpl->setVariable('FORM_ACTION', $this->ctrl->getFormAction($this, 'performPostActivation'));
$form_tpl->setVariable('SPACER', '<hr noshade="noshade" width="100%" size="1" align="center" />');
$form_tpl->setVariable('ANCHOR', $this->objCurrentPost->getId());
$form_tpl->setVariable('TXT_ACT', $lng->txt('activate_post_txt'));
$form_tpl->setVariable('CONFIRM_BUTTON', $lng->txt('activate_only_current'));
$form_tpl->setVariable('CMD_CONFIRM', 'performPostActivation');
$form_tpl->setVariable('CONFIRM_BRANCH_BUTTON', $lng->txt('activate_current_and_childs'));
$form_tpl->setVariable('CMD_CONFIRM_BRANCH', 'performPostAndChildPostsActivation');
$form_tpl->setVariable('CANCEL_BUTTON',$lng->txt('cancel'));
$form_tpl->setVariable('CMD_CANCEL', 'cancelPostActivation');
$this->ctrl->clearParameters($this);
return $form_tpl->get();
}

+ Here is the caller graph for this function:

ilObjForumGUI::getCensorshipFormHTML ( )

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

References $_GET, and ilObjectGUI\$lng.

Referenced by viewThreadObject().

{
global $lng, $frm;
$form_tpl = new ilTemplate('tpl.frm_censorship_post_form.html', true, true, 'Modules/Forum');
$form_tpl->setVariable('ANCHOR', $this->objCurrentPost->getId());
$form_tpl->setVariable('SPACER', '<hr noshade="noshade" width="100%" size="1" align="center" />');
$this->ctrl->setParameter($this, 'action', 'ready_censor');
$this->ctrl->setParameter($this, 'pos_pk', $this->objCurrentPost->getId());
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentPost->getThreadId());
$this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
$form_tpl->setVariable('FORM_ACTION', $this->ctrl->getLinkTarget($this, 'viewThread'));
$this->ctrl->clearParameters($this);
$form_tpl->setVariable('TXT_CENS_MESSAGE', $lng->txt('forums_the_post'));
$form_tpl->setVariable('TXT_CENS_COMMENT', $lng->txt('forums_censor_comment').':');
$form_tpl->setVariable('CENS_MESSAGE', $frm->prepareText($this->objCurrentPost->getCensorshipComment(), 2));
$form_tpl->setVariable('CANCEL_BUTTON', $lng->txt('cancel'));
$form_tpl->setVariable('CONFIRM_BUTTON', $lng->txt('confirm'));
if ($this->objCurrentPost->isCensored())
{
$form_tpl->setVariable('TXT_CENS', $lng->txt('forums_info_censor2_post'));
$form_tpl->setVariable('CANCEL_BUTTON', $lng->txt('yes'));
$form_tpl->setVariable('CONFIRM_BUTTON', $lng->txt('no'));
}
else
{
$form_tpl->setVariable('TXT_CENS', $lng->txt('forums_info_censor_post'));
}
return $form_tpl->get();
}

+ Here is the caller graph for this function:

ilObjForumGUI::getContent ( )

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

References $_GET, $_POST, $ilDB, ilObjectGUI\$lng, $result, ilUtil\formCheckbox(), ilAccessKeyGUI\getAttribute(), hideToolbar(), ilUtil\Linkbar(), and ilAccessKey\MARK_ALL_READ.

{
global $ilUser, $ilDB, $ilAccess, $lng, $ilToolbar;
if (!$ilAccess->checkAccess('read,visible', '', $this->object->getRefId()))
{
$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
$frm =& $this->object->Forum;
$frm->setForumId($this->object->getId());
$frm->setForumRefId($this->object->getRefId());
$frm->setMDB2Wherecondition('top_frm_fk = %s ', array('integer'), array($frm->getForumId()));
$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.forums_threads_liste.html', 'Modules/Forum');
if((int)strlen($this->confirmation_gui_html))
{
$this->tpl->setVariable('CONFIRMATION_GUI', $this->confirmation_gui_html);
}
include_once("./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
// mark all read
if($ilUser->getId() != ANONYMOUS_USER_ID && !(int)strlen($this->confirmation_gui_html))
{
$ilToolbar->addButton($this->lng->txt('forums_mark_read'),
$this->ctrl->getLinkTarget($this, 'markAllRead'),
);
$this->ctrl->clearParameters($this);
}
if ($ilAccess->checkAccess('add_post', '', $this->object->getRefId()) &&
$ilAccess->checkAccess('add_thread', '', $this->object->getRefId()) &&
!$this->hideToolbar())
{
// button: new topic
$ilToolbar->addButton($this->lng->txt('forums_new_thread'), $this->ctrl->getLinkTarget($this, 'createThread'));
}
// button: enable/disable forum notification
if($ilUser->getId() != ANONYMOUS_USER_ID &&
$this->ilias->getSetting('forum_notification') != 0 &&
!$this->hideToolbar())
{
if($frm->isForumNotificationEnabled($ilUser->getId()))
{
$ilToolbar->addButton($this->lng->txt('forums_disable_forum_notification'), $this->ctrl->getLinkTarget($this, 'disableForumNotification'));
}
else
{
$ilToolbar->addButton($this->lng->txt('forums_enable_forum_notification'), $this->ctrl->getLinkTarget($this, 'enableForumNotification'));
}
}
$topicData = $frm->getOneTopic();
if ($topicData)
{
// Visit-Counter
$frm->setDbTable('frm_data');
$frm->setMDB2WhereCondition('top_pk = %s ', array('integer'), array($topicData['top_pk']));
$frm->updateVisits($topicData['top_pk']);
// get list of threads
$threads = $frm->getAllThreads($topicData['top_pk'], $ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']));
$thrNum = count($threads);
// check number of threads
if ($thrNum != $topicData['top_num_threads'])
{
#$frm->fixThreadNumber($topicData['top_pk'], $thrNum);
}
$pageHits = $frm->getPageHits();
$pageHits = $ilUser->getPref('hits_per_page');
if ($thrNum > 0)
{
$z = 0;
// navigation to browse
if ($thrNum > $pageHits)
{
if (!$_GET['offset'])
{
$Start = 0;
}
else
{
$Start = $_GET['offset'];
}
$linkbar = ilUtil::Linkbar($this->ctrl->getLinkTarget($this), $thrNum, $pageHits, $Start, array());
if ($linkbar != '')
{
$this->tpl->setVariable('LINKBAR', $linkbar);
}
}
// display thread list
$counter = 0;
$this->ctrl->setParameter($this, 'cmd', 'post');
$tbl = new ilTable2GUI($this);
$tbl->setId('il_frm_thread_table_'.(int)$_GET['ref_id']);
$tbl->setFormAction($this->ctrl->getLinkTarget($this, 'showThreads'));
$tbl->setRowTemplate('tpl.forums_threads_table.html', 'Modules/Forum');
$tbl->addColumn('','check', '1');
$tbl->addColumn($this->lng->txt('forums_thread'),'th_title');
$tbl->addColumn($this->lng->txt('forums_created_by'), 'author');
$tbl->addColumn($this->lng->txt('forums_articles'), 'num_posts');
$tbl->addColumn($this->lng->txt('visits'),'num_visit');
$tbl->addColumn($this->lng->txt('forums_last_post'),'lp_date');
foreach ($threads as $thread)
{
if ($thrNum > $pageHits && $z >= ($Start + $pageHits))
{
break;
}
if (($thrNum > $pageHits && $z >= $Start) || $thrNum <= $pageHits)
{
$this->ctrl->setParameter($this, 'thr_pk', $thread->getId());
$result[$counter]['check'] = ilUtil::formCheckbox(
(isset($_POST['thread_ids']) && in_array($thread->getId(), $_POST['thread_ids']) ? true : false), 'thread_ids[]', $thread->getId()
);
$thread->setCreateDate($frm->convertDate($thread->getCreateDate()));
if ($thread->isSticky())
{
$result[$counter]['th_title'] .= '<span class="light">['.$this->lng->txt('sticky').']</span> ';
}
if ($thread->isClosed())
{
$result[$counter]['th_title'] .= '<span class="light">['.$this->lng->txt('topic_close').']</span> ';
}
if($ilUser->getId() != ANONYMOUS_USER_ID &&
$this->ilias->getSetting('forum_notification') != 0 &&
$thread->isNotificationEnabled($ilUser->getId()))
{
$result[$counter]['th_title'] .= '<span class="light">['.$this->lng->txt('forums_notification_enabled').']</span> ';
}
if ($ilAccess->checkAccess('moderate_frm', '', $this->object->getRefId()))
{
$num_posts = $thread->countPosts();
$num_unread = $num_posts - $thread->countReadPosts($ilUser->getId());
$num_new = $thread->countNewPosts($ilUser->getId());
}
else
{
$num_posts = $thread->countActivePosts();
$num_unread = $num_posts - $thread->countReadActivePosts($ilUser->getId());
$num_new = $thread->countNewActivePosts($ilUser->getId());
}
if ($num_posts > 0)
{
$result[$counter]['th_title'] = "<div><a href=\"".
$this->ctrl->getLinkTarget($this, 'showThreadFrameset').
"\">".$thread->getSubject()."</a></div>".$result[$counter]['th_title'];
}
// get author data
if($thread->getUserId())
{
$usr_data = $frm->getUserData($thread->getUserId(), $thread->getImportName());
}
else
{
$usr_data = array(
'usr_id' => 0,
'login' => $thread->getUserAlias(),
'firstname' => '',
'lastname' => '',
'public_profile' => 'n'
);
}
if($thread->getUserId() &&
$thread->getUserId() != ANONYMOUS_USER_ID)
{
$this->ctrl->setParameter($this, 'backurl', urlencode('repository.php?ref_id='.$_GET['ref_id'].'&offset='.$Start));
$this->ctrl->setParameter($this, 'user', $thread->getUserId());
if ($usr_data['public_profile'] == 'n')
{
$result[$counter]['author'] = $usr_data['login'];
}
else
{
$result[$counter]['author'] = "<a href=\"".
$this->ctrl->getLinkTarget($this, 'showUser').
"\">".$usr_data['login']."</a>";
}
$this->ctrl->clearParameters($this);
}
else
{
if(strlen($thread->getUserAlias()))
{
$result[$counter]['author'] = $thread->getUserAlias();
if($thread->getUserId() != ANONYMOUS_USER_ID)
{
$result[$counter]['author'] .= ' ('.$this->lng->txt('frm_pseudonym').')';
}
}
else
{
$result[$counter]['author'] = $this->lng->txt('forums_anonymous');
}
}
$result[$counter]['num_posts'] = $num_posts;
if($ilUser->getId() != ANONYMOUS_USER_ID)
{
if ($num_unread > 0)
{
$result[$counter]['num_posts'].= "<br><span class='alert' style='white-space:nowrap;'>".
$lng->txt("unread").": ".$num_unread."</span>";
}
if ($num_new > 0)
{
$result[$counter]['num_posts'].= "<br><span class='alert' style='white-space:nowrap;'>".
$lng->txt("new").": ".$num_new."</span>";
}
}
$result[$counter]['num_visit'] = $thread->getVisits();
if ($num_posts > 0)
{
if ($ilAccess->checkAccess('moderate_frm', '', $this->object->getRefId()))
{
$objLastPost = $thread->getLastPost();
}
else
{
$objLastPost = $thread->getLastActivePost();
}
if (is_object($objLastPost))
{
$lastPostAuthor = '';
if ($objLastPost->getUserId())
{
$last_usr_data = $frm->getUserData($objLastPost->getUserId(), $objLastPost->getImportName());
$lastPostAuthor = $last_usr_data['login'];
}
else
{
if(strlen($objLastPost->getUserAlias()))
{
$lastPostAuthor = $objLastPost->getUserAlias().' ('.$this->lng->txt('frm_pseudonym').')';
}
else
{
$lastPostAuthor = $this->lng->txt('forums_anonymous');
}
}
$this->ctrl->setParameter($this, 'thr_pk', $objLastPost->getThreadId());
$result[$counter]['lp_date'] = '<div style="white-space:nowrap">'.
$frm->convertDate($objLastPost->getCreateDate())."</div>".
'<div style="white-space:nowrap">'.$this->lng->txt('from').' '."<a href=\"".
$this->ctrl->getLinkTarget($this, 'showThreadFrameset').'#'.$objLastPost->getId().
"\">".$lastPostAuthor."</a></div>";
}
}
}
$counter++;
}
$tbl->disable('sort');
$tbl->setSelectAllCheckbox('thread_ids');
$tbl->setPrefix('frm_threads');
$tbl->setData($result);
$tbl->addMultiCommand('', $this->lng->txt('please_choose'));
$tbl->addMultiCommand('html', $this->lng->txt('export_html'));
if($this->ilias->getSetting('forum_notification') == 1)
{
$tbl->addMultiCommand('disable_notifications', $this->lng->txt('forums_disable_notification'));
$tbl->addMultiCommand('enable_notifications', $this->lng->txt('forums_enable_notification'));
}
if($ilAccess->checkAccess('moderate_frm', '', $this->object->getRefId()))
{
$tbl->addMultiCommand('makesticky', $this->lng->txt('make_topics_sticky'));
$tbl->addMultiCommand('unmakesticky', $this->lng->txt('make_topics_non_sticky'));
$tbl->addMultiCommand('close', $this->lng->txt('close_topics'));
$tbl->addMultiCommand('reopen', $this->lng->txt('reopen_topics'));
$tbl->addMultiCommand('move', $this->lng->txt('move'));
$tbl->addMultiCommand('confirmDeleteThreads', $this->lng->txt('delete'));
}
$this->tpl->setVariable('THREADS_TABLE', $tbl->getHTML());
}
}
// permanent link
include_once 'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php';
$permalink = new ilPermanentLinkGUI('frm', $this->object->getRefId());
$this->tpl->setVariable('PRMLINK', $permalink->getHTML());
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::getDeactivationFormHTML ( )

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

References $_GET, and ilObjectGUI\$lng.

{
global $lng;
$form_tpl = new ilTemplate('tpl.frm_deactivation_post_form.html', true, true, 'Modules/Forum');
$this->ctrl->setParameter($this, 'pos_pk', $this->objCurrentPost->getId());
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentPost->getThreadId());
$this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
$form_tpl->setVariable('FORM_ACTION', $this->ctrl->getFormAction($this, 'performPostDeactivation'));
$form_tpl->setVariable('SPACER', '<hr noshade="noshade" width="100%" size="1" align="center" />');
$form_tpl->setVariable('ANCHOR', $this->objCurrentPost->getId());
$form_tpl->setVariable('TXT_DEACT', $lng->txt('deactivate_post_txt'));
$form_tpl->setVariable('CONFIRM_BUTTON', $lng->txt('deactivate_current_and_childs'));
$form_tpl->setVariable('CMD_CONFIRM', 'performPostDeactivation');
$form_tpl->setVariable('CANCEL_BUTTON',$lng->txt('cancel'));
$form_tpl->setVariable('CMD_CANCEL', 'cancelPostDeactivation');
$this->ctrl->clearParameters($this);
return $form_tpl->get();
}
ilObjForumGUI::getDeleteFormHTML ( )

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

References $_GET, ilObjectGUI\$lng, and ilFrameTargetInfo\_getFrame().

Referenced by viewThreadObject().

{
global $lng;
$form_tpl = new ilTemplate('tpl.frm_delete_post_form.html', true, true, 'Modules/Forum');
$form_tpl->setVariable('ANKER', $this->objCurrentPost->getId());
$form_tpl->setVariable('SPACER', '<hr noshade="noshade" width="100%" size="1" align="center" />');
$form_tpl->setVariable('TXT_DELETE', $lng->txt('forums_info_delete_post'));
$this->ctrl->setParameter($this, 'action', 'ready_delete');
$this->ctrl->setParameter($this, 'pos_pk', $this->objCurrentPost->getId());
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentPost->getThreadId());
$this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
$form_tpl->setVariable('FORM_ACTION', $this->ctrl->getLinkTarget($this, 'showThreadFrameset'));
$this->ctrl->clearParameters($this);
$t_frame = ilFrameTargetInfo::_getFrame('MainContent');
$form_tpl->setVariable('FORM_TARGET', $t_frame);
$form_tpl->setVariable('CANCEL_BUTTON', $lng->txt('cancel'));
$form_tpl->setVariable('CONFIRM_BUTTON', $lng->txt('confirm'));
return $form_tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjForumGUI::getForumObjects ( )
private

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

References $_GET.

Referenced by getQuotationHTMLAsynchObject(), initReplyEditForm(), savePostObject(), and viewThreadObject().

{
if(null === $this->forumObjects)
{
$forumObj = new ilObjForum($_GET['ref_id']);
$file_obj = new ilFileDataForum($forumObj->getId(), $this->objCurrentPost->getId());
$frm = $forumObj->Forum;
$frm->setForumId($forumObj->getId());
$frm->setForumRefId($forumObj->getRefId());
$this->forumObjects['forumObj'] = $forumObj;
$this->forumObjects['frm'] = $frm;
$this->forumObjects['file_obj'] = $file_obj;
}
return $this->forumObjects;
}

+ Here is the caller graph for this function:

ilObjForumGUI::getQuotationHTMLAsynchObject ( )

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

References ilRTE\_replaceMediaObjectImageSrc(), exit, and getForumObjects().

{
$oForumObjects = $this->getForumObjects();
$frm = $oForumObjects['frm'];
$html = ilRTE::_replaceMediaObjectImageSrc($frm->prepareText($this->objCurrentPost->getMessage(), 1, $this->objCurrentPost->getLoginName()), 1);
echo $html;
exit();
}

+ Here is the call graph for this function:

ilObjForumGUI::getReplyEditForm ( )
private

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

References initReplyEditForm().

Referenced by quotePostObject(), savePostObject(), and viewThreadObject().

{
if(null === $this->replyEditForm)
{
}
return $this->replyEditForm;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjForumGUI::getTabs ( $tabs_gui)

get tabs abstract method.

overwrite in derived GUI class of your object type public

Parameters
objectinstance of ilTabsGUI

Reimplemented from ilObjectGUI.

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

References $_GET, and ilRepositoryExplorer\buildLinkTarget().

{
global $ilAccess, $ilUser;
$this->ctrl->setParameter($this, 'ref_id', $this->ref_id);
#if ($ilAccess->checkAccess('write', '', $this->ref_id))
#{
include_once './Services/Repository/classes/class.ilRepositoryExplorer.php';
$active = array('',
'showThreads',
'view',
'markAllRead',
'enableForumNotification',
'disableForumNotification',
'moveThreads',
'performMoveThreads',
'confirmMoveThreads',
'cancelMoveThreads',
'performThreadsAction',
'searchForums',
'createThread',
'addThread',
'showUser'
);
$tabs_gui->addTarget('forums_threads', ilRepositoryExplorer::buildLinkTarget($this->ref_id, 'frm'), $active, '');
#}
if($ilAccess->checkAccess('edit_permission', '', $this->ref_id))
{
$tabs_gui->addTarget('frm_moderators', $this->ctrl->getLinkTargetByClass('ilForumModeratorsGUI', 'showModerators'), 'showModerators', get_class($this), '', $force_active);
}
// info tab
if ($ilAccess->checkAccess('visible', '', $this->ref_id))
{
$force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui"
|| strtolower($_GET["cmdClass"]) == "ilnotegui")
? true
: false;
//echo "-$force_active-";
$tabs_gui->addTarget("info_short",
$this->ctrl->getLinkTargetByClass(
array("ilobjforumgui", "ilinfoscreengui"), "showSummary"),
array("showSummary", "infoScreen"),
"", "", $force_active);
}
if ($ilAccess->checkAccess('write', '', $this->ref_id))
{
$force_active = ($_GET['cmd'] == 'edit') ? true : false;
$tabs_gui->addTarget('edit_properties', $this->ctrl->getLinkTarget($this, 'edit'), 'edit', get_class($this), '', $force_active);
}
if ($this->ilias->getSetting('enable_fora_statistics', false) &&
($this->objProperties->isStatisticEnabled() || $ilAccess->checkAccess('write', '', $this->ref_id)))
{
$tabs_gui->addTarget('frm_statistics', $this->ctrl->getLinkTarget($this, 'showStatistics'), 'showStatistics', get_class($this), '', false);
}
if ($ilAccess->checkAccess('edit_permission', '', $this->ref_id))
{
$tabs_gui->addTarget('perm_settings', $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), 'perm'), array('perm', 'info', 'owner'), 'ilpermissiongui');
}
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::getUserInstance (   $a_usr_id)
private

Caching method for user instances.

private

Parameters
integer$a_usr_idId of a user instance
Returns
ilObjUser or null

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

References ilObjectFactory\getInstanceByObjId().

Referenced by viewThreadObject().

{
static $userObjectCache = array();
if(isset($userObjectCache[$a_usr_id])) return $userObjectCache[$a_usr_id];
$oUser = ilObjectFactory::getInstanceByObjId($a_usr_id, false);
if(!is_object($oUser) || $oUser->getType() != 'usr')
{
$userObjectCache[$a_usr_id] = null;
}
else
{
$userObjectCache[$a_usr_id] = $oUser;
}
return $userObjectCache[$a_usr_id];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Handle subject and message text input.

< and > are escaped because HTML is not allowed.

Parameters
string$a_textinput text

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

References ilUtil\stripSlashes().

Referenced by addThreadObject(), savePostObject(), and viewThreadObject().

{
$a_text = str_replace("<", "&lt;", $a_text);
$a_text = str_replace(">", "&gt;", $a_text);
if($a_stripslashes)
$a_text = ilUtil::stripSlashes($a_text);
return $a_text;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjForumGUI::hideToolbar (   $a_flag = null)
private

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

References $hideToolbar.

Referenced by confirmDeleteThreads(), confirmMoveThreadsObject(), getContent(), and moveThreadsObject().

{
if(null === $a_flag)
{
}
$this->hideToolbar = $a_flag;
return $this;
}

+ Here is the caller graph for this function:

ilObjForumGUI::ilObjForumGUI (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

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

References $_GET, $ilCtrl, ilForumProperties\getInstance(), ilObjectGUI\ilObjectGUI(), and ilUtil\stripSlashes().

{
global $ilCtrl, $ilUser, $ilAccess;
// CONTROL OPTIONS
$this->ctrl =& $ilCtrl;
$this->ctrl->saveParameter($this, array('ref_id', 'cmdClass'));
$this->type = 'frm';
$this->ilObjectGUI($a_data, $a_id, $a_call_by_reference, false);
$this->lng->loadLanguageModule('forum');
$properties_obj_id = is_object($this->object) ? $this->object->getId() : 0;
// forum properties
$this->objProperties = ilForumProperties::getInstance($properties_obj_id);
// data of current post
$this->objCurrentTopic = new ilForumTopic(ilUtil::stripSlashes((int)$_GET['thr_pk']), $ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']));
// data of current topic/thread
$this->objCurrentPost = new ilForumPost(ilUtil::stripSlashes((int)$_GET['pos_pk']), $ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']));
}

+ Here is the call graph for this function:

ilObjForumGUI::infoScreen ( )

show information screen

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

References $_GET.

Referenced by executeCommand(), and infoScreenObject().

{
global $ilAccess;
if (!$ilAccess->checkAccess("visible", "", $this->ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
}
include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
{
//$info->enableNews();
}
// no news editing for files, just notifications
// $info->enableNewsEditing(false);
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
{
// $news_set = new ilSetting("news");
// $enable_internal_rss = $news_set->get("enable_rss_for_internal");
// if ($enable_internal_rss)
// {
// $info->setBlockProperty("news", "settings", true);
// $info->setBlockProperty("news", "public_notifications_option", true);
// }
}
// standard meta data
$info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
// forward the command
$this->ctrl->forwardCommand($info);
}

+ Here is the caller graph for this function:

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

References infoScreen().

{
$this->ctrl->setCmd("showSummary");
$this->ctrl->setCmdClass("ilinfoscreengui");
$this->infoScreen();
}

+ Here is the call graph for this function:

ilObjForumGUI::initForumCreateForm (   $object_type)
private

private

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

References ilUtil\getImagePath(), ilTextAreaInputGUI\setCols(), ilFormPropertyGUI\setInfo(), ilTextInputGUI\setMaxLength(), and ilCheckboxInputGUI\setValue().

Referenced by createObject(), and saveObject().

{
$this->create_form_gui = new ilPropertyFormGUI();
$this->create_form_gui->setTitle($this->lng->txt('frm_new'));
$this->create_form_gui->setTitleIcon(ilUtil::getImagePath('icon_frm.gif'));
// form action
$this->ctrl->setParameter($this, 'new_type', $object_type);
$this->create_form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
// title
$title_gui = new ilTextInputGUI($this->lng->txt('title'), 'title');
$title_gui->setMaxLength(128);
$this->create_form_gui->addItem($title_gui);
// description
$description_gui = new ilTextAreaInputGUI($this->lng->txt('desc'), 'desc');
$description_gui->setCols(40);
$description_gui->setRows(2);
$this->create_form_gui->addItem($description_gui);
// view
$view_group_gui = new ilRadioGroupInputGUI($this->lng->txt('frm_default_view'), 'sort');
$view_hir = new ilRadioOption($this->lng->txt('order_by').' '.$this->lng->txt('answers'), 1);
$view_group_gui->addOption($view_hir);
$view_dat = new ilRadioOption($this->lng->txt('order_by').' '.$this->lng->txt('date'), 2);
$view_group_gui->addOption($view_dat);
$this->create_form_gui->addItem($view_group_gui);
// anonymized or not
$anonymize_gui = new ilCheckboxInputGUI($this->lng->txt('frm_anonymous_posting'), 'anonymized');
$anonymize_gui->setInfo($this->lng->txt('frm_anonymous_posting_desc'));
$anonymize_gui->setValue(1);
if($this->ilias->getSetting('disable_anonymous_fora', true))
$anonymize_gui->setDisabled(true);
$this->create_form_gui->addItem($anonymize_gui);
// statistics enabled or not
$statistics_gui = new ilCheckboxInputGUI($this->lng->txt('frm_statistics_enabled'), 'statistics_enabled');
$statistics_gui->setInfo($this->lng->txt('frm_statistics_enabled_desc'));
$statistics_gui->setValue(1);
if(!$this->ilias->getSetting('enable_fora_statistics', false))
$statistics_gui->setDisabled(true);
$this->create_form_gui->addItem($statistics_gui);
$cb_prop = new ilCheckboxInputGUI($this->lng->txt('activate_new_posts'), 'post_activation');
$cb_prop->setValue('1');
$cb_prop->setInfo($this->lng->txt('post_activation_desc'));
$this->create_form_gui->addItem($cb_prop);
$this->create_form_gui->addCommandButton('save', $this->lng->txt('save'));
$this->create_form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjForumGUI::initForumImportForm (   $object_type)
private

private

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

References ilUtil\getImagePath(), and ilFormPropertyGUI\setRequired().

Referenced by createObject(), and performImportObject().

{
$this->import_form_gui = new ilPropertyFormGUI();
$this->import_form_gui->setTitle($this->lng->txt('forum_import').' (ILIAS 2)');
$this->import_form_gui->setTitleIcon(ilUtil::getImagePath('icon_frm.gif'));
// form action
$this->ctrl->setParameter($this, 'new_type', $object_type);
$this->import_form_gui->setFormAction($this->ctrl->getFormAction($this, 'performImport'));
// file
$in_file = new ilFileInputGUI($this->lng->txt('forum_import_file'), 'importFile');
$in_file->setRequired(true);
$this->import_form_gui->addItem($in_file);
$this->import_form_gui->addCommandButton('performImport', $this->lng->txt('import'));
$this->import_form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjForumGUI::initReplyEditForm ( )
private

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

References $_GET, $_POST, $file, ilHtmlPurifierFactory\_getInstanceByType(), ilObjAdvancedEditing\_getRichTextEditorUserState(), ilRTE\_getRTEClassname(), ilObjAdvancedEditing\_setRichTextEditorUserState(), getForumObjects(), ilFileWizardInputGUI\setFilenames(), ilTextInputGUI\setMaxLength(), and ilFormPropertyGUI\setRequired().

Referenced by getReplyEditForm().

{
global $ilUser, $rbacsystem;
// init objects
$oForumObjects = $this->getForumObjects();
$forumObj = $oForumObjects['forumObj'];
$frm = $oForumObjects['frm'];
$oFDForum = $oForumObjects['file_obj'];
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$this->replyEditForm = new ilPropertyFormGUI();
$this->replyEditForm->setTableWidth('100%');
// titel
if($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply')
{
$this->ctrl->setParameter($this, 'action', 'ready_showreply');
}
else
{
$this->ctrl->setParameter($this, 'action', 'ready_showedit');
}
// form action
$this->ctrl->setParameter($this, 'pos_pk', $this->objCurrentPost->getId());
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentPost->getThreadId());
$this->ctrl->setParameter($this, 'offset', (int)$_GET['offset']);
$this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
$this->replyEditForm->setFormAction($this->ctrl->getFormAction($this, 'savePost', $this->objCurrentPost->getId()));
$this->ctrl->clearParameters($this);
if($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply')
{
$this->replyEditForm->setTitle($this->lng->txt('forums_your_reply'));
}
else
{
$this->replyEditForm->setTitle($this->lng->txt('forums_edit_post'));
}
// alias
if($this->objProperties->isAnonymized() &&
in_array($_GET['action'], array('showreply', 'ready_showreply')))
{
$oAnonymousNameGUI = new ilTextInputGUI($this->lng->txt('forums_your_name'), 'alias');
$oAnonymousNameGUI->setMaxLength(64);
$oAnonymousNameGUI->setInfo($this->lng->txt('forums_use_alias'));
$this->replyEditForm->addItem($oAnonymousNameGUI);
}
// subject
$oSubjectGUI = new ilTextInputGUI($this->lng->txt('forums_subject'), 'subject');
$oSubjectGUI->setMaxLength(64);
$oSubjectGUI->setRequired(true);
$this->replyEditForm->addItem($oSubjectGUI);
// post
$oPostGUI = new ilTextAreaInputGUI(
$_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply' ? $this->lng->txt('forums_your_reply') : $this->lng->txt('forums_edit_post'),
'message'
);
$oPostGUI->setRequired(true);
$oPostGUI->setCols(50);
$oPostGUI->setRows(15);
$oPostGUI->setUseRte(true);
$oPostGUI->addPlugin('latex');
$oPostGUI->addButton('latex');
$oPostGUI->addButton('pastelatex');
$oPostGUI->addPlugin('ilfrmquote');
if($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply')
{
$oPostGUI->addButton('ilFrmQuoteAjaxCall');
}
$oPostGUI->removePlugin('advlink');
$oPostGUI->setRTERootBlockElement('');
$oPostGUI->usePurifier(true);
$oPostGUI->disableButtons(array(
'removeformat',
'charmap',
'undo',
'redo',
'justifyleft',
'justifycenter',
'justifyright',
'justifyfull',
'anchor',
'code',
'fullscreen',
'cut',
'copy',
'paste',
'pastetext',
'pasteword',
'formatselect'
));
if($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply')
{
$oPostGUI->setRTESupport($ilUser->getId(), 'frm~', 'frm_post', 'tpl.tinymce_frm_post.html');
}
else
{
$oPostGUI->setRTESupport($this->objCurrentPost->getId(), 'frm', 'frm_post', 'tpl.tinymce_frm_post.html');
}
// purifier
require_once 'Services/Html/classes/class.ilHtmlPurifierFactory.php';
$oPostGUI->setPurifier(ilHtmlPurifierFactory::_getInstanceByType('frm_post'));
$this->replyEditForm->addItem($oPostGUI);
// notification only if gen. notification is disabled and forum isn't anonymous
include_once 'Services/Mail/classes/class.ilMail.php';
$umail = new ilMail($ilUser->getId());
if($rbacsystem->checkAccess('mail_visible', $umail->getMailObjectReferenceId()) &&
!$frm->isThreadNotificationEnabled($ilUser->getId(), $this->objCurrentPost->getThreadId()) &&
!$this->objProperties->isAnonymized())
{
$oNotificationGUI = new ilCheckboxInputGUI('', 'notify');
$oNotificationGUI->setInfo($this->lng->txt('forum_notify_me'));
$this->replyEditForm->addItem($oNotificationGUI);
}
// attachments
$oFileUploadGUI = new ilFileWizardInputGUI($this->lng->txt('forums_attachments_add'), 'userfile');
$oFileUploadGUI->setFilenames(array(0 => ''));
$this->replyEditForm->addItem($oFileUploadGUI);
// edit attachments
if(count($oFDForum->getFilesOfPost()) && ($_GET['action'] == 'showedit' || $_GET['action'] == 'ready_showedit'))
{
$oExistingAttachmentsGUI = new ilCheckboxGroupInputGUI($this->lng->txt('forums_delete_file'), 'del_file');
foreach($oFDForum->getFilesOfPost() as $file)
{
$oAttachmentGUI = new ilCheckboxInputGUI($file['name'], 'del_file');
$oAttachmentGUI->setValue($file['md5']);
$oExistingAttachmentsGUI->addOption($oAttachmentGUI);
}
$this->replyEditForm->addItem($oExistingAttachmentsGUI);
}
// buttons
$this->replyEditForm->addCommandButton('savePost', $this->lng->txt('submit'));
if($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply')
{
include_once 'Services/RTE/classes/class.ilRTE.php';
$rtestring = ilRTE::_getRTEClassname();
if (array_key_exists('show_rte', $_POST))
{
}
if(strtolower($rtestring) != 'iltinymce' || !ilObjAdvancedEditing::_getRichTextEditorUserState())
{
$this->replyEditForm->addCommandButton('quotePost', $this->lng->txt('forum_add_quote'));
}
}
$this->replyEditForm->addCommandButton('cancelPost', $this->lng->txt('cancel'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjForumGUI::initTopicCreateForm ( )
private

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

References ilObjectGUI\$ilias, ilHtmlPurifierFactory\_getInstanceByType(), ilUtil\getImagePath(), ilTextAreaInputGUI\setCols(), ilFileWizardInputGUI\setFilenames(), ilFormPropertyGUI\setInfo(), ilTextInputGUI\setMaxLength(), and ilNonEditableValueGUI\setValue().

Referenced by addThreadObject(), and createThreadObject().

{
global $ilUser, $rbacsystem, $ilias;
$this->create_topic_form_gui = new ilPropertyFormGUI();
$this->create_topic_form_gui->setTitle($this->lng->txt('forums_new_thread'));
$this->create_topic_form_gui->setTitleIcon(ilUtil::getImagePath('icon_frm.gif'));
$this->create_topic_form_gui->setTableWidth('100%');
// form action
$this->create_topic_form_gui->setFormAction($this->ctrl->getFormAction($this, 'addThread'));
if($this->objProperties->isAnonymized())
{
$alias_gui = new ilTextInputGUI($this->lng->txt('forums_your_name'), 'alias');
$alias_gui->setInfo($this->lng->txt('forums_use_alias'));
$alias_gui->setMaxLength(255);
$alias_gui->setSize(50);
$this->create_topic_form_gui->addItem($alias_gui);
}
else
{
$alias_gui = new ilNonEditableValueGUI($this->lng->txt('forums_your_name', 'alias'));
$alias_gui->setValue($ilUser->getLogin());
$this->create_topic_form_gui->addItem($alias_gui);
}
// topic
$subject_gui = new ilTextInputGUI($this->lng->txt('forums_thread'), 'subject');
$subject_gui->setMaxLength(255);
$subject_gui->setSize(50);
$subject_gui->setRequired(true);
$this->create_topic_form_gui->addItem($subject_gui);
// message
$post_gui = new ilTextAreaInputGUI($this->lng->txt('forums_the_post'), 'message');
$post_gui->setCols(50);
$post_gui->setRows(15);
$post_gui->setRequired(true);
$post_gui->setUseRte(true);
$post_gui->addPlugin('latex');
$post_gui->addButton('latex');
$post_gui->addButton('pastelatex');
$post_gui->addPlugin('ilfrmquote');
$post_gui->removePlugin('advlink');
$post_gui->usePurifier(true);
$post_gui->setRTERootBlockElement('');
$post_gui->setRTESupport($ilUser->getId(), 'frm~', 'frm_post', 'tpl.tinymce_frm_post.html');
$post_gui->disableButtons(array(
'removeformat',
'charmap',
'undo',
'redo',
'justifyleft',
'justifycenter',
'justifyright',
'justifyfull',
'anchor',
'code',
'fullscreen',
'cut',
'copy',
'paste',
'pastetext',
'pasteword',
'formatselect'
));
// purifier
require_once 'Services/Html/classes/class.ilHtmlPurifierFactory.php';
$post_gui->setPurifier(ilHtmlPurifierFactory::_getInstanceByType('frm_post'));
$this->create_topic_form_gui->addItem($post_gui);
// file
$fi = new ilFileWizardInputGUI($this->lng->txt('forums_attachments_add'), 'userfile');
$fi->setFilenames(array(0 => ''));
$this->create_topic_form_gui->addItem($fi);
include_once 'Services/Mail/classes/class.ilMail.php';
$umail = new ilMail($ilUser->getId());
// catch hack attempts
if ($rbacsystem->checkAccess('mail_visible', $umail->getMailObjectReferenceId()) &&
!$this->objProperties->isAnonymized())
{
// direct notification
$dir_notification_gui = new ilCheckboxInputGUI($this->lng->txt('forum_direct_notification'), 'notify');
$dir_notification_gui->setInfo($this->lng->txt('forum_notify_me_directly'));
$dir_notification_gui->setValue(1);
$this->create_topic_form_gui->addItem($dir_notification_gui);
if($ilias->getSetting('forum_notification') != 0)
{
// gen. notification
$gen_notification_gui = new ilCheckboxInputGUI($this->lng->txt('forum_general_notification'), 'notify_posts');
$gen_notification_gui->setInfo($this->lng->txt('forum_notify_me_generally'));
$gen_notification_gui->setValue(1);
$this->create_topic_form_gui->addItem($gen_notification_gui);
}
}
$this->create_topic_form_gui->addCommandButton('addThread', $this->lng->txt('save'));
$this->create_topic_form_gui->addCommandButton('showThreads', $this->lng->txt('cancel'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjForumGUI::markAllReadObject ( )

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

References ilUtil\sendInfo(), and showThreadsObject().

{
global $ilUser;
$this->object->markAllThreadsRead($ilUser->getId());
ilUtil::sendInfo($this->lng->txt('forums_all_threads_marked_read'));
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::moveThreadsObject (   $confirm = false)

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

References $_GET, $_POST, $_SESSION, $ilDB, ilObjectGUI\$lng, $objCurrentTopic, $result, ilObjectGUI\$tree, ilForumTopic\_lookupTitle(), hideToolbar(), ilUtil\sendInfo(), and ilExplorer\setExpandTarget().

Referenced by confirmMoveThreadsObject(), performMoveThreadsObject(), performThreadsActionObject(), and searchForumsObject().

{
global $ilAccess, $lng, $ilDB, $tree, $ilObjDataCache, $ilToolbar;
if (!$ilAccess->checkAccess('moderate_frm', '', $this->object->getRefId()))
{
$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
$threads2move = $_SESSION['threads2move'];
if(empty($threads2move))
{
ilUtil::sendInfo($this->lng->txt('select_at_least_one_thread'), true);
$this->ctrl->redirect($this, 'showThreads');
}
require_once 'Services/Table/classes/class.ilTable2GUI.php';
$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.forums_threads_move.html', 'Modules/Forum');
if($confirm)
{
include_once('Services/Utilities/classes/class.ilConfirmationGUI.php');
$c_gui = new ilConfirmationGUI();
$c_gui->setFormAction($this->ctrl->getFormAction($this, 'performMoveThreads'));
$c_gui->setHeaderText($this->lng->txt('sure_move_threads'));
$c_gui->setCancel($this->lng->txt('cancel'), 'cancelMoveThreads');
$c_gui->setConfirm($this->lng->txt('confirm'), 'performMoveThreads');
foreach($threads2move as $thr_pk)
{
$c_gui->addItem('thread_ids[]', $thr_pk, ilForumTopic::_lookupTitle($thr_pk));
}
$c_gui->addHiddenItem('frm_ref_id', $_POST['frm_ref_id']);
$this->tpl->setVariable('CONFIRM_TABLE', $c_gui->getHTML());
}
if(!$this->hideToolbar())
$ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this));
$tblThr = new ilTable2GUI($this);
$tblThr->setId('il_frm_thread_move_table_'.(int)$_GET['frm_ref_id']);
$tblThr->setTitle($this->lng->txt('move_chosen_topics'));
$tblThr->addColumn($this->lng->txt('subject'), 'top_name', '100%');
$tblThr->disable('header');
$tblThr->disable('footer');
$tblThr->disable('linkbar');
$tblThr->disable('sort');
$tblThr->disable('linkbar');
$tblThr->setLimit(0);
$tblThr->setRowTemplate('tpl.forums_threads_move_thr_row.html', 'Modules/Forum');
$tblThr->setDefaultOrderField('is_sticky');
$counter = 0;
foreach ($threads2move as $thr_pk)
{
$objCurrentTopic = new ilForumTopic($thr_pk, $ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']));
$result[$counter]['num'] = $counter + 1;
$result[$counter]['thr_subject'] = $objCurrentTopic->getSubject();
++$counter;
}
$tblThr->setData($result);
$this->tpl->setVariable('THREADS_TABLE', $tblThr->getHTML());
// selection tree
require_once 'Modules/Forum/classes/class.ilForumMoveTopicsExplorer.php';
$exp = new ilForumMoveTopicsExplorer($this->ctrl->getLinkTarget($this, 'moveThreads'), 'frm_topic_paste_expand');
$exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'moveThreads'));
$exp->setTargetGet('ref_id');
$exp->setPostVar('frm_ref_id');
$exp->excludeObjIdFromSelection($ilObjDataCache->lookupObjId($_GET['ref_id']));
$exp->setCheckedItem($_POST['frm_ref_id']);
// open current position in tree
if(!is_array($_SESSION['frm_topic_paste_expand']))
{
global $tree;
$_SESSION['frm_topic_paste_expand'] = array();
$path = $tree->getPathId((int)$_GET['ref_id']);
foreach((array)$path as $node_id)
{
if(!in_array($node_id, $_SESSION['frm_topic_paste_expand']))
$_SESSION['frm_topic_paste_expand'][] = $node_id;
}
}
if($_GET['frm_topic_paste_expand'] == '')
{
$expanded = $this->tree->readRootId();
}
else
{
$expanded = $_GET['frm_topic_paste_expand'];
}
$exp->setExpand($expanded);
// build html-output
$exp->setOutput(0);
$output = $exp->getOutput();
$this->tpl->setVariable('FRM_SELECTION_TREE', $output);
$this->tpl->setVariable('CMD_SUBMIT', 'confirmMoveThreads');
$this->tpl->setVariable('TXT_SUBMIT', $this->lng->txt('paste'));
$this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this, 'confirmMoveThreads'));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjForumGUI::performDeleteThreadsObject ( )

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

References $_GET, $_POST, $ilCtrl, $ilDB, ilObjectGUI\$lng, ilUtil\sendInfo(), and showThreadsObject().

{
global $lng, $ilDB, $ilAccess, $ilCtrl;
if(!$ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))
{
$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
return $this->showThreadsObject();
}
if(!is_array($_POST['thread_ids']))
{
ilUtil::sendInfo($this->lng->txt('select_at_least_one_thread'));
return $this->showThreadsObject();
}
require_once './Modules/Forum/classes/class.ilForum.php';
require_once './Modules/Forum/classes/class.ilObjForum.php';
$forumObj = new ilObjForum($_GET['ref_id']);
$this->objProperties->setObjId($forumObj->getId());
foreach($_POST['thread_ids'] as $topic_id)
{
$frm = new ilForum();
$frm->setForumId($forumObj->getId());
$frm->setForumRefId($forumObj->getRefId());
$first_node = $frm->getFirstPostNode($topic_id);
if((int)$first_node['pos_pk'])
{
$frm->deletePost($first_node['pos_pk']);
ilUtil::sendInfo($lng->txt('forums_post_deleted'));
}
}
$this->ctrl->redirect($this, 'showThreads');
}

+ Here is the call graph for this function:

ilObjForumGUI::performImportObject ( )

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

References $_GET, $_POST, $error, $file, ilObjectGUI\$ref_id, __initFileObject(), __initParserObject(), ilObjectGUI\createObject(), ilObjectGUI\getReturnLocation(), initForumImportForm(), ilUtil\redirect(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
$new_type = $_POST['new_type'] ? $_POST['new_type'] : $_GET['new_type'];
$this->initForumImportForm($new_type);
if($this->import_form_gui->checkInput())
{
$file = $this->import_form_gui->getInput('importFile');
$error = false;
$this->__initFileObject();
if(!$this->file_obj->storeUploadedFile($file)) // STEP 1 save file in ...import/mail
{
$this->import_form_gui->getItemByPostVar('importFile')
->setAlert($this->lng->txt('import_file_not_valid'));
$error = true;
$this->file_obj->unlinkLast();
}
else if(!$this->file_obj->unzip()) // STEP 2 unzip uploaded file
{
$this->import_form_gui->getItemByPostVar('importFile')
->setAlert($this->lng->txt('cannot_unzip_file'));
$error = true;
$this->file_obj->unlinkLast();
}
else if(!$this->file_obj->findXMLFile())// STEP 3 getXMLFile
{
$this->import_form_gui->getItemByPostVar('importFile')
->setAlert($this->lng->txt('cannot_find_xml'));
$error = true;
$this->file_obj->unlinkLast();
}
else if(!$this->__initParserObject($this->file_obj->getXMLFile()) ||
!$this->parser_obj->startParsing()) // STEP 5 start parsing
{
$this->import_form_gui->getItemByPostVar('importFile')
->setAlert($this->lng->txt('import_parse_error'));
$error = true;
$this->message = $this->lng->txt("import_parse_error").":<br/>";
}
// FINALLY CHECK ERROR
if(!$error)
{
ilUtil::sendSuccess($this->lng->txt('import_forum_finished'), true);
$ref_id = $this->parser_obj->getRefId();
if($ref_id > 0)
{
$this->ctrl->setParameter($this, 'ref_id', $ref_id);
$this->ctrl->getLinkTarget($this, 'showThreads')));
}
else
{
ilUtil::redirect('repository.php?cmd=frameset&ref_id='.$_GET['ref_id']);
}
}
else
{
ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
$this->createObject('import');
}
}
else
{
return $this->createObject('import');
}
}

+ Here is the call graph for this function:

ilObjForumGUI::performMoveThreadsObject ( )

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

References $_GET, $_POST, $_SESSION, ilObjectGUI\$lng, moveThreadsObject(), and ilUtil\sendInfo().

{
global $lng, $ilAccess, $ilObjDataCache;
if (!$ilAccess->checkAccess('moderate_frm', '', $this->object->getRefId()))
{
$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
if (is_numeric($_POST['frm_ref_id']) && $_POST['frm_ref_id'] > 0)
{
$this->object->Forum->moveThreads($_SESSION['threads2move'], $_GET['ref_id'], $ilObjDataCache->lookupObjId($_POST['frm_ref_id']));
unset($_SESSION['threads2move']);
unset($_SESSION['forums_search_submitted']);
unset($_SESSION['frm_topic_paste_expand']);
ilUtil::sendInfo($lng->txt('threads_moved_successfully'), true);
$this->ctrl->redirect($this, 'showThreads');
return true;
}
else
{
ilUtil::sendInfo($lng->txt('no_forum_selected'));
}
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::performPostActivationObject ( )

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

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

{
global $ilAccess;
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))
{
$this->objCurrentPost->activatePost();
ilUtil::sendInfo($this->lng->txt('forums_post_was_activated'), true);
}
$this->viewThreadObject();
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::performPostAndChildPostsActivationObject ( )

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

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

{
global $ilAccess;
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))
{
$activate = $this->objCurrentPost->activatePostAndChildPosts();
ilUtil::sendInfo($this->lng->txt('forums_post_and_children_were_activated'), true);
}
$this->viewThreadObject();
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::performThreadsActionObject ( )

Perform form action in threads list.

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

References $_GET, $_POST, $_SESSION, ilObjectGUI\$lng, confirmDeleteThreads(), executeCommand(), moveThreadsObject(), and ilUtil\sendInfo().

{
global $lng, $ilUser, $ilAccess;
unset($_SESSION['threads2move']);
unset($_SESSION['forums_search_submitted']);
unset($_SESSION['frm_topic_paste_expand']);
if (is_array($_POST['thread_ids']))
{
if ($_POST['selected_cmd'] == 'move')
{
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))
{
$_SESSION['threads2move'] = $_POST['thread_ids'];
}
}
else if ($_POST['selected_cmd'] == 'enable_notifications' && $this->ilias->getSetting('forum_notification') != 0)
{
for ($i = 0; $i < count($_POST['thread_ids']); $i++)
{
$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);
$tmp_obj->enableNotification($ilUser->getId());
unset($tmp_obj);
}
$this->ctrl->redirect($this, 'showThreads');
}
else if ($_POST['selected_cmd'] == 'disable_notifications' && $this->ilias->getSetting('forum_notification') != 0)
{
for ($i = 0; $i < count($_POST['thread_ids']); $i++)
{
$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);
$tmp_obj->disableNotification($ilUser->getId());
unset($tmp_obj);
}
$this->ctrl->redirect($this, 'showThreads');
}
else if ($_POST['selected_cmd'] == 'close')
{
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))
{
for ($i = 0; $i < count($_POST['thread_ids']); $i++)
{
$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);
$tmp_obj->close();
unset($tmp_obj);
}
}
$this->ctrl->redirect($this, 'showThreads');
}
else if ($_POST['selected_cmd'] == 'reopen')
{
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))
{
for ($i = 0; $i < count($_POST['thread_ids']); $i++)
{
$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);
$tmp_obj->reopen();
unset($tmp_obj);
}
}
$this->ctrl->redirect($this, 'showThreads');
}
else if ($_POST['selected_cmd'] == 'makesticky')
{
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))
{
for ($i = 0; $i < count($_POST['thread_ids']); $i++)
{
$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);
$tmp_obj->makeSticky();
unset($tmp_obj);
}
}
$this->ctrl->redirect($this, 'showThreads');
}
else if ($_POST['selected_cmd'] == 'unmakesticky')
{
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))
{
for ($i = 0; $i < count($_POST['thread_ids']); $i++)
{
$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);
$tmp_obj->unmakeSticky();
unset($tmp_obj);
}
}
$this->ctrl->redirect($this, 'showThreads');
}
else if ($_POST['selected_cmd'] == 'html')
{
$this->ctrl->setCmd('exportHTML');
$this->ctrl->setCmdClass('ilForumExportGUI');
$this->executeCommand();
}
else if ($_POST['selected_cmd'] == 'confirmDeleteThreads')
{
return $this->confirmDeleteThreads();
}
else
{
ilUtil::sendInfo($this->lng->txt('topics_please_select_one_action'), true);
$this->ctrl->redirect($this, 'showThreads');
}
}
else
{
ilUtil::sendInfo($this->lng->txt('select_at_least_one_thread'), true);
$this->ctrl->redirect($this, 'showThreads');
}
}

+ Here is the call graph for this function:

ilObjForumGUI::prepareFormOutput (   $a_text)

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

{
$a_text = str_replace("&lt;", "<", $a_text);
$a_text = str_replace("&gt;", ">", $a_text);
$a_text = ilUtil::prepareFormOutput($a_text);
return $a_text;
}
ilObjForumGUI::prepareThreadScreen (   $a_forum_obj)

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

References $_SESSION, ilObjectGUI\$ilias, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilFrameTargetInfo\_getFrame(), ilUtil\getImagePath(), ilUtil\infoPanel(), and ilUtil\sendInfo().

Referenced by viewThreadObject().

{
global $tpl, $lng, $ilTabs, $ilias, $ilUser;
$session_name = 'viewmode_'.$a_forum_obj->getId();
$t_frame = ilFrameTargetInfo::_getFrame('MainContent');
$tpl->getStandardTemplate();
$tpl->setTitleIcon(ilUtil::getImagePath('icon_frm_b.gif'));
$ilTabs->setBackTarget($lng->txt('all_topics'), 'repository.php?ref_id='.$_GET['ref_id'], $t_frame);
// by answer view
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentTopic->getId());
$this->ctrl->setParameter($this, 'viewmode', 'tree');
$ilTabs->addTarget('order_by_answers', $this->ctrl->getLinkTarget($this, 'showThreadFrameset'), '', '', $t_frame);
// by date view
$this->ctrl->setParameter($this, 'viewmode', 'flat');
$ilTabs->addTarget('order_by_date', $this->ctrl->getLinkTarget($this, 'showThreadFrameset'), '', '', $t_frame);
$this->ctrl->clearParameters($this);
if (!isset($_SESSION[$session_name]) or $_SESSION[$session_name] == 'flat')
{
$ilTabs->setTabActive('order_by_date');
}
else
{
$ilTabs->setTabActive('order_by_answers');
}
$frm =& $a_forum_obj->Forum;
$frm->setForumId($a_forum_obj->getId());
/*
if ($ilias->getSetting('forum_notification') != 0 &&
!$frm->isForumNotificationEnabled($ilUser->getId()))
{
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentTopic->getId());
$ilTabs->addTarget('forums_notification', $this->ctrl->getLinkTarget($this, 'showThreadNotification'), '','');
$this->ctrl->clearParameters($this);
}
*/
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjForumGUI::quotePostObject ( )

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

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

{
if(!is_array($_POST['del_file'])) $_POST['del_file'] = array();
if($this->objCurrentTopic->isClosed())
{
$_GET['action'] = '';
return $this->viewThreadObject();
}
$oReplyEditForm = $this->getReplyEditForm();
// remove mandatory fields
$oReplyEditForm->getItemByPostVar('subject')->setRequired(false);
$oReplyEditForm->getItemByPostVar('message')->setRequired(false);
$oReplyEditForm->checkInput();
// add mandatory fields
$oReplyEditForm->getItemByPostVar('subject')->setRequired(true);
$oReplyEditForm->getItemByPostVar('message')->setRequired(true);
$_GET['action'] = 'showreply';
return $this->viewThreadObject();
}

+ Here is the call graph for this function:

ilObjForumGUI::reloadTree (   $a_flag = null)
private

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

References $reloadTree.

Referenced by doReloadTreeObject(), and viewThreadObject().

{
if(null === $a_flag)
{
}
$this->reloadTree = $a_flag;
return $this;
}

+ Here is the caller graph for this function:

ilObjForumGUI::saveObject (   $a_prevent_redirect = false)

save object public

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

References $_GET, $_POST, ilObjectGUI\createObject(), initForumCreateForm(), ilUtil\redirect(), ilObjectGUI\saveObject(), and ilUtil\sendSuccess().

{
global $rbacadmin, $rbacsystem;
$new_type = $_POST['new_type'] ? $_POST['new_type'] : $_GET['new_type'];
if(!$rbacsystem->checkAccess('create', $_GET['ref_id'], $new_type))
{
$this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
$this->initForumCreateForm($new_type);
if($this->create_form_gui->checkInput())
{
$_POST['Fobject']['title'] = $this->create_form_gui->getInput('title');
$_POST['Fobject']['desc'] = $this->create_form_gui->getInput('desc');
// create and insert forum in objecttree
$forumObj = parent::saveObject();
// save settings
$this->objProperties->setObjId($forumObj->getId());
$this->objProperties->setDefaultView(((int)$this->create_form_gui->getInput('sort')));
if(!$this->ilias->getSetting('disable_anonymous_fora', true))
{
$this->objProperties->setAnonymisation((int)$this->create_form_gui->getInput('anonymized'));
}
else
{
$this->objProperties->setAnonymisation(0);
}
if($this->ilias->getSetting('enable_fora_statistics', false))
{
$this->objProperties->setStatisticsStatus((int)$this->create_form_gui->getInput('statistics_enabled'));
}
else
{
$this->objProperties->setStatisticsStatus(0);
}
$this->objProperties->setPostActivation((int) $_POST['post_activation']);
$this->objProperties->insert();
$forumObj->createSettings();
// setup rolefolder & default local roles (moderator)
$roles = $forumObj->initDefaultRoles();
// ...finally assign moderator role to creator of forum object
$rbacadmin->assignUser($roles[0], $forumObj->getOwner(), 'n');
// insert new forum as new topic into frm_data
$forumObj->saveData($roles);
// always send a message
ilUtil::sendSuccess($this->lng->txt('frm_added'), true);
$this->ctrl->setParameter($this, 'ref_id', $forumObj->getRefId());
if(!$a_prevent_redirect)
{
ilUtil::redirect($this->ctrl->getLinkTarget($this, 'createThread'));
}
}
else
{
return $this->createObject('create');
}
}

+ Here is the call graph for this function:

ilObjForumGUI::savePostObject ( )

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

References $_GET, $_POST, $file, $ilDB, ilObjectGUI\$lng, ilObjMediaObject\_exists(), ilRTE\_getMediaObjects(), ilObjMediaObject\_getMobsOfObject(), ilObjMediaObject\_removeUsage(), ilRTE\_replaceMediaObjectImageSrc(), ilObjMediaObject\_saveUsage(), ilNewsItem\getFirstNewsIdForContext(), getForumObjects(), getReplyEditForm(), handleFormInput(), ilUtil\sendSuccess(), and viewThreadObject().

{
global $ilUser, $ilAccess, $ilDB, $lng;
if(!is_array($_POST['del_file'])) $_POST['del_file'] = array();
if($this->objCurrentTopic->isClosed())
{
$_GET['action'] = '';
return $this->viewThreadObject();
}
$oReplyEditForm = $this->getReplyEditForm();
if($oReplyEditForm->checkInput())
{
// init objects
$oForumObjects = $this->getForumObjects();
$forumObj = $oForumObjects['forumObj'];
$frm = $oForumObjects['frm'];
$frm->setMDB2WhereCondition(' top_frm_fk = %s ', array('integer'), array($frm->getForumId()));
$topicData = $frm->getOneTopic();
// Generating new posting
if($_GET['action'] == 'ready_showreply')
{
// reply: new post
$status = 1;
$send_activation_mail = 0;
if($this->objProperties->isPostActivationEnabled())
{
if(!$ilAccess->checkAccess('moderate_frm', '', (int)$this->object->getRefId()))
{
$status = 0;
$send_activation_mail = 1;
}
else if($this->objCurrentPost->isAnyParentDeactivated())
{
$status = 0;
}
}
if($this->objProperties->isAnonymized())
{
if(!strlen($oReplyEditForm->getInput('alias')))
{
$user_alias = $this->lng->txt('forums_anonymous');
}
else
{
$user_alias = $oReplyEditForm->getInput('alias');
}
}
else
{
$user_alias = $ilUser->getLogin();
}
$newPost = $frm->generatePost(
$topicData['top_pk'],
$this->objCurrentTopic->getId(),
($this->objProperties->isAnonymized() ? 0 : $ilUser->getId()),
ilRTE::_replaceMediaObjectImageSrc($oReplyEditForm->getInput('message'), 0),
$this->objCurrentPost->getId(),
(int)$oReplyEditForm->getInput('notify'),
$this->handleFormInput($oReplyEditForm->getInput('subject'), false),
$user_alias,
'',
$status,
$send_activation_mail
);
// copy temporary media objects (frm~)
include_once 'Services/MediaObjects/classes/class.ilObjMediaObject.php';
$mediaObjects = ilRTE::_getMediaObjects($oReplyEditForm->getInput('message'), 0);
$myMediaObjects = ilObjMediaObject::_getMobsOfObject('frm~:html', $ilUser->getId());
foreach($mediaObjects as $mob)
{
foreach($myMediaObjects as $myMob)
{
if($mob == $myMob)
{
// change usage
ilObjMediaObject::_removeUsage($mob, 'frm~:html', $ilUser->getId());
break;
}
}
ilObjMediaObject::_saveUsage($mob, 'frm:html', $newPost);
}
$oFDForum = new ilFileDataForum($forumObj->getId(), $newPost);
$file = $_FILES['userfile'];
if(is_array($file) && !empty($file))
{
$oFDForum->storeUploadedFile($file);
}
$message = '';
if(!$ilAccess->checkAccess('moderate_frm', '', (int)$this->object->getRefId()) &&
!$status)
{
$message = $lng->txt('forums_post_needs_to_be_activated');
}
else
{
$message = $lng->txt('forums_post_new_entry');
}
ilUtil::sendSuccess($message, true);
$this->ctrl->setParameter($this, 'pos_pk', $newPost);
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentPost->getThreadId());
$this->ctrl->redirect($this, 'doReloadTree', $newPost);
}
else
{
if((!$ilAccess->checkAccess('moderate_frm', '', (int)$_GET['ref_id']) &&
!$this->objCurrentPost->isOwner($ilUser->getId())) || $this->objCurrentPost->isCensored())
{
$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
// remove usage of deleted media objects
include_once 'Services/MediaObjects/classes/class.ilObjMediaObject.php';
$oldMediaObjects = ilObjMediaObject::_getMobsOfObject('frm:html', $this->objCurrentPost->getId());
$curMediaObjects = ilRTE::_getMediaObjects($oReplyEditForm->getInput('message'), 0);
foreach($oldMediaObjects as $oldMob)
{
$found = false;
foreach($curMediaObjects as $curMob)
{
if($oldMob == $curMob)
{
$found = true;
break;
}
}
if(!$found)
{
{
ilObjMediaObject::_removeUsage($oldMob, 'frm:html', $this->objCurrentPost->getId());
$mob_obj = new ilObjMediaObject($oldMob);
$mob_obj->delete();
}
}
}
$this->objCurrentPost->setSubject($this->handleFormInput($oReplyEditForm->getInput('subject'), false));
$this->objCurrentPost->setMessage(ilRTE::_replaceMediaObjectImageSrc($oReplyEditForm->getInput('message'), 0));
$this->objCurrentPost->setNotification((int)$oReplyEditForm->getInput('notify'));
$this->objCurrentPost->setChangeDate(date('Y-m-d H:i:s'));
$this->objCurrentPost->setUpdateUserId($ilUser->getId());
// edit: update post
if($this->objCurrentPost->update())
{
$this->objCurrentPost->reload();
// Change news item accordingly
include_once 'Services/News/classes/class.ilNewsItem.php';
// note: $this->objCurrentPost->getForumId() does not give us the forum ID here (why?)
$news_id = ilNewsItem::getFirstNewsIdForContext($forumObj->getId(),
'frm', $this->objCurrentPost->getId(), 'pos');
if($news_id > 0)
{
$news_item = new ilNewsItem($news_id);
$news_item->setTitle($this->objCurrentPost->getSubject());
$news_item->setContent(ilRTE::_replaceMediaObjectImageSrc($frm->prepareText(
$this->objCurrentPost->getMessage(), 0), 1)
);
$news_item->update();
}
// attachments
$oFDForum = $oForumObjects['file_obj'];
$file = $_FILES['userfile'];
if(is_array($file) && !empty($file))
{
$oFDForum->storeUploadedFile($file);
}
$file2delete = $oReplyEditForm->getInput('del_file');
if(is_array($file2delete) && count($file2delete))
{
$oFDForum->unlinkFilesByMD5Filenames($file2delete);
}
}
ilUtil::sendSuccess($lng->txt('forums_post_modified'), true);
$this->ctrl->setParameter($this, 'pos_pk', $this->objCurrentPost->getId());
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentPost->getThreadId());
$this->ctrl->redirect($this, 'doReloadTree', $this->objCurrentPost->getId());
}
}
else
{
$_GET['action'] = substr($_GET['action'], 6);
}
return $this->viewThreadObject();
}

+ Here is the call graph for this function:

ilObjForumGUI::searchForumsObject ( )

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

References $_SESSION, ilObjectGUI\$lng, and moveThreadsObject().

{
global $ilAccess;
if (!$ilAccess->checkAccess('moderate_frm', '', $this->object->getRefId()))
{
$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
$this->search_forums_for_moving_threads = true;
$_SESSION['forums_search_submitted'] = true;
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::setColumnSettings (   $column_gui)

Set column settings.

Reimplemented from ilObjectGUI.

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

References ilObjectGUI\$lng.

{
global $lng, $ilAccess;
$lng->loadLanguageModule('frm');
$column_gui->setBlockProperty('news', 'title', $lng->txt('frm_latest_postings'));
$column_gui->setBlockProperty("news", "prevent_aggregation", true);
$column_gui->setRepositoryMode(true);
if ($ilAccess->checkAccess('write', '', $this->object->getRefId()))
{
$news_set = new ilSetting('news');
$enable_internal_rss = $news_set->get('enable_rss_for_internal');
if ($enable_internal_rss)
{
$column_gui->setBlockProperty('news', 'settings', true);
$column_gui->setBlockProperty('news', 'public_notifications_option', true);
}
}
}
ilObjForumGUI::setDisplayConfirmPostActivation (   $status = 0)

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

Referenced by askForPostActivationObject().

{
$this->display_confirm_post_activation = $status;
}

+ Here is the caller graph for this function:

ilObjForumGUI::setForumCreateDefaultValues ( )
private

private

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

Referenced by createObject().

{
$this->create_form_gui->setValuesByArray(array(
'title' => '',
'desc' => '',
'sort' => 1,
'anonymized' => false,
'statistics_enabled' => false,
'post_activation' => false
));
}

+ Here is the caller graph for this function:

ilObjForumGUI::setTopicCreateDefaultValues ( )
private

private

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

Referenced by createThreadObject().

{
global $ilUser;
$this->create_topic_form_gui->setValuesByArray(array(
'subject' => '',
'message' => '',
'userfile' => '',
'notify' => 0,
'notify_posts' => 0
));
}

+ Here is the caller graph for this function:

ilObjForumGUI::showExplorerObject ( )

Show Forum Explorer.

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

References $_GET, ilObjectGUI\$lng, $objCurrentTopic, ilObjectGUI\$tpl, exit, and ilUtil\getImagePath().

{
global $tpl, $lng;
require_once './Modules/Forum/classes/class.ilForumExplorer.php';
$tpl->addBlockFile('CONTENT', 'content', 'tpl.explorer.html');
$tpl->setVariable('IMG_SPACE', ilUtil::getImagePath('spacer.gif', false));
$exp = new ilForumExplorer("./repository.php?cmd=viewThread&cmdClass=ilobjforumgui&thr_pk=".$this->objCurrentTopic->getId()."&ref_id=".$_GET['ref_id'], $this->objCurrentTopic, (int) $_GET['ref_id']);
$exp->setTargetGet('pos_pk');
if ($_GET['fexpand'] == '')
{
$expanded = $this->objCurrentTopic->getFirstPostNode()->getId();
}
else
{
$expanded = $_GET['fexpand'];
}
$exp->setExpand($expanded);
//build html-output
$exp->setOutput(0);
$output = $exp->getOutput();
$tpl->setCurrentBlock('content');
//$tpl->setVariable('TXT_EXPLORER_HEADER', $lng->txt('forums_posts'));
$tpl->setVariable('EXP_REFRESH', $lng->txt('refresh'));
$tpl->setVariable('EXPLORER', $output);
$this->ctrl->setParameter($this, 'fexpand', $_GET['fexpand']);
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentTopic->getId());
$tpl->setVariable('ACTION', $this->ctrl->getLinkTarget($this, 'showExplorer'));
$tpl->parseCurrentBlock();
$tpl->show(false);
exit();
}

+ Here is the call graph for this function:

ilObjForumGUI::showStatisticsObject ( )

called from GUI

if globally deactivated, skip!!! intrusion detected

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

References $_GET, ilObjectGUI\$data, $result, $row, and ilUtil\sendInfo().

{
global $ilUser, $ilAccess;
if (!$this->ilias->getSetting('enable_fora_statistics', false))
{
$this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
// if no read access -> intrusion detected
if (!$ilAccess->checkAccess('read', '', $_GET['ref_id']))
{
$this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
// if read access and statistics disabled -> intrusion detected
if (!$ilAccess->checkAccess('read', '', $_GET['ref_id']) && !$this->objProperties->isStatisticEnabled())
{
$this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
// if write access and statistics disabled -> ok, for forum admin
if ($ilAccess->checkAccess('write', '', $_GET['ref_id']) &&
!$this->objProperties->isStatisticEnabled())
{
ilUtil::sendInfo($this->lng->txt('frm_statistics_disabled_for_participants'));
}
$this->object->Forum->setForumId($this->object->getId());
require_once 'Modules/Forum/classes/class.ilForumStatisticsTableGUI.php';
$tbl = new ilForumStatisticsTableGUI($this, 'showStatistics');
$tbl->setId('il_frm_statistic_table_'.(int)$_GET['ref_id']);
$tbl->setTitle($this->lng->txt('statistic'), 'icon_usr_b.gif', $this->lng->txt('obj_'.$this->object->getType()));
$data = $this->object->Forum->getUserStatistic($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']));
$result = array();
$counter = 0;
foreach($data as $row)
{
$result[$counter]['ranking'] = $row[0];
$result[$counter]['login'] = $row[1];
$result[$counter]['lastname'] = $row[2];
$result[$counter]['firstname'] = $row[3];
++$counter;
}
$tbl->setData($result);
$this->tpl->setContent($tbl->getHTML());
}

+ Here is the call graph for this function:

ilObjForumGUI::showThreadFramesetObject ( )

Output forum frameset.

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

References $_GET, $_POST, $_SESSION, $ilCtrl, $ilDB, ilObjectGUI\$lng, exit, and ilUtil\sendInfo().

{
global $ilUser, $lng, $ilDB, $ilAccess, $ilNavigationHistory, $ilCtrl;
require_once './Modules/Forum/classes/class.ilForum.php';
require_once './Modules/Forum/classes/class.ilObjForum.php';
$lng->loadLanguageModule('forum');
$forumObj = new ilObjForum($_GET['ref_id']);
$this->objProperties->setObjId($forumObj->getId());
if ($_GET['mark_read'])
{
$forumObj->markThreadRead($ilUser->getId(),(int) $this->objCurrentTopic->getId());
ilUtil::sendInfo($lng->txt('forums_thread_marked'), true);
}
// delete post and its sub-posts
if ($_GET['action'] == 'ready_delete' && $_POST['confirm'] != '')
{
if(!$this->objCurrentTopic->isClosed() &&
($ilAccess->checkAccess('moderate_frm', '', (int) $_GET['ref_id']) ||
($this->objCurrentPost->isOwner($ilUser->getId()) && !$this->objCurrentPost->hasReplies())))
{
$frm = new ilForum();
$frm->setForumId($forumObj->getId());
$frm->setForumRefId($forumObj->getRefId());
$dead_thr = $frm->deletePost($this->objCurrentPost->getId());
// if complete thread was deleted ...
if ($dead_thr == $this->objCurrentTopic->getId())
{
$frm->setMDB2WhereCondition('top_frm_fk = %s ', array('integer'), array($forumObj->getId()));
$topicData = $frm->getOneTopic();
ilUtil::sendInfo($lng->txt('forums_post_deleted'), true);
if ($topicData['top_num_threads'] > 0)
{
$this->ctrl->redirect($this, 'showThreads');
}
else
{
$this->ctrl->redirect($this, 'createThread');
}
}
ilUtil::sendInfo($lng->txt('forums_post_deleted'));
}
}
$session_name = 'viewmode_'.$forumObj->getId();
if (isset($_GET['viewmode']))
{
$_SESSION[$session_name] = $_GET['viewmode'];
}
if (!$_SESSION[$session_name])
{
$_SESSION[$session_name] = $this->objProperties->getDefaultView() == 1 ? 'tree' : 'flat';
}
if ($_SESSION[$session_name] == 'tree')
{
include_once('Services/Frameset/classes/class.ilFramesetGUI.php');
$fs_gui = new ilFramesetGUI();
$fs_gui->setMainFrameName('content');
$fs_gui->setSideFrameName('tree');
$fs_gui->setFramesetTitle($forumObj->getTitle());
if (isset($_GET['target']))
{
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentTopic->getId());
$fs_gui->setSideFrameSource($this->ctrl->getLinkTarget($this, 'showExplorer'));
$this->ctrl->setParameter($this, 'pos_pk', $this->objCurrentPost->getId());
$fs_gui->setMainFrameSource($this->ctrl->getLinkTarget($this, 'viewThread').'#'.$this->objCurrentPost->getId());
}
else
{
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentTopic->getId());
$fs_gui->setSideFrameSource($this->ctrl->getLinkTarget($this, 'showExplorer'));
$fs_gui->setMainFrameSource($this->ctrl->getLinkTarget($this, 'viewThread'));
}
$fs_gui->show();
exit();
}
else
{
if (isset($_GET['target']))
{
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentTopic->getId());
$this->ctrl->setParameter($this, 'pos_pk', $this->objCurrentPost->getId());
$this->ctrl->redirect($this, 'viewThread', $this->objCurrentPost->getId());
}
else
{
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentTopic->getId());
$this->ctrl->redirect($this, 'viewThread');
}
}
}

+ Here is the call graph for this function:

ilObjForumGUI::showThreadsObject ( )

list threads of forum

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

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

Referenced by confirmDeleteThreads(), disableForumNotificationObject(), enableForumNotificationObject(), executeCommand(), markAllReadObject(), and performDeleteThreadsObject().

{
$this->tpl->setRightContent($this->getRightColumnHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjForumGUI::showUserObject ( )

Show user profile.

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

References $_GET, $ilDB, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilObjectFactory\getInstanceByRefId().

{
global $lng, $tpl, $ilAccess, $ilDB;
if (!$ilAccess->checkAccess('read', '', $_GET['ref_id']))
{
$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
require_once './Modules/Forum/classes/class.ilForum.php';
$lng->loadLanguageModule('forum');
if ($ref_obj->getType() == 'frm')
{
$forumObj = new ilObjForum($_GET['ref_id']);
$frm =& $forumObj->Forum;
$frm->setForumId($forumObj->getId());
$frm->setForumRefId($forumObj->getRefId());
}
else
{
$frm =& new ilForum();
}
$tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.forums_user_view.html', 'Modules/Forum');
$_GET['obj_id'] = $_GET['user'];
// count articles of user
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))
{
$numPosts = $frm->countUserArticles(addslashes($_GET['user']));
}
else
{
$numPosts = $frm->countActiveUserArticles(addslashes($_GET['user']));
}
$add = array($lng->txt('forums_posts') => $numPosts);
//$user_gui = new ilObjUserGUI('', $_GET['user'], false, false);
//$user_gui->insertPublicProfile('USR_PROFILE', 'usr_profile', $add);
include_once("./Services/User/classes/class.ilPublicUserProfileGUI.php");
$profile_gui = new ilPublicUserProfileGUI($_GET['user']);
$profile_gui->setAdditional($add);
$tpl->setVariable("USR_PROFILE", $profile_gui->getHTML());
if ($_GET['backurl'])
{
global $ilToolbar;
$ilToolbar->addButton($this->lng->txt('back'), urldecode($_GET['backurl']));
}
$tpl->setVariable('TPLPATH', $tpl->vars['TPLPATH']);
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::toggleStickinessObject ( )

Toggle sticky attribute of a thread.

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

References $_GET, and viewThreadObject().

{
global $ilAccess;
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))
{
if ($this->objCurrentTopic->isSticky())
{
$this->objCurrentTopic->unmakeSticky();
}
else
{
$this->objCurrentTopic->makeSticky();
}
}
$this->viewThreadObject();
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::toggleThreadNotificationObject ( )

Toggle thread notification for current user in notification tab view.

/*

/* public function toggleThreadNotificationTabObject() { global $ilUser;

if ($this->objCurrentTopic->isNotificationEnabled($ilUser->getId())) { $this->objCurrentTopic->disableNotification($ilUser->getId()); ilUtil::sendInfo($this->lng->txt('forums_notification_disabled'), true); } else { $this->objCurrentTopic->enableNotification($ilUser->getId()); ilUtil::sendInfo($this->lng->txt('forums_notification_enabled'), true); }

$this->showThreadNotificationObject();

return true; } Toggle thread notification for current user

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

References ilUtil\sendInfo(), and viewThreadObject().

{
global $ilUser;
if ($this->objCurrentTopic->isNotificationEnabled($ilUser->getId()))
{
$this->objCurrentTopic->disableNotification($ilUser->getId());
ilUtil::sendInfo($this->lng->txt('forums_notification_disabled'), true);
}
else
{
$this->objCurrentTopic->enableNotification($ilUser->getId());
ilUtil::sendInfo($this->lng->txt('forums_notification_enabled'), true);
}
$this->viewThreadObject();
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::updateObject ( )

updates object entry in object_data

public

Reimplemented from ilObjectGUI.

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

References $_GET, $_POST, $ilSetting, editObject(), ilUtil\redirect(), ilUtil\sendInfo(), and ilUtil\stripSlashes().

{
global $ilAccess, $ilSetting;
if (!$ilAccess->checkAccess('write', '', $_GET['ref_id']))
{
$this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
$this->object->setTitle(ilUtil::stripSlashes(trim($_POST["title"])));
$this->object->setDescription(ilUtil::stripSlashes(trim($_POST["desc"])));
$this->objProperties->setDefaultView(((int) $_POST['default_view']));
if (!$this->ilias->getSetting('disable_anonymous_fora') || $this->objProperties->isAnonymized())
{
//$this->objProperties->setAnonymisation(((int) $_POST['anonymized'] == 1) ? true : false);
$this->objProperties->setAnonymisation((int) $_POST['anonymized']);
}
if ($ilSetting->get('enable_fora_statistics', false))
{
//$this->objProperties->setStatisticsStatus(((int) $_POST['statistics_enabled'] == 1) ? true : false);
$this->objProperties->setStatisticsStatus((int) $_POST['statistics_enabled']);
}
//$this->objProperties->setPostActivation(((int) $_POST['post_activation'] == 1) ? true : false);
$this->objProperties->setPostActivation((int) $_POST['post_activation']);
if (strlen(trim($_POST['title'])))
{
$this->objProperties->update();
$this->object->update();
ilUtil::sendInfo($this->lng->txt('msg_obj_modified'), true);
ilUtil::redirect($this->ctrl->getLinkTarget($this, 'edit'));
}
else
{
ilUtil::sendInfo($this->lng->txt('frm_title_required'));
}
$this->editObject();
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::viewThreadObject ( )

View single thread.

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

References $_GET, $_POST, $_SESSION, $file, $ilCtrl, $ilDB, ilObjectGUI\$lng, $mobs, $params, ilObjectGUI\$tpl, ilObjMediaObject\_exists(), ilFrameTargetInfo\_getFrame(), ilObjMediaObject\_getMobsOfObject(), ilForum\_isModerator(), ilObjMediaObject\_removeUsage(), ilRTE\_replaceMediaObjectImageSrc(), ilUtil\deliverFile(), displayConfirmPostActivation(), exit, getActivationFormHTML(), ilAccessKeyGUI\getAttribute(), getCensorshipFormHTML(), ilObjectGUI\getCreationMode(), getDeleteFormHTML(), getForumObjects(), ilUtil\getImagePath(), getReplyEditForm(), getUserInstance(), ilUtil\getWebspaceDir(), handleFormInput(), ilUtil\Linkbar(), ilAccessKey\MARK_ALL_READ, prepareThreadScreen(), reloadTree(), ilUtil\sendInfo(), and ilUtil\switchColor().

Referenced by askForPostActivationObject(), cancelPostActivationObject(), cancelPostObject(), doReloadTreeObject(), performPostActivationObject(), performPostAndChildPostsActivationObject(), quotePostObject(), savePostObject(), toggleStickinessObject(), and toggleThreadNotificationObject().

{
global $tpl, $lng, $ilUser, $ilAccess, $ilTabs, $rbacsystem,
$rbacreview, $ilDB, $ilNavigationHistory, $ilCtrl, $frm, $ilToolbar;
if(!$ilAccess->checkAccess('read,visible', '', $this->object->getRefId()))
{
$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
// delete temporary media object (not in case a user adds media objects and wants to save an invalid form)
if($_GET['action'] != 'showreply' && $_GET['action'] != 'showedit')
{
try
{
include_once 'Services/MediaObjects/classes/class.ilObjMediaObject.php';
$mobs = ilObjMediaObject::_getMobsOfObject('frm~:html', $ilUser->getId());
foreach($mobs as $mob)
{
{
ilObjMediaObject::_removeUsage($mob, 'frm~:html', $ilUser->getId());
$mob_obj = new ilObjMediaObject($mob);
$mob_obj->delete();
}
}
}
catch(Exception $e)
{
}
}
require_once './Modules/Forum/classes/class.ilObjForum.php';
require_once './Modules/Forum/classes/class.ilFileDataForum.php';
$lng->loadLanguageModule('forum');
// add entry to navigation history
if (!$this->getCreationMode() &&
$ilAccess->checkAccess('read', '', $this->object->getRefId()))
{
$ilCtrl->setParameter($this, 'thr_pk', $this->objCurrentTopic->getId());
$ilNavigationHistory->addItem($this->object->getRefId(), $ilCtrl->getLinkTarget($this, 'showThreadFrameset'), 'frm');
}
// init objects
$oForumObjects = $this->getForumObjects();
$forumObj = $oForumObjects['forumObj'];
$frm = $oForumObjects['frm'];
$file_obj = $oForumObjects['file_obj'];
// save last access
$forumObj->updateLastAccess($ilUser->getId(), (int) $this->objCurrentTopic->getId());
// mark post read if explorer link was clicked
if ($this->objCurrentTopic->getId() && $this->objCurrentPost->getId())
{
$forumObj->markPostRead($ilUser->getId(), (int) $this->objCurrentTopic->getId(), (int) $this->objCurrentPost->getId());
}
$this->prepareThreadScreen($forumObj);
$tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.forums_threads_view.html', 'Modules/Forum');
// download file
if($_GET['file'])
{
if(!$path = $file_obj->getFileDataByMD5Filename($_GET['file']))
{
ilUtil::sendInfo('Error reading file!');
}
else
{
ilUtil::deliverFile($path['path'], $path['clean_filename']);
}
}
$session_name = 'viewmode_'.$forumObj->getId();
if ($_SESSION[$session_name] == 'flat')
{
$new_order = 'answers';
$orderField = 'frm_posts_tree.fpt_date';
}
else
{
if($this->reloadTree())
{
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentTopic->getId());
$tpl->setVariable('JAVASCRIPT', $this->ctrl->getLinkTarget($this, 'showExplorer'));
}
$new_order = 'date';
$orderField = 'frm_posts_tree.rgt';
}
// get forum- and thread-data
$frm->setMDB2WhereCondition('top_frm_fk = %s ', array('integer'), array($frm->getForumId()));
if(is_array($topicData = $frm->getOneTopic()))
{
// Visit-Counter for topic
$this->objCurrentTopic->updateVisits();
$tpl->setTitle($lng->txt('forums_thread')." \"".$this->objCurrentTopic->getSubject()."\"");
// ********************************************************************************
// build location-links
include_once('./Modules/Forum/classes/class.ilForumLocatorGUI.php');
$frm_loc = new ilForumLocatorGUI();
$frm_loc->setRefId($_GET['ref_id']);
$frm_loc->setForum($frm);
$frm_loc->setThread($this->objCurrentTopic->getId(), $this->objCurrentTopic->getSubject());
$frm_loc->display();
// set tabs
// menu template (contains linkbar)
$menutpl = new ilTemplate('tpl.forums_threads_menu.html', true, true, 'Modules/Forum');
include_once("./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
// mark read
if($ilUser->getId() != ANONYMOUS_USER_ID &&
$forumObj->getCountUnread($ilUser->getId(), (int) $this->objCurrentTopic->getId()))
{
$this->ctrl->setParameter($this, 'mark_read', '1');
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentTopic->getId());
$ilToolbar->addButton(
$this->lng->txt('forums_mark_read'),
$this->ctrl->getLinkTarget($this, 'showThreadFrameset'),
);
$this->ctrl->clearParameters($this);
}
// print thread
$this->ctrl->setParameterByClass('ilforumexportgui', 'print_thread', $this->objCurrentTopic->getId());
$this->ctrl->setParameterByClass('ilforumexportgui', 'thr_top_fk', $this->objCurrentTopic->getForumId());
$ilToolbar->addButton(
$this->lng->txt('forums_print_thread'),
$this->ctrl->getLinkTargetByClass('ilforumexportgui', 'printThread'),
);
$this->ctrl->clearParametersByClass('ilforumexportgui');
// enable/disable notification
if($ilUser->getId() != ANONYMOUS_USER_ID &&
$this->ilias->getSetting('forum_notification') != 0)
{
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentTopic->getId());
if($this->objCurrentTopic->isNotificationEnabled($ilUser->getId()))
{
$ilToolbar->addButton(
$this->lng->txt('forums_disable_notification'),
$this->ctrl->getLinkTarget($this, 'toggleThreadNotification')
);
}
else
{
$ilToolbar->addButton(
$this->lng->txt('forums_enable_notification'),
$this->ctrl->getLinkTarget($this, 'toggleThreadNotification')
);
}
$this->ctrl->clearParameters($this);
}
// ********************************************************************************
// form processing (censor)
if(!$this->objCurrentTopic->isClosed() && $_GET['action'] == 'ready_censor')
{
if($_POST['confirm'] != '' && $_GET['action'] == 'ready_censor')
{
$frm->postCensorship($this->handleFormInput($_POST['formData']['cens_message']), $this->objCurrentPost->getId(), 1);
}
else if($_POST['cancel'] != '' && $_GET['action'] == 'ready_censor')
{
$frm->postCensorship($this->handleFormInput($_POST['formData']['cens_message']), $this->objCurrentPost->getId());
}
}
// get complete tree of thread
$first_node = $this->objCurrentTopic->getFirstPostNode();
$this->objCurrentTopic->setOrderField($orderField);
$subtree_nodes = $this->objCurrentTopic->getPostTree($first_node);
// no posts
if (!$posNum = count($subtree_nodes))
{
ilUtil::sendInfo($this->lng->txt('forums_no_posts_available'));
}
$pageHits = $frm->getPageHits();
$z = 0;
// navigation to browse
if ($posNum > $pageHits)
{
$params = array(
'ref_id' => $_GET['ref_id'],
'thr_pk' => $this->objCurrentTopic->getId(),
'orderby' => $_GET['orderby']
);
if (!$_GET['offset'])
{
$Start = 0;
}
else
{
$Start = $_GET['offset'];
}
$linkbar = ilUtil::Linkbar($ilCtrl->getLinkTarget($this, 'viewThread'), $posNum, $pageHits, $Start, $params);
if($linkbar != '')
{
$menutpl->setCurrentBlock('linkbar');
$menutpl->setVariable('LINKBAR', $linkbar);
$menutpl->parseCurrentBlock();
}
}
$tpl->setVariable('THREAD_MENU', $menutpl->get());
// assistance val for anchor-links
$jump = 0;
// generate post-dates
foreach($subtree_nodes as $node)
{
$this->ctrl->clearParameters($this);
if($this->objCurrentPost->getId() && $this->objCurrentPost->getId() == $node->getId())
{
$jump++;
}
if ($posNum > $pageHits && $z >= ($Start + $pageHits))
{
// if anchor-link was not found ...
if ($this->objCurrentPost->getId() && $jump < 1)
{
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentTopic->getId());
$this->ctrl->setParameter($this, 'pos_pk', $this->objCurrentPost->getId());
$this->ctrl->setParameter($this, 'offset', ($Start + $pageHits));
$this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
$this->ctrl->redirect($this, 'viewThread', $this->objCurrentPost->getId());
exit();
}
else
{
break;
}
}
if(($posNum > $pageHits && $z >= $Start) || $posNum <= $pageHits)
{
if($this->objCurrentPost->getId() == $node->getId())
{
# actions for "active" post
if($ilAccess->checkAccess('moderate_frm', '', (int) $_GET['ref_id']) ||
(!$ilAccess->checkAccess('moderate_frm', '', (int) $_GET['ref_id']) && $node->isActivated()))
{
// reply/edit
if(!$this->objCurrentTopic->isClosed() && ($_GET['action'] == 'showreply' || $_GET['action'] == 'showedit'))
{
if($_GET['action'] == 'showedit' &&
((!$ilAccess->checkAccess('moderate_frm', '', (int) $_GET['ref_id']) &&
!$node->isOwner($ilUser->getId())) || $node->isCensored()))
{
$this->ilias->raiseError($lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
$tpl->setVariable('REPLY_ANKER', $this->objCurrentPost->getId());
$oEditReplyForm = $this->getReplyEditForm();
switch($_GET['action'])
{
case 'showreply':
if($this->ctrl->getCmd() == 'savePost')
{
$oEditReplyForm->setValuesByPost();
}
else if($this->ctrl->getCmd() == 'quotePost')
{
$oEditReplyForm->setValuesByPost();
$oEditReplyForm->getItemByPostVar('message')->setValue(
$frm->prepareText($node->getMessage(), 1, $node->getLoginName())."\n".$oEditReplyForm->getInput('message'), 1
)
);
}
else
{
$oEditReplyForm->setValuesByArray(array(
'alias' => '',
'subject' => $this->objCurrentPost->getSubject(),
'message' => '',
'notify' => 0,
'userfile' => '',
'del_file' => array()
));
}
$this->ctrl->setParameter($this, 'pos_pk', $this->objCurrentPost->getId());
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentPost->getThreadId());
$jsTpl = new ilTemplate('ilFrmPostAjaxHandler.js', true, true, 'Modules/Forum');
$jsTpl->setVariable('IL_FRM_QUOTE_CALLBACK_SRC',
$this->ctrl->getLinkTarget($this, 'getQuotationHTMLAsynch', '', true));
$this->ctrl->clearParameters($this);
$this->tpl->setVariable('FRM_POST_JS', $jsTpl->get());
break;
case 'showedit':
if($this->ctrl->getCmd() == 'savePost')
{
$oEditReplyForm->setValuesByPost();
}
else
{
$oEditReplyForm->setValuesByArray(array(
'alias' => '',
'subject' => $this->objCurrentPost->getSubject(),
'message' => ilRTE::_replaceMediaObjectImageSrc($frm->prepareText($this->objCurrentPost->getMessage(), 2), 1),
'notify' => $this->objCurrentPost->isNotificationEnabled() ? true : false,
'userfile' => '',
'del_file' => array()
));
}
break;
}
$this->ctrl->setParameter($this, 'pos_pk', $this->objCurrentPost->getId());
$this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentPost->getThreadId());
$this->ctrl->setParameter($this, 'offset', (int)$_GET['offset']);
$this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
$this->ctrl->setParameter($this, 'action', $_GET['action']);
$tpl->setVariable('FORM', $oEditReplyForm->getHTML());
$this->ctrl->clearParameters($this);
} // if ($_GET['action'] == 'showreply' || $_GET['action'] == 'showedit')
else if(!$this->objCurrentTopic->isClosed() && $_GET['action'] == 'delete')
{
if($ilAccess->checkAccess('moderate_frm', '', (int) $_GET['ref_id']) ||
($node->isOwner($ilUser->getId()) && !$node->hasReplies()))
{
// confirmation: delete
$tpl->setVariable('FORM', $this->getDeleteFormHTML());
}
} // else if ($_GET['action'] == 'delete')
else if(!$this->objCurrentTopic->isClosed() && $_GET['action'] == 'censor')
{
if($ilAccess->checkAccess('moderate_frm', '', (int) $_GET['ref_id']))
{
// confirmation: censor / remove censorship
$tpl->setVariable('FORM', $this->getCensorshipFormHTML());
}
}
else if (!$this->objCurrentTopic->isClosed() && $this->displayConfirmPostActivation())
{
if ($ilAccess->checkAccess('moderate_frm', '', (int) $_GET['ref_id']))
{
// confirmation: activate
$tpl->setVariable('FORM', $this->getActivationFormHTML());
}
} // else if ($this->displayConfirmPostActivation())
/*else if ($this->displayConfirmPostDeactivation())
{
if ($ilAccess->checkAccess('moderate_frm', '', (int) $_GET['ref_id']))
{
// confirmation: deactivate
$tpl->setVariable('FORM', $this->getDeactivationFormHTML()));
}
} // else if ($this->displayConfirmPostDeactivation())
*/
}
} // if ($this->objCurrentPost->getId() == $node->getId())
if ($this->objCurrentPost->getId() != $node->getId() ||
($_GET['action'] != 'showreply' &&
$_GET['action'] != 'showedit' &&
$_GET['action'] != 'censor' &&
$_GET['action'] != 'delete' &&
#!$this->displayConfirmPostDeactivation() &&
))
{
if($ilAccess->checkAccess('moderate_frm', '', (int) $_GET['ref_id']) ||
(!$ilAccess->checkAccess('moderate_frm', '', (int) $_GET['ref_id']) && $node->isActivated()))
{
// button: reply
if (!$this->objCurrentTopic->isClosed() &&
$ilAccess->checkAccess('add_post', '', (int) $_GET['ref_id']) &&
!$node->isCensored())
{
$tpl->setCurrentBlock('commands');
$this->ctrl->setParameter($this, 'action', 'showreply');
$this->ctrl->setParameter($this, 'pos_pk', $node->getId());
$this->ctrl->setParameter($this, 'offset', $Start);
$this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
$this->ctrl->setParameter($this, 'thr_pk', $node->getThreadId());
$tpl->setVariable('COMMANDS_COMMAND', $this->ctrl->getLinkTarget($this, 'viewThread', $node->getId()));
$tpl->setVariable('COMMANDS_TXT', $lng->txt('reply'));
$this->ctrl->clearParameters($this);
$tpl->parseCurrentBlock();
}
// button: edit article
if (!$this->objCurrentTopic->isClosed() &&
($node->isOwner($ilUser->getId()) ||
$ilAccess->checkAccess('moderate_frm', '', (int) $_GET['ref_id'])) &&
!$node->isCensored())
{
$tpl->setCurrentBlock('commands');
$this->ctrl->setParameter($this, 'action', 'showedit');
$this->ctrl->setParameter($this, 'pos_pk', $node->getId());
$this->ctrl->setParameter($this, 'thr_pk', $node->getThreadId());
$this->ctrl->setParameter($this, 'offset', $Start);
$this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
$tpl->setVariable('COMMANDS_COMMAND', $this->ctrl->getLinkTarget($this, 'viewThread', $node->getId()));
$tpl->setVariable('COMMANDS_TXT', $lng->txt('edit'));
$this->ctrl->clearParameters($this);
$tpl->parseCurrentBlock();
}
// button: print
if (!$node->isCensored())
{
$tpl->setCurrentBlock('commands');
$this->ctrl->setParameterByClass('ilforumexportgui', 'print_post', $node->getId());
$this->ctrl->setParameterByClass('ilforumexportgui', 'top_pk', $node->getForumId());
$this->ctrl->setParameterByClass('ilforumexportgui', 'thr_pk', $node->getThreadId());
$tpl->setVariable('COMMANDS_COMMAND', $this->ctrl->getLinkTargetByClass('ilforumexportgui', 'printPost'));
$tpl->setVariable('COMMANDS_TXT', $lng->txt('print'));
$this->ctrl->clearParameters($this);
$tpl->parseCurrentBlock();
}
# buttons for every post except the "active"
if (!$this->objCurrentTopic->isClosed() &&
($ilAccess->checkAccess('moderate_frm', '', (int) $_GET['ref_id']) ||
($node->isOwner($ilUser->getId()) && !$node->hasReplies())))
{
// button: delete
$tpl->setCurrentBlock('commands');
$this->ctrl->setParameter($this, 'action', 'delete');
$this->ctrl->setParameter($this, 'pos_pk', $node->getId());
$this->ctrl->setParameter($this, 'thr_pk', $node->getThreadId());
$this->ctrl->setParameter($this, 'offset', $Start);
$this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
$tpl->setVariable('COMMANDS_COMMAND', $this->ctrl->getLinkTarget($this, 'viewThread', $node->getId()));
$tpl->setVariable('COMMANDS_TXT', $lng->txt('delete'));
$this->ctrl->clearParameters($this);
$tpl->parseCurrentBlock();
}
if (!$this->objCurrentTopic->isClosed() &&
$ilAccess->checkAccess('moderate_frm', '', (int) $_GET['ref_id']))
{
// button: censor
$tpl->setCurrentBlock('commands');
$this->ctrl->setParameter($this, 'action', 'censor');
$this->ctrl->setParameter($this, 'pos_pk', $node->getId());
$this->ctrl->setParameter($this, 'thr_pk', $node->getThreadId());
$this->ctrl->setParameter($this, 'offset', $Start);
$this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
$tpl->setVariable('COMMANDS_COMMAND', $this->ctrl->getLinkTarget($this, 'viewThread', $node->getId()));
$tpl->setVariable('COMMANDS_TXT', $lng->txt('censorship'));
$this->ctrl->clearParameters($this);
$tpl->parseCurrentBlock();
// button: activation/deactivation
$tpl->setCurrentBlock('commands');
$this->ctrl->setParameter($this, 'pos_pk', $node->getId());
$this->ctrl->setParameter($this, 'thr_pk', $node->getThreadId());
$this->ctrl->setParameter($this, 'offset', $Start);
$this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
/*if ($node->isActivated())
{
$tpl->setVariable('ACTIVATE_DEACTIVATE_LINK', $this->ctrl->getLinkTarget($this, 'askForPostDeactivation', $node->getId()));
$tpl->setVariable('ACTIVATE_DEACTIVATE_BUTTON', $lng->txt('deactivate_post'));
}
else
*/
if (!$node->isActivated())
{
$tpl->setVariable('COMMANDS_COMMAND', $this->ctrl->getLinkTarget($this, 'askForPostActivation', $node->getId()));
$tpl->setVariable('COMMANDS_TXT', $lng->txt('activate_post'));
}
$this->ctrl->clearParameters($this);
$tpl->parseCurrentBlock();
}
// button: mark read
if ($ilUser->getId() != ANONYMOUS_USER_ID &&
!$node->isRead($ilUser->getId()))
{
$tpl->setCurrentBlock('commands');
$this->ctrl->setParameter($this, 'pos_pk', $node->getId());
$this->ctrl->setParameter($this, 'thr_pk', $node->getThreadId());
$this->ctrl->setParameter($this, 'offset', $Start);
$this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
$tpl->setVariable('COMMANDS_COMMAND', $this->ctrl->getLinkTarget($this, 'viewThread', $node->getId()));
$tpl->setVariable('COMMANDS_TXT', $lng->txt('is_read'));
$this->ctrl->clearParameters($this);
$tpl->parseCurrentBlock();
}
}
} // if ($this->objCurrentPost->getId() != $node->getId())
// download post attachments
$tmp_file_obj =& new ilFileDataForum($forumObj->getId(), $node->getId());
if (count($tmp_file_obj->getFilesOfPost()))
{
if ($node->getId() != $this->objCurrentPost->getId() || $_GET['action'] != 'showedit')
{
foreach ($tmp_file_obj->getFilesOfPost() as $file)
{
$tpl->setCurrentBlock('attachment_download_row');
$this->ctrl->setParameter($this, 'pos_pk', $node->getId());
$this->ctrl->setParameter($this, 'file', $file['md5']);
$tpl->setVariable('HREF_DOWNLOAD', $this->ctrl->getLinkTarget($this, 'viewThread'));
$tpl->setVariable('TXT_FILENAME', $file['name']);
$this->ctrl->clearParameters($this);
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock('attachments');
$tpl->setVariable('TXT_ATTACHMENTS_DOWNLOAD',$lng->txt('forums_attachments'));
$tpl->setVariable('DOWNLOAD_IMG', ilUtil::getImagePath('icon_attachment.gif'));
$tpl->setVariable('TXT_DOWNLOAD_ATTACHMENT', $lng->txt('forums_download_attachment'));
$tpl->parseCurrentBlock();
}
}
$tpl->setCurrentBlock('posts_row');
// anker for every post
$tpl->setVariable('POST_ANKER', $node->getId());
//permanent link for every post
$tpl->setVariable('PERMA_LINK', ILIAS_HTTP_PATH."/goto.php?target="."frm"."_".$this->object->getRefId()."_".$node->getThreadId()."_".$node->getId()."&client_id=".CLIENT_ID);
$tpl->setVariable('TXT_PERMA_LINK', $lng->txt('perma_link'));
$tpl->setVariable('PERMA_TARGET', '_top');
$tpl->setVariable('IMG_POSTING', ilUtil::getImagePath('icon_posting_s.gif'));
$rowCol = ilUtil::switchColor($z, 'tblrow1', 'tblrow2');
if (( $_GET['action'] != 'delete' && $_GET['action'] != 'censor' &&
#!$this->displayConfirmPostDeactivation() &&
)
|| $this->objCurrentPost->getId() != $node->getId())
{
$tpl->setVariable('ROWCOL', $rowCol);
}
else
{
// highlight censored posts
$rowCol = 'tblrowmarked';
}
// post is censored
if ($node->isCensored())
{
// display censorship advice
if ($_GET['action'] != 'censor')
{
$tpl->setVariable('TXT_CENSORSHIP_ADVICE', $this->lng->txt('post_censored_comment_by_moderator'));
}
// highlight censored posts
$rowCol = 'tblrowmarked';
}
// set row color
$tpl->setVariable('ROWCOL', $rowCol);
// get author data
unset($author);
if($node->getUserId())
{
$author = $this->getUserInstance($node->getUserId());
if(null === $author)
{
unset($author);
$node->setUserId(0);
}
}
if($node->getUserId())
{
// GET USER DATA, USED FOR IMPORTED USERS
$usr_data = $frm->getUserData($node->getUserId(), $node->getImportName());
}
else
{
$usr_data = array(
'usr_id' => 0,
'login' => $node->getUserAlias(),
'public_profile' => 'n'
);
}
$this->ctrl->setParameter($this, 'pos_pk', $node->getId());
$this->ctrl->setParameter($this, 'thr_pk', $node->getThreadId());
$backurl = urlencode($this->ctrl->getLinkTarget($this, 'viewThread', $node->getId()));
// get create- and update-dates
if ($node->getUpdateUserId() > 0)
{
$span_class = '';
// last update from moderator?
$posMod = $frm->getModeratorFromPost($node->getId());
if (is_array($posMod) && $posMod['top_mods'] > 0)
{
$MODS = $rbacreview->assignedUsers($posMod['top_mods']);
if (is_array($MODS))
{
if (in_array($node->getUpdateUserId(), $MODS))
$span_class = 'moderator_small';
}
}
$node->setChangeDate($node->getChangeDate());
$last_user_data = $frm->getUserData($node->getUpdateUserId());
if ($span_class == '')
$span_class = 'small';
if($last_user_data['usr_id'])
{
if ($last_user_data['public_profile'] == 'n')
{
$edited_author = $last_user_data['login'];
}
else
{
$this->ctrl->setParameter($this, 'backurl', $backurl);
$this->ctrl->setParameter($this, 'thr_pk', $node->getThreadId());
$this->ctrl->setParameter($this, 'user', $last_user_data['usr_id']);
$edited_author = $this->ctrl->getLinkTarget($this, 'showUser');
$edited_author = "<a href=\"".$edited_author."\">".$last_user_data['login']."</a>";
$this->ctrl->clearParameters($this);
}
}
else
{
$edited_author = $last_user_data['login'];
}
$tpl->setVariable('POST_UPDATE', $lng->txt('edited_at').': '.
$frm->convertDate($node->getChangeDate()).' - '.strtolower($lng->txt('by')).' '.$edited_author);
} // if ($node->getUpdateUserId() > 0)
// if post is not activated display message for the owner
if(!$node->isActivated() && $node->isOwner($ilUser->getId()))
{
$tpl->setVariable('POST_NOT_ACTIVATED_YET', $this->lng->txt('frm_post_not_activated_yet'));
}
if($node->getUserId() &&
$node->getUserId() != ANONYMOUS_USER_ID)
{
$user_obj = $this->getUserInstance($usr_data['usr_id']);
// user image
$webspace_dir = ilUtil::getWebspaceDir();
$image_dir = $webspace_dir.'/usr_images';
$xthumb_file = $image_dir.'/usr_'.$user_obj->getID().'_xsmall.jpg';
if ($user_obj->getPref('public_upload') == 'y' &&
($user_obj->getPref('public_profile') == 'y' ||
$user_obj->getPref('public_profile') == 'g') &&
@is_file($xthumb_file))
{
#$tpl->setCurrentBlock('usr_image');
$tpl->setVariable('USR_IMAGE', $xthumb_file.'?t='.rand(1, 99999));
#$tpl->parseCurrentBlock();
//$tpl->setCurrentBlock('posts_row');
}
if ($usr_data['public_profile'] == 'n')
{
$tpl->setVariable('AUTHOR', $usr_data['login']);
}
else
{
$tpl->setVariable('TXT_REGISTERED', $lng->txt('registered_since').':');
$tpl->setVariable('REGISTERED_SINCE',$frm->convertDate($author->getCreateDate()));
$this->ctrl->setParameter($this, 'backurl', $backurl);
$this->ctrl->setParameter($this, 'thr_pk', $node->getThreadId());
$this->ctrl->setParameter($this, 'user', $usr_data['usr_id']);
$href = $this->ctrl->getLinkTarget($this, 'showUser');
$tpl->setVariable('AUTHOR', "<a href=\"".$href."\">".$usr_data['login']."</a>");
}
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))
{
$numPosts = $frm->countUserArticles($author->id);
}
else
{
$numPosts = $frm->countActiveUserArticles($author->id);
}
$tpl->setVariable('TXT_NUM_POSTS', $lng->txt('forums_posts').':');
$tpl->setVariable('NUM_POSTS', $numPosts);
if($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']) || $usr_data['public_profile'] != 'n')
{
$tpl->setVariable('USR_NAME', $usr_data['firstname'].' '.$usr_data['lastname']);
}
if(ilForum::_isModerator($_GET['ref_id'], $node->getUserId()))
{
if($user_obj->getGender() == 'f')
{
$tpl->setVariable('ROLE', $this->lng->txt('frm_moderator_f'));
}
else if($user_obj->getGender() == 'm')
{
$tpl->setVariable('ROLE', $this->lng->txt('frm_moderator_m'));
}
}
}
else
{
if(strlen($usr_data['login']))
{
$tpl->setVariable('AUTHOR', $usr_data['login']);
if($node->getUserId() != ANONYMOUS_USER_ID)
{
$tpl->setVariable('PSEUDONYM', $this->lng->txt('frm_pseudonym'));
}
}
else
{
$tpl->setVariable('AUTHOR', $lng->txt('forums_anonymous'));
}
}
// prepare post
$node->setMessage($frm->prepareText(nl2br($node->getMessage())));
$tpl->setVariable('TXT_CREATE_DATE', $lng->txt('forums_thread_create_date'));
if($ilUser->getId() == ANONYMOUS_USER_ID ||
$node->isRead($ilUser->getId()))
{
$tpl->setVariable('SUBJECT', $node->getSubject());
}
else
{
if ($forumObj->isNew($ilUser->getId(), $node->getThreadId(), $node->getId()))
{
$tpl->setVariable('SUBJECT', '<i><b>'.$node->getSubject().'</b></i>');
$tpl->setVariable('TXT_MARK_ICON', $this->lng->txt('new'));
$tpl->setVariable('IMG_MARK_ICON', ilUtil::getImagePath('icon_new.gif'));
}
else
{
$tpl->setVariable('SUBJECT', '<b>'.$node->getSubject().'</b>');
$tpl->setVariable('TXT_MARK_ICON', $this->lng->txt('unread'));
$tpl->setVariable('IMG_MARK_ICON', ilUtil::getImagePath('icon_unread.gif'));
}
}
$tpl->setVariable('POST_DATE', $frm->convertDate($node->getCreateDate()));
$tpl->setVariable('SPACER', "<hr noshade width=100% size=1 align='center' />");
if (!$node->isCensored() ||
($this->objCurrentPost->getId() == $node->getId() && $_GET['action'] == 'censor'))
{
// post from moderator?
$modAuthor = $frm->getModeratorFromPost($node->getId());
$spanClass = "";
if (is_array($modAuthor) && $modAuthor['top_mods'] > 0)
{
unset($MODS);
$MODS = $rbacreview->assignedUsers($modAuthor['top_mods']);
if (is_array($MODS))
{
if (in_array($node->getUserId(), $MODS))
$spanClass = 'moderator';
}
}
// Add target="_top"
$node->setMessage(
preg_replace(
'/<a((?![^>]+target="[^>]*")[^>]*)>/ims',
'<a target="_top"$1>',
$node->getMessage()
)
);
if ($spanClass != "")
{
$tpl->setVariable('POST', "<span class=\"".$spanClass."\">".ilRTE::_replaceMediaObjectImageSrc($node->getMessage(), 1)."</span>");
}
else
{
$tpl->setVariable('POST', ilRTE::_replaceMediaObjectImageSrc($node->getMessage(), 1));
}
}
else
{
$tpl->setVariable('POST', "<span class=\"moderator\">".nl2br($node->getCensorshipComment())."</span>");
}
$tpl->parseCurrentBlock();
} // if (($posNum > $pageHits && $z >= $Start) || $posNum <= $pageHits)
$z++;
} // foreach($subtree_nodes as $node)
}
else
{
$tpl->setCurrentBlock('posts_no');
$tpl->setVAriable('TXT_MSG_NO_POSTS_AVAILABLE', $lng->txt('forums_posts_not_available'));
$tpl->parseCurrentBlock();
}
$tpl->setVariable('COUNT_POST', $lng->txt('forums_count_art').': '.$posNum);
$tpl->setVariable('TXT_AUTHOR', $lng->txt('author'));
$tpl->setVariable('TXT_POST', $lng->txt('forums_thread').': '.$this->objCurrentTopic->getSubject());
$oThreadToolbar = clone $ilToolbar;
$tpl->setVariable('THREAD_TOOLBAR', $oThreadToolbar->getHTML());
$tpl->setVariable('TPLPATH', $tpl->vars['TPLPATH']);
// permanent link
include_once 'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php';
$permalink = new ilPermanentLinkGUI('frm', $this->object->getRefId(), '_'.$this->objCurrentTopic->getId());
$this->tpl->setVariable('PRMLINK', $permalink->getHTML());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilObjForumGUI::$action = null
private

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

ilObjForumGUI::$create_form_gui = null
private

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

ilObjForumGUI::$create_import_gui = null
private

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

ilObjForumGUI::$create_topic_form_gui = null
private

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

ilObjForumGUI::$display_confirm_post_activation = 0
private

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

Referenced by displayConfirmPostActivation().

ilObjForumGUI::$display_confirm_post_deactivation = 0
private

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

ilObjForumGUI::$hideToolbar = false
private

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

Referenced by hideToolbar().

ilObjForumGUI::$is_moderator = false
private

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

ilObjForumGUI::$objCurrentPost = null
private

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

ilObjForumGUI::$objCurrentTopic = null
private

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

Referenced by moveThreadsObject(), and showExplorerObject().

ilObjForumGUI::$objProperties = null
private

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

ilObjForumGUI::$reloadTree = false
private

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

Referenced by reloadTree().


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