ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
Class Forum core functions for forum. More...
Public Member Functions | |
__construct () | |
Constructor public. More... | |
setLanguage ($lng) | |
setForumId ($a_obj_id) | |
set object id which refers to ILIAS obj_id More... | |
setForumRefId ($a_ref_id) | |
set reference id which refers to ILIAS obj_id More... | |
getForumId () | |
get forum id public More... | |
getForumRefId () | |
get forum ref_id public More... | |
getOrderField () | |
get name of orderField More... | |
setDbTable ($dbTable) | |
set database table More... | |
getDbTable () | |
get name of database table More... | |
setMDB2WhereCondition ($query_string, $data_type, $data_value) | |
set content for additional condition More... | |
getMDB2Query () | |
get content of additional condition More... | |
getMDB2DataValue () | |
/* get content of additional condition More... | |
getMDB2DataType () | |
get content of additional condition More... | |
setPageHits ($pageHits) | |
getPageHits () | |
get number of max. More... | |
getOneTopic () | |
get one topic-dataset by WhereCondition More... | |
getOneThread () | |
get one thread-dataset by WhereCondition More... | |
getOnePost ($post) | |
get one post-dataset More... | |
generatePost ($forum_id, $thread_id, $author_id, $display_user_id, $message, $parent_pos, $notify, $subject='', $alias='', $date='', $status=1, $send_activation_mail=0) | |
generate new dataset in frm_posts More... | |
generateThread (ilForumTopic $thread, $message, $notify, $notify_posts, $status=1) | |
moveThreads ($thread_ids=array(), $src_ref_id=0, $dest_top_frm_fk=0) | |
Moves all chosen threads and their posts to a new forum. More... | |
postCensorship ($message, $pos_pk, $cens=0) | |
update dataset in frm_posts with censorship info More... | |
deletePost ($post) | |
delete post and sub-posts More... | |
getUserStatistic ($is_moderator=false) | |
getFirstPostByThread ($a_thread_id) | |
Get first post of thread. More... | |
getModerators () | |
get all users assigned to local role il_frm_moderator_<frm_ref_id> More... | |
countUserArticles ($a_user_id) | |
get number of articles from given user-ID More... | |
countActiveUserArticles ($a_user_id) | |
convertDate ($date) | |
converts the date format More... | |
addPostTree ($a_tree_id, $a_node_id=-1, $a_date='') | |
create a new post-tree More... | |
insertPostNode ($a_node_id, $a_parent_id, $tree_id, $a_date='') | |
insert node under parent node public More... | |
getPostDepth ($a_node_id, $tree_id) | |
Return depth of an object private. More... | |
getFirstPostNode ($tree_id) | |
get data of the first node from frm_posts_tree and frm_posts public More... | |
getPostNode ($post_id) | |
get data of given node from frm_posts_tree and frm_posts public More... | |
fetchPostNodeData ($a_row) | |
get data of parent node from frm_posts_tree and frm_posts private More... | |
deletePostTree ($a_node) | |
delete node and the whole subtree under this node public More... | |
updateVisits ($ID) | |
update page hits of given forum- or thread-ID public More... | |
prepareText ($text, $edit=0, $quote_user='', $type='') | |
prepares given string public More... | |
getModeratorFromPost ($pos_pk) | |
get one post-dataset More... | |
__deletePostFiles ($a_ids) | |
getImportName () | |
setImportName ($a_import_name) | |
enableForumNotification ($user_id) | |
Enable a user's notification about new posts in this forum. More... | |
disableForumNotification ($user_id) | |
Disable a user's notification about new posts in this forum. More... | |
isForumNotificationEnabled ($user_id) | |
Check whether a user's notification about new posts in this forum is enabled (result > 0) or not (result == 0) More... | |
enableThreadNotification ($user_id, $thread_id) | |
Enable a user's notification about new posts in a thread. More... | |
isThreadNotificationEnabled ($user_id, $thread_id) | |
Check whether a user's notification about new posts in a thread is enabled (result > 0) or not (result == 0) More... | |
Static Public Member Functions | |
static | _getLanguageInstanceByUsrId ($usr_id) |
Get the ilLanguage instance for the passed user id. More... | |
static | _lookupPostMessage ($a_id) |
static | _getModerators ($a_ref_id) |
get all users assigned to local role il_frm_moderator_<frm_ref_id> (static) More... | |
static | _isModerator ($a_ref_id, $a_usr_id) |
checks whether a user is moderator of a given forum object More... | |
static | _getThreads ($a_obj_id, $a_sort_mode=self::SORT_DATE) |
Get thread infos of object. More... | |
static | _lookupObjIdForForumId ($a_for_id) |
static | updateLastPostByObjId ($a_obj_id) |
static | mergeThreads ($obj_id, $source_id, $target_id) |
Data Fields | |
const | SORT_TITLE = 1 |
const | SORT_DATE = 2 |
const | DEFAULT_PAGE_HITS = 30 |
$ilias | |
$lng | |
Static Protected Attributes | |
static | $moderators_by_ref_id_map = array() |
Private Member Functions | |
setOrderField ($orderField) | |
set database field for sorting results More... | |
Private Attributes | |
$dbTable | |
$className ="ilForum" | |
$orderField | |
$mdb2Query | |
$mdb2DataValue | |
$mdb2DataType | |
$txtQuote1 = "[quote]" | |
$txtQuote2 = "[/quote]" | |
$replQuote1 = '<blockquote class="ilForumQuote">' | |
$replQuote2 = '</blockquote>' | |
$pageHits = self::DEFAULT_PAGE_HITS | |
$id | |
ilForum::__construct | ( | ) |
Constructor public.
Definition at line 80 of file class.ilForum.php.
ilForum::__deletePostFiles | ( | $a_ids | ) |
Definition at line 1958 of file class.ilForum.php.
References $file, $files, and getForumId().
Referenced by deletePost().
|
static |
Get the ilLanguage instance for the passed user id.
integer | $usr_id | a user id |
Definition at line 103 of file class.ilForum.php.
References ilObjUser\_lookupLanguage(), and array.
|
static |
get all users assigned to local role il_frm_moderator_<frm_ref_id> (static)
int | $a_ref_id | reference id |
Definition at line 1412 of file class.ilForum.php.
References ilObject\_lookupTitle(), and array.
Referenced by ilForumNotification\checkParentNodeTree(), ilObjForumGUI\getIcon(), ilObjForumNotificationDataProvider\getPostActivationRecipients(), and ilObjForumGUI\updateUserNotifications().
|
static |
Get thread infos of object.
public
int | obj_id of forum |
int | sort mode SORT_TITLE or SORT_DATE |
Definition at line 2173 of file class.ilForum.php.
References $ilDB, $res, $row, and array.
Referenced by ilObjForumGUI\cloneWizardPageObject().
|
static |
checks whether a user is moderator of a given forum object
int | $a_ref_id | reference id |
int | $a_usr_id | user id |
Definition at line 1436 of file class.ilForum.php.
Referenced by ilForumExportGUI\executeCommand(), and ilObjForumGUI\getSubTabs().
|
static |
Definition at line 2203 of file class.ilForum.php.
References $ilDB, $res, and array.
Referenced by ilForumPostingDraftsBlockGUI\fillDataSection(), ilObjMediaObject\getParentObjectIdForUsage(), ilObjForumGUI\mergeThreadsObject(), and ilForumTopic\movePosts().
|
static |
Definition at line 418 of file class.ilForum.php.
References $ilDB, $res, $row, and array.
Referenced by ilObjForum\getDiskUsage().
ilForum::addPostTree | ( | $a_tree_id, | |
$a_node_id = -1 , |
|||
$a_date = '' |
|||
) |
create a new post-tree
integer | a_tree_id: id where tree belongs to |
integer | a_node_id: root node of tree (optional; default is tree_id itself) |
Definition at line 1505 of file class.ilForum.php.
References $ilDB, array, and date.
Referenced by generatePost().
ilForum::convertDate | ( | $date | ) |
converts the date format
string | $date |
Definition at line 1493 of file class.ilForum.php.
References ilDatePresentation\formatDate(), and IL_CAL_DATETIME.
Referenced by getOnePost().
ilForum::countActiveUserArticles | ( | $a_user_id | ) |
Definition at line 1467 of file class.ilForum.php.
References $ilDB, $ilUser, $res, array, and getForumId().
ilForum::countUserArticles | ( | $a_user_id | ) |
get number of articles from given user-ID
integer | $user, | user-ID |
Definition at line 1452 of file class.ilForum.php.
References $ilDB, $res, array, and getForumId().
ilForum::deletePost | ( | $post | ) |
delete post and sub-posts
integer | $post, | ID public |
Definition at line 815 of file class.ilForum.php.
References $data, $GLOBALS, $ilDB, $ilSetting, $ilUser, $mobs, $params, $query, $res, $row, __deletePostFiles(), ilObjMediaObject\_exists(), ilObjMediaObject\_getMobsOfObject(), ilObjMediaObject\_removeUsage(), array, date, deletePostTree(), ilForumProperties\FORUM_OVERVIEW_WITH_NEW_POSTS, ilNewsItem\getFirstNewsIdForContext(), getForumId(), getForumRefId(), ilForumProperties\getInstance(), and getPostNode().
ilForum::deletePostTree | ( | $a_node | ) |
delete node and the whole subtree under this node public
array | node_data of a node |
Definition at line 1746 of file class.ilForum.php.
References $ilDB, $res, $result, $row, and array.
Referenced by deletePost().
ilForum::disableForumNotification | ( | $user_id | ) |
Disable a user's notification about new posts in this forum.
integer | user_id A user's ID |
Definition at line 2074 of file class.ilForum.php.
ilForum::enableForumNotification | ( | $user_id | ) |
Enable a user's notification about new posts in this forum.
integer | user_id A user's ID |
Definition at line 1995 of file class.ilForum.php.
References $counter, $ilDB, $query, $res, $row, array, and isForumNotificationEnabled().
ilForum::enableThreadNotification | ( | $user_id, | |
$thread_id | |||
) |
Enable a user's notification about new posts in a thread.
integer | user_id A user's ID |
integer | thread_id ID of the thread |
Definition at line 2116 of file class.ilForum.php.
References $ilDB, array, and isThreadNotificationEnabled().
ilForum::fetchPostNodeData | ( | $a_row | ) |
get data of parent node from frm_posts_tree and frm_posts private
object | db db result object containing node_data |
Definition at line 1691 of file class.ilForum.php.
References $data, $lng, ilObject\_exists(), and array.
Referenced by getFirstPostNode(), and getPostNode().
ilForum::generatePost | ( | $forum_id, | |
$thread_id, | |||
$author_id, | |||
$display_user_id, | |||
$message, | |||
$parent_pos, | |||
$notify, | |||
$subject = '' , |
|||
$alias = '' , |
|||
$date = '' , |
|||
$status = 1 , |
|||
$send_activation_mail = 0 |
|||
) |
generate new dataset in frm_posts
integer | $topic | |
integer | $thread | |
integer | $author_id | |
integer | $display_user_id | |
string | $message | |
integer | $parent_pos | |
integer | $notify | |
integer | $anonymize | |
string | $subject | |
datetime | $date |
Definition at line 448 of file class.ilForum.php.
References $ilDB, $result, ilRTE\_replaceMediaObjectImageSrc(), addPostTree(), array, date, getForumId(), getForumRefId(), getImportName(), ilForumProperties\getInstance(), ilObjectFactory\getInstanceByRefId(), insertPostNode(), NEWS_NOTICE, NEWS_USERS, and prepareText().
Referenced by generateThread().
ilForum::generateThread | ( | ilForumTopic | $thread, |
$message, | |||
$notify, | |||
$notify_posts, | |||
$status = 1 |
|||
) |
ilForumTopic | $thread | |
string | $message | |
int | $notify | |
int | $notify_posts | |
int | $status |
Definition at line 564 of file class.ilForum.php.
References $ilDB, array, date, ilForumTopic\enableNotification(), generatePost(), ilForumTopic\getCreateDate(), ilForumTopic\getDisplayUserId(), ilForumTopic\getForumId(), ilForumTopic\getId(), getImportName(), ilForumTopic\getSubject(), ilForumTopic\getThrAuthorId(), ilForumTopic\getUserAlias(), ilForumTopic\insert(), ilForumTopic\setCreateDate(), and ilForumTopic\setImportName().
ilForum::getDbTable | ( | ) |
get name of database table
Definition at line 225 of file class.ilForum.php.
References $dbTable.
ilForum::getFirstPostByThread | ( | $a_thread_id | ) |
ilForum::getFirstPostNode | ( | $tree_id | ) |
get data of the first node from frm_posts_tree and frm_posts public
integer | tree id |
Definition at line 1646 of file class.ilForum.php.
References $ilDB, $res, $row, array, and fetchPostNodeData().
ilForum::getForumId | ( | ) |
get forum id public
Definition at line 157 of file class.ilForum.php.
References $id.
Referenced by __deletePostFiles(), countActiveUserArticles(), countUserArticles(), deletePost(), generatePost(), and getUserStatistic().
ilForum::getForumRefId | ( | ) |
get forum ref_id public
Definition at line 167 of file class.ilForum.php.
References $ref_id.
Referenced by deletePost(), generatePost(), getModerators(), and postCensorship().
ilForum::getImportName | ( | ) |
Definition at line 1980 of file class.ilForum.php.
Referenced by generatePost(), and generateThread().
ilForum::getMDB2DataType | ( | ) |
get content of additional condition
Definition at line 282 of file class.ilForum.php.
References $mdb2DataType.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
ilForum::getMDB2DataValue | ( | ) |
/* get content of additional condition
Definition at line 269 of file class.ilForum.php.
References $mdb2DataValue.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
ilForum::getMDB2Query | ( | ) |
get content of additional condition
Definition at line 255 of file class.ilForum.php.
References $mdb2Query.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
ilForum::getModeratorFromPost | ( | $pos_pk | ) |
ilForum::getModerators | ( | ) |
get all users assigned to local role il_frm_moderator_<frm_ref_id>
Definition at line 1400 of file class.ilForum.php.
References getForumRefId().
ilForum::getOnePost | ( | $post | ) |
get one post-dataset
integer | post id |
Definition at line 399 of file class.ilForum.php.
References $ilDB, $res, $row, array, and convertDate().
ilForum::getOneThread | ( | ) |
get one thread-dataset by WhereCondition
Definition at line 370 of file class.ilForum.php.
References $ilDB, $query, $result, array, getMDB2DataType(), getMDB2DataValue(), and getMDB2Query().
ilForum::getOneTopic | ( | ) |
get one topic-dataset by WhereCondition
Definition at line 323 of file class.ilForum.php.
References $ilDB, $query, $res, $row, array, getMDB2DataType(), getMDB2DataValue(), and getMDB2Query().
Referenced by moveThreads().
ilForum::getOrderField | ( | ) |
get name of orderField
Definition at line 196 of file class.ilForum.php.
References $orderField.
ilForum::getPageHits | ( | ) |
get number of max.
visible datasets
Definition at line 311 of file class.ilForum.php.
References $pageHits.
ilForum::getPostDepth | ( | $a_node_id, | |
$tree_id | |||
) |
Return depth of an object private.
integer | node_id of parent's node_id |
integer | node_id of parent's node parent_id |
Definition at line 1617 of file class.ilForum.php.
References $ilDB, $res, and array.
Referenced by insertPostNode().
ilForum::getPostNode | ( | $post_id | ) |
get data of given node from frm_posts_tree and frm_posts public
integer | post_id |
Definition at line 1669 of file class.ilForum.php.
References $ilDB, $res, $row, array, and fetchPostNodeData().
Referenced by deletePost().
ilForum::getUserStatistic | ( | $is_moderator = false | ) |
ilForum::insertPostNode | ( | $a_node_id, | |
$a_parent_id, | |||
$tree_id, | |||
$a_date = '' |
|||
) |
insert node under parent node public
integer | node_id |
integer | tree_id |
integer | parent_id (optional) |
Definition at line 1543 of file class.ilForum.php.
References $ilDB, $res, array, date, and getPostDepth().
Referenced by generatePost().
ilForum::isForumNotificationEnabled | ( | $user_id | ) |
Check whether a user's notification about new posts in this forum is enabled (result > 0) or not (result == 0)
integer | user_id A user's ID |
Definition at line 2094 of file class.ilForum.php.
References $ilDB, $result, and array.
Referenced by enableForumNotification().
ilForum::isThreadNotificationEnabled | ( | $user_id, | |
$thread_id | |||
) |
Check whether a user's notification about new posts in a thread is enabled (result > 0) or not (result == 0)
integer | user_id A user's ID |
integer | thread_id ID of the thread |
Definition at line 2144 of file class.ilForum.php.
References $ilDB, $result, and array.
Referenced by enableThreadNotification().
|
static |
$obj_id | |
$source_id | |
$target_id |
ilException |
Definition at line 2264 of file class.ilForum.php.
References $GLOBALS, $target_id, array, ilForumTopic\deleteByThreadId(), ilObjForum\mergeForumUserRead(), ilForumPost\mergePosts(), ilForumNotification\mergeThreadNotificiations(), updateLastPostByObjId(), and ilForumPostsTree\updateTargetRootRgt().
Referenced by ilObjForumGUI\confirmMergeThreadsObject().
ilForum::moveThreads | ( | $thread_ids = array() , |
|
$src_ref_id = 0 , |
|||
$dest_top_frm_fk = 0 |
|||
) |
Moves all chosen threads and their posts to a new forum.
array | chosen thread pks |
integer | object id of src forum |
integer | object id of dest forum public |
Definition at line 609 of file class.ilForum.php.
References $id, $ilDB, $res, $row, ilObject\_lookupObjectId(), array, getOneTopic(), and setMDB2WhereCondition().
ilForum::postCensorship | ( | $message, | |
$pos_pk, | |||
$cens = 0 |
|||
) |
update dataset in frm_posts with censorship info
string | message |
integer | pos_pk |
Definition at line 732 of file class.ilForum.php.
References $GLOBALS, $ilDB, $res, array, date, ilNewsItem\getFirstNewsIdForContext(), getForumRefId(), and prepareText().
ilForum::prepareText | ( | $text, | |
$edit = 0 , |
|||
$quote_user = '' , |
|||
$type = '' |
|||
) |
prepares given string public
string | |
integer |
Definition at line 1851 of file class.ilForum.php.
References $lng, $text, $txtQuote2, and ilMathJax\getInstance().
Referenced by generatePost(), and postCensorship().
ilForum::setDbTable | ( | $dbTable | ) |
set database table
string | $dbTable | database table |
Definition at line 207 of file class.ilForum.php.
References $dbTable.
ilForum::setForumId | ( | $a_obj_id | ) |
set object id which refers to ILIAS obj_id
integer | object id public |
Definition at line 124 of file class.ilForum.php.
ilForum::setForumRefId | ( | $a_ref_id | ) |
set reference id which refers to ILIAS obj_id
integer | object id public |
Definition at line 141 of file class.ilForum.php.
ilForum::setImportName | ( | $a_import_name | ) |
Definition at line 1984 of file class.ilForum.php.
ilForum::setLanguage | ( | $lng | ) |
Definition at line 88 of file class.ilForum.php.
References $lng.
ilForum::setMDB2WhereCondition | ( | $query_string, | |
$data_type, | |||
$data_value | |||
) |
set content for additional condition
string | $query_string | |
array | $data_type | |
array | $data_value |
Definition at line 240 of file class.ilForum.php.
Referenced by moveThreads().
|
private |
set database field for sorting results
string | $orderField | database field for sorting |
Definition at line 178 of file class.ilForum.php.
References $orderField.
ilForum::setPageHits | ( | $pageHits | ) |
int | $pageHits |
Definition at line 294 of file class.ilForum.php.
References $pageHits.
|
static |
Definition at line 2219 of file class.ilForum.php.
Referenced by mergeThreads().
ilForum::updateVisits | ( | $ID | ) |
update page hits of given forum- or thread-ID public
integer |
Definition at line 1817 of file class.ilForum.php.
References $_SESSION, $ilDB, $query, $res, array, getMDB2DataType(), getMDB2DataValue(), getMDB2Query(), and time.
|
private |
Definition at line 51 of file class.ilForum.php.
|
private |
Definition at line 44 of file class.ilForum.php.
Referenced by getDbTable(), and setDbTable().
|
private |
Definition at line 74 of file class.ilForum.php.
Referenced by getForumId(), and moveThreads().
ilForum::$ilias |
Definition at line 35 of file class.ilForum.php.
Referenced by __construct().
ilForum::$lng |
Definition at line 36 of file class.ilForum.php.
Referenced by __construct(), fetchPostNodeData(), prepareText(), and setLanguage().
|
private |
Definition at line 63 of file class.ilForum.php.
Referenced by getMDB2DataType().
|
private |
Definition at line 62 of file class.ilForum.php.
Referenced by getMDB2DataValue().
|
private |
Definition at line 61 of file class.ilForum.php.
Referenced by getMDB2Query().
|
staticprotected |
Definition at line 28 of file class.ilForum.php.
|
private |
Definition at line 59 of file class.ilForum.php.
Referenced by getOrderField(), and setOrderField().
|
private |
Definition at line 71 of file class.ilForum.php.
Referenced by getPageHits(), and setPageHits().
|
private |
Definition at line 67 of file class.ilForum.php.
|
private |
Definition at line 68 of file class.ilForum.php.
|
private |
Definition at line 65 of file class.ilForum.php.
|
private |
Definition at line 66 of file class.ilForum.php.
Referenced by prepareText().
const ilForum::DEFAULT_PAGE_HITS = 30 |
Definition at line 23 of file class.ilForum.php.
const ilForum::SORT_DATE = 2 |
Definition at line 21 of file class.ilForum.php.
const ilForum::SORT_TITLE = 1 |
Definition at line 20 of file class.ilForum.php.
Referenced by ilObjForumGUI\cloneWizardPageObject().