|
ILIAS
release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
|
Class Forum core functions for forum. More...
Collaboration diagram for ilForum:Public Member Functions | |
| __construct () | |
| Constructor @access 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 @access public More... | |
| getForumRefId () | |
| get forum ref_id @access 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... | |
| _lookupPostMessage ($a_id) | |
| 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 ($forum_id, $author_id, $display_user_id, $subject, $message, $notify, $notify_posts, $alias='', $date='', $status=1) | |
| generate new dataset in frm_threads More... | |
| 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... | |
| _getModerators ($a_ref_id) | |
| get all users assigned to local role il_frm_moderator_<frm_ref_id> (static) 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 @access public More... | |
| getPostDepth ($a_node_id, $tree_id) | |
| Return depth of an object @access private. More... | |
| getFirstPostNode ($tree_id) | |
| get data of the first node from frm_posts_tree and frm_posts @access public More... | |
| getPostNode ($post_id) | |
| get data of given node from frm_posts_tree and frm_posts @access public More... | |
| fetchPostNodeData ($a_row) | |
| get data of parent node from frm_posts_tree and frm_posts @access private More... | |
| deletePostTree ($a_node) | |
| delete node and the whole subtree under this node @access public More... | |
| updateVisits ($ID) | |
| update page hits of given forum- or thread-ID @access public More... | |
| prepareText ($text, $edit=0, $quote_user='', $type='') | |
| prepares given string @access 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 | _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 @access public.
Definition at line 80 of file class.ilForum.php.
| ilForum::__deletePostFiles | ( | $a_ids | ) |
Definition at line 1909 of file class.ilForum.php.
References $file, and getForumId().
Referenced by deletePost().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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().
Here is the call graph for this function:| ilForum::_getModerators | ( | $a_ref_id | ) |
get all users assigned to local role il_frm_moderator_<frm_ref_id> (static)
| int | $a_ref_id | reference id |
Definition at line 1361 of file class.ilForum.php.
References ilObject\_lookupTitle().
Referenced by _isModerator(), getModerators(), and ilObjForumNotificationDataProvider\getPostActivationRecipients().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Get thread infos of object.
@access public
| int | obj_id of forum |
| int | sort mode SORT_TITLE or SORT_DATE |
Definition at line 2124 of file class.ilForum.php.
References $ilDB, $res, $row, SORT_DATE, and SORT_TITLE.
Referenced by ilObjForumGUI\cloneWizardPageObject().
Here is the caller graph for this function:
|
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 1389 of file class.ilForum.php.
References _getModerators().
Referenced by generatePost().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 2154 of file class.ilForum.php.
Referenced by ilObjMediaObject\getParentObjectIdForUsage(), ilObjForumGUI\mergeThreadsObject(), and ilForumTopic\movePosts().
Here is the caller graph for this function:| ilForum::_lookupPostMessage | ( | $a_id | ) |
Definition at line 418 of file class.ilForum.php.
| 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 1458 of file class.ilForum.php.
References $ilDB.
Referenced by generatePost().
Here is the caller graph for this function:| ilForum::convertDate | ( | $date | ) |
converts the date format
| string | $date |
Definition at line 1446 of file class.ilForum.php.
References ilDatePresentation\formatDate(), and IL_CAL_DATETIME.
Referenced by getOnePost().
Here is the call graph for this function:
Here is the caller graph for this function:| ilForum::countActiveUserArticles | ( | $a_user_id | ) |
Definition at line 1420 of file class.ilForum.php.
References $ilDB, $ilUser, $res, and getForumId().
Here is the call graph for this function:| ilForum::countUserArticles | ( | $a_user_id | ) |
get number of articles from given user-ID
| integer | $user, | user-ID |
Definition at line 1405 of file class.ilForum.php.
References $ilDB, $res, and getForumId().
Here is the call graph for this function:| ilForum::deletePost | ( | $post | ) |
delete post and sub-posts
| integer | $post, | ID @access public |
Definition at line 796 of file class.ilForum.php.
References $GLOBALS, $ilDB, $mobs, __deletePostFiles(), ilObjMediaObject\_exists(), ilObjMediaObject\_getMobsOfObject(), ilObjMediaObject\_removeUsage(), deletePostTree(), ilNewsItem\getFirstNewsIdForContext(), getForumRefId(), and getPostNode().
Here is the call graph for this function:| ilForum::deletePostTree | ( | $a_node | ) |
delete node and the whole subtree under this node @access public
| array | node_data of a node |
Definition at line 1699 of file class.ilForum.php.
References $ilDB, $res, $result, and $row.
Referenced by deletePost().
Here is the caller graph for this function:| 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 2025 of file class.ilForum.php.
References $ilDB.
| 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 1946 of file class.ilForum.php.
References $ilDB, $query, $res, $row, and isForumNotificationEnabled().
Here is the call graph for this function:| 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 2067 of file class.ilForum.php.
References $ilDB, and isThreadNotificationEnabled().
Here is the call graph for this function:| ilForum::fetchPostNodeData | ( | $a_row | ) |
get data of parent node from frm_posts_tree and frm_posts @access private
| object | db db result object containing node_data |
Definition at line 1644 of file class.ilForum.php.
References $data, $lng, and ilObject\_exists().
Referenced by getFirstPostNode(), and getPostNode().
Here is the call graph for this function:
Here is the caller graph for this function:| 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, _isModerator(), ilRTE\_replaceMediaObjectImageSrc(), addPostTree(), getForumRefId(), getImportName(), ilObjectFactory\getInstanceByRefId(), insertPostNode(), NEWS_NOTICE, NEWS_USERS, and prepareText().
Referenced by generateThread().
Here is the call graph for this function:
Here is the caller graph for this function:| ilForum::generateThread | ( | $forum_id, | |
| $author_id, | |||
| $display_user_id, | |||
| $subject, | |||
| $message, | |||
| $notify, | |||
| $notify_posts, | |||
$alias = '', |
|||
$date = '', |
|||
$status = 1 |
|||
| ) |
generate new dataset in frm_threads
| integer | $topic | |
| integer | $author_id | |
| integer | $display_user_id | |
| string | $subject | |
| string | $message | |
| integer | $notify | |
| integer | $notify_posts | |
| integer | $anonymize | |
| datetime | $date |
Definition at line 556 of file class.ilForum.php.
References $ilDB, generatePost(), and getImportName().
Here is the call graph for this function:| ilForum::getDbTable | ( | ) |
get name of database table
Definition at line 225 of file class.ilForum.php.
References $dbTable.
| ilForum::getFirstPostByThread | ( | $a_thread_id | ) |
Get first post of thread.
@access public
| int | thread id |
Definition at line 1326 of file class.ilForum.php.
| ilForum::getFirstPostNode | ( | $tree_id | ) |
get data of the first node from frm_posts_tree and frm_posts @access public
| integer | tree id |
Definition at line 1599 of file class.ilForum.php.
References $ilDB, $res, $row, and fetchPostNodeData().
Here is the call graph for this function:| ilForum::getForumId | ( | ) |
get forum id @access public
Definition at line 157 of file class.ilForum.php.
References $id.
Referenced by __deletePostFiles(), countActiveUserArticles(), countUserArticles(), and getUserStatistic().
Here is the caller graph for this function:| ilForum::getForumRefId | ( | ) |
get forum ref_id @access public
Definition at line 167 of file class.ilForum.php.
References $ref_id.
Referenced by deletePost(), generatePost(), getModerators(), and postCensorship().
Here is the caller graph for this function:| ilForum::getImportName | ( | ) |
Definition at line 1931 of file class.ilForum.php.
Referenced by generatePost(), and generateThread().
Here is the caller graph for this function:| ilForum::getMDB2DataType | ( | ) |
get content of additional condition
Definition at line 282 of file class.ilForum.php.
References $mdb2DataType.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
Here is the caller graph for this function:| ilForum::getMDB2DataValue | ( | ) |
/* get content of additional condition
Definition at line 269 of file class.ilForum.php.
References $mdb2DataValue.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
Here is the caller graph for this function:| ilForum::getMDB2Query | ( | ) |
get content of additional condition
@return string
Definition at line 255 of file class.ilForum.php.
References $mdb2Query.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
Here is the caller graph for this function:| ilForum::getModeratorFromPost | ( | $pos_pk | ) |
get one post-dataset
| integer | post id |
Definition at line 1893 of file class.ilForum.php.
| ilForum::getModerators | ( | ) |
get all users assigned to local role il_frm_moderator_<frm_ref_id>
Definition at line 1347 of file class.ilForum.php.
References _getModerators(), and getForumRefId().
Here is the call graph for this function:| ilForum::getOnePost | ( | $post | ) |
get one post-dataset
| integer | post id |
Definition at line 399 of file class.ilForum.php.
References $ilDB, $res, $row, and convertDate().
Here is the call graph for this function:| ilForum::getOneThread | ( | ) |
get one thread-dataset by WhereCondition
Definition at line 370 of file class.ilForum.php.
References $ilDB, $query, $result, getMDB2DataType(), getMDB2DataValue(), and getMDB2Query().
Here is the call graph for this function:| ilForum::getOneTopic | ( | ) |
get one topic-dataset by WhereCondition
Definition at line 323 of file class.ilForum.php.
References $ilDB, $query, $res, $row, getMDB2DataType(), getMDB2DataValue(), and getMDB2Query().
Referenced by moveThreads().
Here is the call graph for this function:
Here is the caller graph for this function:| 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 @access private.
| integer | node_id of parent's node_id |
| integer | node_id of parent's node parent_id |
Definition at line 1570 of file class.ilForum.php.
Referenced by insertPostNode().
Here is the caller graph for this function:| ilForum::getPostNode | ( | $post_id | ) |
get data of given node from frm_posts_tree and frm_posts @access public
| integer | post_id |
Definition at line 1622 of file class.ilForum.php.
References $ilDB, $res, $row, and fetchPostNodeData().
Referenced by deletePost().
Here is the call graph for this function:
Here is the caller graph for this function:| ilForum::getUserStatistic | ( | $is_moderator = false | ) |
Definition at line 1248 of file class.ilForum.php.
References $data, $ilDB, $ilUser, $query, $res, $row, and getForumId().
Here is the call graph for this function:| ilForum::insertPostNode | ( | $a_node_id, | |
| $a_parent_id, | |||
| $tree_id, | |||
$a_date = '' |
|||
| ) |
insert node under parent node @access public
| integer | node_id |
| integer | tree_id |
| integer | parent_id (optional) |
Definition at line 1496 of file class.ilForum.php.
References $ilDB, $res, and getPostDepth().
Referenced by generatePost().
Here is the call graph for this function:
Here is the caller graph for this function:| 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 2045 of file class.ilForum.php.
References $ilDB, and $result.
Referenced by enableForumNotification().
Here is the caller graph for this function:| 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 2095 of file class.ilForum.php.
References $ilDB, and $result.
Referenced by enableThreadNotification().
Here is the caller graph for this function:
|
static |
| $obj_id | |
| $source_id | |
| $target_id |
| ilException |
Definition at line 2215 of file class.ilForum.php.
References $target_id, ilForumTopic\deleteByThreadId(), ilObjForum\mergeForumUserRead(), ilForumPost\mergePosts(), ilForumNotification\mergeThreadNotificiations(), updateLastPostByObjId(), and ilForumPostsTree\updateTargetRootRgt().
Here is the call graph for this function:| 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 @access public |
Definition at line 608 of file class.ilForum.php.
References $id, $ilDB, $res, $row, ilObject\_lookupObjectId(), getOneTopic(), and setMDB2WhereCondition().
Here is the call graph for this function:| ilForum::postCensorship | ( | $message, | |
| $pos_pk, | |||
$cens = 0 |
|||
| ) |
update dataset in frm_posts with censorship info
| string | message |
| integer | pos_pk |
Definition at line 731 of file class.ilForum.php.
References $_SESSION, $GLOBALS, $ilDB, $res, ilNewsItem\getFirstNewsIdForContext(), getForumRefId(), and prepareText().
Here is the call graph for this function:| ilForum::prepareText | ( | $text, | |
$edit = 0, |
|||
$quote_user = '', |
|||
$type = '' |
|||
| ) |
prepares given string @access public
| string | |
| integer |
Definition at line 1804 of file class.ilForum.php.
References $lng, $text, $txtQuote2, and ilUtil\insertLatexImages().
Referenced by generatePost(), and postCensorship().
Here is the call graph for this function:
Here is the caller graph for this function:| 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 @access 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 @access public |
Definition at line 141 of file class.ilForum.php.
| ilForum::setImportName | ( | $a_import_name | ) |
Definition at line 1935 of file class.ilForum.php.
| ilForum::setLanguage | ( | $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().
Here is the caller graph for this function:
|
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 | ) |
|
static |
Definition at line 2170 of file class.ilForum.php.
References $ilDB.
Referenced by mergeThreads().
Here is the caller graph for this function:| ilForum::updateVisits | ( | $ID | ) |
update page hits of given forum- or thread-ID @access public
| integer |
Definition at line 1770 of file class.ilForum.php.
References $_SESSION, $ilDB, $query, $res, getMDB2DataType(), getMDB2DataValue(), and getMDB2Query().
Here is the call graph for this function:
|
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.
Referenced by _getThreads().
| const ilForum::SORT_TITLE = 1 |
Definition at line 20 of file class.ilForum.php.
Referenced by _getThreads(), and ilObjForumGUI\cloneWizardPageObject().