ILIAS  release_4-3 Revision
 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

 updateThreadObject ()
 showThreadsObject ()
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 performPostAndChildPostsActivationObject ()
 performPostActivationObject ()
 cancelPostActivationObject ()
 askForPostActivationObject ()
 setDisplayConfirmPostActivation ($status=0)
 displayConfirmPostActivation ()
 toggleStickinessObject ()
 cancelPostObject ()
 quotePostObject ()
 getForumExplorer ()
 fetchTreeChildrenAsyncObject ()
 setTreeStateAsynchObject ()
 checkEnableColumnEdit ()
 cloneWizardPageObject ()
 handleFormInput ($a_text, $a_stripslashes=true)
 prepareFormOutput ($a_text)
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed
 getIcon ($user_toggle_noti)
 isUserAllowedToDeactivateNotification ()
 removeFromDeskObject ()
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
executeCommand ()
 execute command
 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 ()
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 saveObject ()
 save object
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 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.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
- Public Member Functions inherited from ilDesktopItemHandling
 addToDeskObject ()
 Add desktop item public.

Data Fields

 $objProperties
 $object
 $ilias
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false
const CFORM_NEW = 1
const CFORM_IMPORT = 2
const CFORM_CLONE = 3

Protected Member Functions

 initSessionStorage ()
 getEditFormCustomValues (Array &$a_values)
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 initCreationForms ($a_new_type)
 Init creation froms.
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 initEditForm ()
 Init object edit form.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormValues ()
 Get values for edit form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 afterUpdate ()
 Post (successful) object update hook.
 initImportForm ($a_new_type)
 Init object import form.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 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)
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 getTabs (&$tabs_gui)
 get tabs abstract method.
 __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.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission.

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root.
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root.

Detailed Description

Member Function Documentation

ilObjForumGUI::askForPostActivationObject ( )

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

References setDisplayConfirmPostActivation().

{
if($this->is_moderator)
{
}
$this->viewThreadObject();
}

+ Here is the call graph for this function:

ilObjForumGUI::cancelObject (   $in_rep = false)

cancel action and go back to previous page public

Reimplemented from ilObjectGUI.

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

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

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

+ Here is the call graph for this function:

ilObjForumGUI::cancelPostActivationObject ( )

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

{
$this->viewThreadObject();
}
ilObjForumGUI::cancelPostObject ( )

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

{
$_GET['action'] = '';
$this->viewThreadObject();
}
ilObjForumGUI::checkEnableColumnEdit ( )

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

{
return false;
}
ilObjForumGUI::cloneWizardPageObject ( )

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

References $_REQUEST, $title, ilForum\_getThreads(), ilObjectGUI\createObject(), ilUtil\formCheckbox(), ilUtil\getImagePath(), 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']))
{
$this->searchCloneSourceObject();
}
else
{
$this->createObject();
}
return false;
}
$source_id = $_POST['clone_source'];
$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.'.png'));
$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::displayConfirmPostActivation ( )
ilObjForumGUI::fetchTreeChildrenAsyncObject ( )

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

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

{
include_once 'Services/JSON/classes/class.ilJsonUtil.php';
include_once 'Modules/Forum/classes/class.ilForumExplorer.php';
$response = new stdClass();
$response->success = false;
if( $_GET['nodeId'] )
{
$response->success = true;
$response->children = array();
$key = array_search((int)$_GET['nodeId'], (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
if( false === $key )
{
$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes'][] = (int)$_GET['nodeId'];
}
$children = $this->objCurrentTopic->getNestedSetPostChildren(
(int)$_GET['nodeId'],
(array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']
);
$frm = new ilForum();
$pageHits = $frm->getPageHits();
$fetchedNodes = array();
foreach( $children as $child )
{
if($child['parent_pos'] != (int)$_GET['nodeId'] &&
!in_array($child['parent_pos'], $fetchedNodes))
{
continue;
}
$fetchedNodes[] = $child['pos_pk'];
$this->ctrl->setParameter($this, 'thr_pk', (int)$_GET['thr_pk']);
$child,
$this,
$pageHits
);
$responseChild = new stdClass();
$responseChild->nodeId = $child['pos_pk'];
$responseChild->parentId = $child['parent_pos'];
$responseChild->hasChildren = ($child['children'] >= 1);
$responseChild->fetchedWithChildren = in_array((int)$child['pos_pk'], (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
$responseChild->html = $html;
$response->children[] = $responseChild;
}
}
echo ilJsonUtil::encode($response);
exit();
}

+ Here is the call graph for this function:

ilObjForumGUI::getEditFormCustomValues ( Array &  $a_values)
protected

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

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

{
$a_values["desc"] = $this->object->getLongDescription();
$a_values['default_view'] = $this->objProperties->getDefaultView();
$a_values['anonymized'] = $this->objProperties->isAnonymized();
$a_values['statistics_enabled'] = $this->objProperties->isStatisticEnabled();
$a_values['post_activation'] = $this->objProperties->isPostActivationEnabled();
$a_values['subject_setting'] = $this->objProperties->getSubjectSetting();
$a_values['mark_mod_posts'] = $this->objProperties->getMarkModeratorPosts();
$default_view =
in_array((int)$this->objProperties->getDefaultView(), array(ilForumProperties::VIEW_DATE_ASC, ilForumProperties::VIEW_DATE_DESC))
$a_values['default_view'] = $default_view;
$default_view_sort_dir =
(int)$this->objProperties->getDefaultView() != (int)ilForumProperties::VIEW_TREE
? (int)$this->objProperties->getDefaultView()
$a_values['default_view_sort_dir'] = $default_view_sort_dir;
}
ilObjForumGUI::getForumExplorer ( )

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

{
include_once 'Modules/Forum/classes/class.ilForumExplorer.php';
$explorer = new ilForumExplorer(
$this,
$this->objCurrentTopic,
$this->objProperties
);
return $explorer->render()->getHtml();
}
ilObjForumGUI::getForumObjects ( )
private

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

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

{
if(null === $this->forumObjects)
{
$forumObj = $this->object;
$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;
}
}

+ Here is the call graph for this function:

ilObjForumGUI::getIcon (   $user_toggle_noti)

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

Referenced by getUserNotificationTableData().

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

+ Here is the caller graph for this function:

ilObjForumGUI::getModifiedReOnSubject (   $on_reply = false)
private

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

{
$subject = $this->objCurrentPost->getSubject();
$re_txt = $this->lng->txt('post_reply');
$re_txt_with_num = str_replace(':', '(',$re_txt);
$search_length = strlen($re_txt_with_num);
$comp = substr_compare($re_txt_with_num, substr($subject, 0 , $search_length), 0, $search_length);
if($comp == 0)
{
$modified_subject = $subject;
if($on_reply == true)
{
// i.e. $subject = "Re(12):"
$str_pos_start = strpos($subject,'(');
$str_pos_end = strpos($subject,')');
$length = ((int)$str_pos_end - (int)$str_pos_start);
$str_pos_start++;
$txt_number = substr($subject,$str_pos_start, $length-1);
$re_count = (int)$txt_number + 1;
$modified_subject = str_replace($txt_number, $re_count, $subject);
}
}
else
{
$re_count = substr_count($subject, $re_txt);
if($re_count >= 1 && $on_reply == true)
{
$subject = str_replace($re_txt, '', $subject);
// i.e. $subject = "Re: Re: Re: ... " -> "Re(4):"
$re_count++;
$modified_subject = sprintf($this->lng->txt('post_reply_count'), $re_count).' '.trim($subject);
}
else if($re_count >= 1 && $on_reply == false)
{
// possibility to modify the subject only for output
// i.e. $subject = "Re: Re: Re: ... " -> "Re(3):"
$modified_subject = sprintf($this->lng->txt('post_reply_count'), $re_count).' '.trim($subject);
}
else if($re_count == 0)
{
// the first reply to a thread
$modified_subject = $this->lng->txt('post_reply').' '. $this->objCurrentPost->getSubject();
}
}
return $modified_subject;
}
ilObjForumGUI::getReplyEditForm ( )
private

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

References $replyEditForm.

Referenced by quotePostObject().

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

+ Here is the caller graph for this function:

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

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

References ilFormPropertyGUI\setRequired().

Referenced by updateThreadObject().

{
$form = new ilPropertyFormGUI();
$this->ctrl->setParameter($this, 'thr_pk', $a_thread_id);
$form->setFormAction($this->ctrl->getFormAction($this, 'updateThread'));
$ti_prop = new ilTextInputGUI($this->lng->txt('title'), 'title');
$ti_prop->setRequired(true);
$ti_prop->setMaxLength(255);
$ti_prop->setSize(50);
$form->addItem($ti_prop);
$form->addCommandButton('updateThread', $this->lng->txt('save'));
$form->addCommandButton('showThreads', $this->lng->txt('cancel'));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

{
$counter = 0;
$users = array();
foreach($user_ids as $user_id)
{
$frm_noti->setUserId($user_id);
$user_toggle_noti = $frm_noti->isUserToggleNotification();
$icon_ok = $this->getIcon(!$user_toggle_noti);
$users[$counter]['user_id'] = ilUtil::formCheckbox(0, 'user_id[]', $user_id);
$users[$counter]['login'] = ilObjUser::_lookupLogin($user_id);
$name = ilObjUser::_lookupName($user_id);
$users[$counter]['firstname'] = $name['firstname'];
$users[$counter]['lastname'] = $name['lastname'];
$users[$counter]['user_toggle_noti'] = $icon_ok;
$counter++;
}
return $users;
}

+ Here is the call graph for this function:

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

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

References ilUtil\stripSlashes().

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

ilObjForumGUI::hideToolbar (   $a_flag = null)
private

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

References $hideToolbar.

{
if(null === $a_flag)
{
}
$this->hideToolbar = $a_flag;
return $this;
}
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 3627 of file class.ilObjForumGUI.php.

{
$this->ctrl->setCmd('showSummary');
$this->ctrl->setCmdClass('ilinfoscreengui');
$this->infoScreen();
}
ilObjForumGUI::initForumCreateForm (   $object_type)
private
Parameters
string$object_type

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

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

{
$this->create_form_gui = new ilPropertyFormGUI();
$this->create_form_gui->setTableWidth('600px');
$this->create_form_gui->setTitle($this->lng->txt('frm_new'));
$this->create_form_gui->setTitleIcon(ilUtil::getImagePath('icon_frm.png'));
// 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'), ilForumProperties::VIEW_TREE);
$view_group_gui->addOption($view_hir);
$view_dat = new ilRadioOption($this->lng->txt('order_by').' '.$this->lng->txt('date'), ilForumProperties::VIEW_DATE);
$view_group_gui->addOption($view_dat);
$this->create_form_gui->addItem($view_group_gui);
$view_direction_group_gui = new ilRadioGroupInputGUI('', 'default_view_sort_dir');
$view_desc = new ilRadioOption($this->lng->txt('frm_post_sort_desc'), ilForumProperties::VIEW_DATE_DESC);
$view_direction_group_gui->addOption($view_desc);
$view_asc = new ilRadioOption($this->lng->txt('frm_post_sort_asc'), ilForumProperties::VIEW_DATE_ASC);
$view_direction_group_gui->addOption($view_asc);
$view_dat->addSubItem($view_direction_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('enable_anonymous_fora', false))
$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:

ilObjForumGUI::initNotificationSettingsForm ( )
private

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

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

{
if(null === $this->notificationSettingsForm)
{
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, 'updateNotificationSettings'));
$form->setTitle($this->lng->txt('forums_notification_settings'));
$radio_grp = new ilRadioGroupInputGUI('','notification_type');
$radio_grp->setValue('default');
$opt_default = new ilRadioOption($this->lng->txt("user_decides_notification"), 'default');
$opt_0 = new ilRadioOption($this->lng->txt("settings_for_all_members"), 'all_users');
$opt_1 = new ilRadioOption($this->lng->txt("settings_per_users"), 'per_user');
$radio_grp->addOption($opt_default, 'default');
$radio_grp->addOption($opt_0, 'all_users');
$radio_grp->addOption($opt_1, 'per_user');
$chb_2 = new ilCheckboxInputGUI($this->lng->txt('user_toggle_noti'), 'usr_toggle');
$chb_2->setValue(1);
$opt_0->addSubItem($chb_2);
$form->addItem($radio_grp);
$form->addCommandButton('updateNotificationSettings', $this->lng->txt('save'));
$this->notificationSettingsForm = $form;
return false;
}
return true;
}

+ Here is the call graph for this function:

ilObjForumGUI::initSessionStorage ( )
protected

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

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

{
if(!is_array($sess))
{
$sess = array();
}
if(isset($_GET['thr_fk']) && !is_array($sess[(int)$_GET['thr_fk']]))
{
$sess[(int)$_GET['thr_fk']] = array();
}
}

+ Here is the call graph for this function:

ilObjForumGUI::isParentObjectCrsOrGrp ( )
private

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

References ilObjectGUI\$tree.

Referenced by isUserAllowedToDeactivateNotification().

{
global $tree;
// check if there a parent-node is a grp or crs
$grp_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
$crs_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
if($grp_ref_id == 0 && $crs_ref_id == 0)
{
return false;
}
return true;
}

+ Here is the caller graph for this function:

ilObjForumGUI::isUserAllowedToDeactivateNotification ( )

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

References $ilUser, and isParentObjectCrsOrGrp().

{
if($this->objProperties->getNotificationType() == 'default')
{
return true;
}
if($this->objProperties->isUserToggleNoti() == 0)
{
return true;
}
if($this->isParentObjectCrsOrGrp());
{
global $ilUser;
include_once 'Modules/Forum/classes/class.ilForumNotification.php';
$frm_noti = new ilForumNotification((int) $_GET['ref_id']);
$frm_noti->setUserId($ilUser->getId());
$user_toggle = (int)$frm_noti->isUserToggleNotification();
if($user_toggle == 0)
{
return true;
}
}
return false;
}

+ Here is the call graph for this function:

ilObjForumGUI::performPostActivationObject ( )

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

References ilUtil\sendInfo().

{
if($this->is_moderator)
{
$this->objCurrentPost->activatePost();
ilUtil::sendInfo($this->lng->txt('forums_post_was_activated'), true);
}
$this->viewThreadObject();
}

+ Here is the call graph for this function:

ilObjForumGUI::performPostAndChildPostsActivationObject ( )

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

References ilUtil\sendInfo().

{
if($this->is_moderator)
{
$this->objCurrentPost->activatePostAndChildPosts();
ilUtil::sendInfo($this->lng->txt('forums_post_and_children_were_activated'), true);
}
$this->viewThreadObject();
}

+ Here is the call graph for this function:

ilObjForumGUI::prepareFormOutput (   $a_text)

Definition at line 3614 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::quotePostObject ( )

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

References $_POST, and getReplyEditForm().

{
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';
$this->viewThreadObject();
}

+ Here is the call graph for this function:

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

Implements ilDesktopItemHandling.

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

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

{
global $ilSetting, $lng;
if((int)$ilSetting->get('disable_my_offers'))
{
return $this->showThreadsObject();
}
include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
ilUtil::sendSuccess($lng->txt("removed_from_desktop"));
}

+ Here is the call graph for this function:

ilObjForumGUI::setDisplayConfirmPostActivation (   $status = 0)

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

Referenced by askForPostActivationObject().

{
$this->display_confirm_post_activation = $status;
}

+ Here is the caller graph for this function:

ilObjForumGUI::setTopicCreateDefaultValues ( )
private

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

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

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

References $_SESSION, and exit.

{
include_once 'Services/JSON/classes/class.ilJsonUtil.php';
$response = new stdClass();
$response->success = true;
if( $_GET['nodeId'] )
{
if( $_GET['nodeId'] > 0 )
{
$key = array_search((int)$_GET['nodeId'], (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
if( false === $key )
{
$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes'][] = (int)$_GET['nodeId'];
}
}
else
{
$key = array_search((int)abs($_GET['nodeId']), (array)$_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
if( false !== $key )
{
unset($_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes'][$key]);
}
}
}
// Guarantee continuous keys
shuffle($_SESSION['frm'][(int)$_GET['thr_pk']]['openTreeNodes']);
exit();
}
ilObjForumGUI::showThreadsObject ( )

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

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

Referenced by removeFromDeskObject(), and updateThreadObject().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjForumGUI::toggleStickinessObject ( )

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

{
if($this->is_moderator)
{
if($this->objCurrentTopic->isSticky())
{
$this->objCurrentTopic->unmakeSticky();
}
else
{
$this->objCurrentTopic->makeSticky();
}
}
$this->viewThreadObject();
}
ilObjForumGUI::updateThreadObject ( )

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

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

{
if(!$this->is_moderator)
{
$this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
if(!$this->objCurrentTopic->getId())
{
return;
}
$forum_id = ilObjForum::lookupForumIdByObjId($this->object->getId());
if($this->objCurrentTopic->getForumId() != $forum_id)
{
$this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
$form = $this->getThreadEditingForm($this->objCurrentTopic->getId());
if(!$form->checkInput())
{
$form->setValuesByPost();
$this->editThreadObject($this->objCurrentTopic->getId(), $form);
return;
}
$this->objCurrentTopic->setSubject($form->getInput('title'));
$this->objCurrentTopic->updateThreadTitle();
ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
}

+ Here is the call graph for this function:

ilObjForumGUI::updateUserNotifications (   $update_all_users = false)
private

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

References ilForumNotification\_getModerators().

{
include_once 'Modules/Forum/classes/class.ilForumNotification.php';
$oParticipants = $this->getParticipantsObject();
$frm_noti = new ilForumNotification($this->object->getRefId());
$moderator_ids = $frm_noti->_getModerators($this->object->getRefId());
$admin_ids = $oParticipants->getAdmins();
$member_ids = $oParticipants->getMembers();
$tutor_ids = $oParticipants->getTutors();
$all_forum_users = array_merge($moderator_ids, $admin_ids, $member_ids, $tutor_ids);
$all_forum_users= array_unique($all_forum_users);
$all_notis = $frm_noti->read();
foreach($all_forum_users as $user_id)
{
$frm_noti->setUserId($user_id);
$frm_noti->setAdminForce(1);
$frm_noti->setUserToggle($this->objProperties->isUserToggleNoti());
if(array_key_exists($user_id, $all_notis) && $update_all_users)
{
$frm_noti->update();
}
else if($frm_noti->existsNotification() == false)
{
$frm_noti->insertAdminForce();
}
}
}

+ Here is the call graph for this function:

Field Documentation

ilObjForumGUI::$confirmation_gui_html = ''
private

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

ilObjForumGUI::$create_form_gui
private

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

ilObjForumGUI::$create_topic_form_gui
private

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

ilObjForumGUI::$display_confirm_post_activation = 0
private

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

Referenced by displayConfirmPostActivation().

ilObjForumGUI::$forum_overview_setting = null
private

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

ilObjForumGUI::$forumObjects
private

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

Referenced by getForumObjects().

ilObjForumGUI::$hideToolbar = false
private

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

Referenced by hideToolbar().

ilObjForumGUI::$ilias

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

ilObjForumGUI::$is_moderator = false
private

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

ilObjForumGUI::$notificationSettingsForm
private

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

ilObjForumGUI::$objCurrentPost
private

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

ilObjForumGUI::$objCurrentTopic
private

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

ilObjForumGUI::$object

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

Referenced by getForumObjects().

ilObjForumGUI::$objProperties

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

ilObjForumGUI::$replyEditForm
private

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

Referenced by getReplyEditForm().


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