ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
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... | |
getAllThreads ($a_topic_id, array $params=array(), $limit=0, $offset=0) | |
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... | |
__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) | |
no usage? ..delete . 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 |
$lng | |
$error | |
$db | |
$user | |
$settings | |
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 78 of file class.ilForum.php.
References $DIC, settings(), and user().
ilForum::__deletePostFiles | ( | $a_ids | ) |
Definition at line 1883 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 105 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 1380 of file class.ilForum.php.
References $DIC, ilObject\_lookupTitle(), and array.
Referenced by ilForumNotification\checkParentNodeTree(), ilObjForumNotificationDataProvider\getPostActivationRecipients(), ilForumSettingsGUI\showMembers(), and ilForumSettingsGUI\updateUserNotifications().
|
static |
Get thread infos of object.
int | $a_obj_id | |
int | $a_sort_mode | SORT_TITLE or SORT_DATE |
Definition at line 2085 of file class.ilForum.php.
References $DIC, $ilDB, $res, $row, and array.
Referenced by ilObjForumGUI\cloneWizardPageObject(), and ilObjForumSearchResultTableGUI\parse().
|
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 1403 of file class.ilForum.php.
Referenced by ilObjForumGUI\renderDraftContent(), ilObjForumGUI\renderPostContent(), and ilForumExportGUI\renderPostHtml().
|
static |
Definition at line 2117 of file class.ilForum.php.
References $DIC, $ilDB, $res, and array.
Referenced by ilForumPostingDraftsBlockGUI\fillDataSection(), ilObjMediaObject\getParentObjectIdForUsage(), ilObjForumGUI\mergeThreadsObject(), and ilForumTopic\movePosts().
|
static |
Definition at line 392 of file class.ilForum.php.
References $DIC, $ilDB, $res, $row, and array.
Referenced by ilObjForum\update().
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 1471 of file class.ilForum.php.
Referenced by generatePost().
ilForum::convertDate | ( | $date | ) |
converts the date format
string | $date |
Definition at line 1459 of file class.ilForum.php.
References ilDatePresentation\formatDate(), and IL_CAL_DATETIME.
Referenced by getOnePost().
ilForum::countActiveUserArticles | ( | $a_user_id | ) |
Definition at line 1433 of file class.ilForum.php.
References $res, array, getForumId(), and user().
ilForum::countUserArticles | ( | $a_user_id | ) |
get number of articles from given user-ID
integer | $user, | user-ID |
Definition at line 1418 of file class.ilForum.php.
References $res, array, and getForumId().
ilForum::deletePost | ( | $post | ) |
delete post and sub-posts
integer | $post, | ID public |
Definition at line 782 of file class.ilForum.php.
References $GLOBALS, $i, $mobs, $post, __deletePostFiles(), ilObjForum\_deleteAccessEntries(), ilObjForum\_deleteReadEntries(), ilObjMediaObject\_exists(), ilObjMediaObject\_getMobsOfObject(), ilObjMediaObject\_removeUsage(), array, deletePostTree(), ilNewsItem\getFirstNewsIdForContext(), getForumRefId(), 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 1704 of file class.ilForum.php.
References $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 1990 of file class.ilForum.php.
References array.
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 1917 of file class.ilForum.php.
References $counter, $query, $res, $row, array, and isForumNotificationEnabled().
ilForum::enableThreadNotification | ( | $user_id, | |
$thread_id | |||
) |
no usage? ..delete .
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 2034 of file class.ilForum.php.
References 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 1655 of file class.ilForum.php.
References $data, 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
int | $forum_id | |
int | $thread_id | |
int | $author_id | |
int | $display_user_id | |
string | $message | |
int | $parent_pos | |
int | $notify | |
string | $subject | |
string | $alias | |
string | $date | datetime|timestamp |
int | $status | |
int | $send_activation_mail |
Definition at line 426 of file class.ilForum.php.
References $message, 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 529 of file class.ilForum.php.
References $message, 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().
$a_topic_id | ||
array | $params | |
int | $limit | |
int | $offset |
Definition at line 1029 of file class.ilForum.php.
References $data, $params, $query, $res, $row, array, date, ilForumProperties\FORUM_OVERVIEW_WITH_NEW_POSTS, getForumId(), ilForumProperties\getInstance(), settings(), and user().
ilForum::getDbTable | ( | ) |
get name of database table
Definition at line 217 of file class.ilForum.php.
References $dbTable.
ilForum::getFirstPostByThread | ( | $a_thread_id | ) |
Get first post of thread.
public
int | thread id |
Definition at line 1346 of file class.ilForum.php.
References $res, $row, and array.
ilForum::getFirstPostNode | ( | $tree_id | ) |
get data of the first node from frm_posts_tree and frm_posts public
integer | tree id |
Definition at line 1610 of file class.ilForum.php.
References $res, $row, array, and fetchPostNodeData().
ilForum::getForumId | ( | ) |
get forum id public
Definition at line 155 of file class.ilForum.php.
References $id.
Referenced by __deletePostFiles(), countActiveUserArticles(), countUserArticles(), generatePost(), getAllThreads(), and getUserStatistic().
ilForum::getForumRefId | ( | ) |
get forum ref_id public
Definition at line 165 of file class.ilForum.php.
Referenced by deletePost(), generatePost(), getModerators(), and postCensorship().
ilForum::getImportName | ( | ) |
Definition at line 1902 of file class.ilForum.php.
Referenced by generatePost(), and generateThread().
ilForum::getMDB2DataType | ( | ) |
get content of additional condition
Definition at line 265 of file class.ilForum.php.
References $mdb2DataType.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
ilForum::getMDB2DataValue | ( | ) |
get content of additional condition
Definition at line 254 of file class.ilForum.php.
References $mdb2DataValue.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
ilForum::getMDB2Query | ( | ) |
get content of additional condition
Definition at line 243 of file class.ilForum.php.
References $mdb2Query.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
ilForum::getModerators | ( | ) |
get all users assigned to local role il_frm_moderator_<frm_ref_id>
Definition at line 1368 of file class.ilForum.php.
References getForumRefId().
ilForum::getOnePost | ( | $post | ) |
get one post-dataset
integer | post id |
Definition at line 373 of file class.ilForum.php.
References $post, $res, $row, array, and convertDate().
ilForum::getOneThread | ( | ) |
get one thread-dataset by WhereCondition
Definition at line 347 of file class.ilForum.php.
References $query, $result, array, getMDB2DataType(), getMDB2DataValue(), and getMDB2Query().
ilForum::getOneTopic | ( | ) |
get one topic-dataset by WhereCondition
Definition at line 302 of file class.ilForum.php.
References $query, $res, $row, array, getMDB2DataType(), getMDB2DataValue(), and getMDB2Query().
Referenced by moveThreads().
ilForum::getOrderField | ( | ) |
get name of orderField
Definition at line 191 of file class.ilForum.php.
References $orderField.
ilForum::getPageHits | ( | ) |
get number of max.
visible datasets
Definition at line 292 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 1584 of file class.ilForum.php.
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 1633 of file class.ilForum.php.
References $res, $row, array, and fetchPostNodeData().
Referenced by deletePost().
ilForum::getUserStatistic | ( | $is_moderator = false | ) |
bool | $is_moderator |
Definition at line 1276 of file class.ilForum.php.
References $counter, $data, $query, $res, $row, array, getForumId(), and user().
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 1508 of file class.ilForum.php.
References $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 2009 of file class.ilForum.php.
References $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 2060 of file class.ilForum.php.
References $result, and array.
Referenced by enableThreadNotification().
|
static |
$obj_id | |
$source_id | |
$target_id |
ilException |
Definition at line 2180 of file class.ilForum.php.
References $GLOBALS, $post, $target_id, ilObjForum\_deleteAccessEntries(), array, ilForumTopic\deleteByThreadId(), ilObjForum\mergeForumUserRead(), ilForumPost\mergePosts(), ilForumNotification\mergeThreadNotificiations(), updateLastPostByObjId(), and ilForumPostsTree\updateTargetRootRgt().
Referenced by ilObjForumGUI\performMergeThreadsObject().
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 576 of file class.ilForum.php.
References $id, $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 702 of file class.ilForum.php.
References $GLOBALS, $message, $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 1805 of file class.ilForum.php.
References $i, $text, $txtQuote2, $type, and ilMathJax\getInstance().
Referenced by generatePost(), and postCensorship().
ilForum::setDbTable | ( | $dbTable | ) |
set database table
string | $dbTable | database table |
Definition at line 202 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 125 of file class.ilForum.php.
References $message.
ilForum::setForumRefId | ( | $a_ref_id | ) |
set reference id which refers to ILIAS obj_id
integer | object id public |
Definition at line 140 of file class.ilForum.php.
References $message.
ilForum::setImportName | ( | $a_import_name | ) |
Definition at line 1906 of file class.ilForum.php.
ilForum::setLanguage | ( | $lng | ) |
Definition at line 90 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 230 of file class.ilForum.php.
Referenced by moveThreads().
|
private |
set database field for sorting results
string | $orderField | database field for sorting |
Definition at line 176 of file class.ilForum.php.
References $orderField.
ilForum::setPageHits | ( | $pageHits | ) |
int | $pageHits |
Definition at line 276 of file class.ilForum.php.
References $pageHits.
|
static |
Definition at line 2136 of file class.ilForum.php.
References $DIC, $ilDB, and array.
Referenced by mergeThreads().
ilForum::updateVisits | ( | $ID | ) |
update page hits of given forum- or thread-ID public
integer |
Definition at line 1777 of file class.ilForum.php.
References $_SESSION, $query, $res, array, getMDB2DataType(), getMDB2DataValue(), getMDB2Query(), and time.
|
private |
Definition at line 49 of file class.ilForum.php.
ilForum::$db |
Definition at line 32 of file class.ilForum.php.
|
private |
Definition at line 42 of file class.ilForum.php.
Referenced by getDbTable(), and setDbTable().
ilForum::$error |
Definition at line 31 of file class.ilForum.php.
|
private |
Definition at line 72 of file class.ilForum.php.
Referenced by getForumId(), and moveThreads().
ilForum::$lng |
Definition at line 30 of file class.ilForum.php.
Referenced by setLanguage().
|
private |
Definition at line 61 of file class.ilForum.php.
Referenced by getMDB2DataType().
|
private |
Definition at line 60 of file class.ilForum.php.
Referenced by getMDB2DataValue().
|
private |
Definition at line 59 of file class.ilForum.php.
Referenced by getMDB2Query().
|
staticprotected |
Definition at line 28 of file class.ilForum.php.
|
private |
Definition at line 57 of file class.ilForum.php.
Referenced by getOrderField(), and setOrderField().
|
private |
Definition at line 69 of file class.ilForum.php.
Referenced by getPageHits(), and setPageHits().
|
private |
Definition at line 65 of file class.ilForum.php.
|
private |
Definition at line 66 of file class.ilForum.php.
ilForum::$settings |
Definition at line 34 of file class.ilForum.php.
|
private |
Definition at line 63 of file class.ilForum.php.
|
private |
Definition at line 64 of file class.ilForum.php.
Referenced by prepareText().
ilForum::$user |
Definition at line 33 of file class.ilForum.php.
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().