ILIAS
Release_5_0_x_branch Revision 61816
|
Class Forum core functions for forum. More...
Public Member Functions | |
__construct () | |
Constructor public. | |
setLanguage ($lng) | |
setForumId ($a_obj_id) | |
set object id which refers to ILIAS obj_id | |
setForumRefId ($a_ref_id) | |
set reference id which refers to ILIAS obj_id | |
getForumId () | |
// | |
getForumRefId () | |
get forum ref_id public | |
getOrderField () | |
get name of orderField | |
setDbTable ($dbTable) | |
set database table | |
getDbTable () | |
get name of database table | |
setMDB2WhereCondition ($query_string, $data_type, $data_value) | |
set content for additional condition | |
getMDB2Query () | |
get content of additional condition | |
getMDB2DataValue () | |
/* get content of additional condition | |
getMDB2DataType () | |
get content of additional condition | |
setPageHits ($pageHits) | |
set number of max. | |
getPageHits () | |
get number of max. | |
getOneTopic () | |
get one topic-dataset by WhereCondition | |
getOneThread () | |
get one thread-dataset by WhereCondition | |
getOnePost ($post) | |
get one post-dataset | |
_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 | |
generateThread ($forum_id, $author_id, $display_user_id, $subject, $message, $notify, $notify_posts, $alias= '', $date= '', $status=1) | |
generate new dataset in frm_threads | |
moveThreads ($thread_ids=array(), $src_ref_id=0, $dest_top_frm_fk=0) | |
Moves all chosen threads and their posts to a new forum. | |
postCensorship ($message, $pos_pk, $cens=0) | |
update dataset in frm_posts with censorship info | |
deletePost ($post) | |
delete post and sub-posts | |
getUserStatistic ($is_moderator=false) | |
getFirstPostByThread ($a_thread_id) | |
Get first post of thread. | |
getModerators () | |
get all users assigned to local role il_frm_moderator_<frm_ref_id> | |
_getModerators ($a_ref_id) | |
get all users assigned to local role il_frm_moderator_<frm_ref_id> (static) | |
countUserArticles ($a_user_id) | |
get number of articles from given user-ID | |
countActiveUserArticles ($a_user_id) | |
convertDate ($date) | |
converts the date format | |
addPostTree ($a_tree_id, $a_node_id=-1, $a_date= '') | |
create a new post-tree | |
insertPostNode ($a_node_id, $a_parent_id, $tree_id, $a_date= '') | |
insert node under parent node public | |
getPostDepth ($a_node_id, $tree_id) | |
Return depth of an object private. | |
getFirstPostNode ($tree_id) | |
get data of the first node from frm_posts_tree and frm_posts public | |
getPostNode ($post_id) | |
get data of given node from frm_posts_tree and frm_posts public | |
fetchPostNodeData ($a_row) | |
get data of parent node from frm_posts_tree and frm_posts private | |
deletePostTree ($a_node) | |
delete node and the whole subtree under this node public | |
updateVisits ($ID) | |
update page hits of given forum- or thread-ID public | |
prepareText ($text, $edit=0, $quote_user= '', $type= '') | |
prepares given string public | |
getModeratorFromPost ($pos_pk) | |
get one post-dataset | |
__deletePostFiles ($a_ids) | |
__sendMessage ($a_parent_pos, $post_data=array()) | |
getImportName () | |
setImportName ($a_import_name) | |
enableForumNotification ($user_id) | |
Enable a user's notification about new posts in this forum. | |
disableForumNotification ($user_id) | |
Disable a user's notification about new posts in this forum. | |
isForumNotificationEnabled ($user_id) | |
Check whether a user's notification about new posts in this forum is enabled (result > 0) or not (result == 0) | |
enableThreadNotification ($user_id, $thread_id) | |
Enable a user's notification about new posts in a thread. | |
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) | |
sendThreadNotifications ($post_data) | |
sendForumNotifications ($post_data) | |
sendPostActivationNotification ($post_data) | |
formatNotificationSubject ($post_data) | |
formatNotification ($post_data, $cron=0, $attachments=array(), $user_id) |
Static Public Member Functions | |
static | _getLanguageInstanceByUsrId ($usr_id) |
Get the ilLanguage instance for the passed user id. | |
static | _isModerator ($a_ref_id, $a_usr_id) |
checks whether a user is moderator of a given forum object | |
static | _getThreads ($a_obj_id, $a_sort_mode=self::SORT_DATE) |
Get thread infos of object. | |
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 |
$ilias | |
$lng |
Private Member Functions | |
setOrderField ($orderField) | |
set database field for sorting results | |
__formatMessage ($thread_data, $post_data=array(), $user_obj) | |
generates the notificiation message, if a post has been answered | |
formatPostActivationNotification ($post_data, $user_id) |
Private Attributes | |
$dbTable | |
$className = "ilForum" | |
$orderField | |
$mdb2Query | |
$mdb2DataValue | |
$mdb2DataType | |
$txtQuote1 = "[quote]" | |
$txtQuote2 = "[/quote]" | |
$replQuote1 = '<blockquote class="ilForumQuote">' | |
$replQuote2 = '</blockquote>' | |
$pageHits = 30 | |
$id |
Class Forum core functions for forum.
Definition at line 18 of file class.ilForum.php.
ilForum::__construct | ( | ) |
ilForum::__deletePostFiles | ( | $a_ids | ) |
Definition at line 1889 of file class.ilForum.php.
References $file, and getForumId().
Referenced by deletePost().
|
private |
generates the notificiation message, if a post has been answered
array | $thread_data | |
array | $post_data | |
object | $user_obj | ilObjUser |
Definition at line 1951 of file class.ilForum.php.
References ilMail\_getInstallationSignature(), _getLanguageInstanceByUsrId(), getForumRefId(), ilObjectFactory\getInstanceByRefId(), and ilMail\getSalutation().
Referenced by __sendMessage().
ilForum::__sendMessage | ( | $a_parent_pos, | |
$post_data = array() |
|||
) |
Definition at line 1912 of file class.ilForum.php.
References $ilDB, $ilUser, __formatMessage(), formatNotificationSubject(), getOnePost(), getOneThread(), and setMDB2WhereCondition().
|
static |
Get the ilLanguage instance for the passed user id.
integer | $usr_id | a user id |
Definition at line 96 of file class.ilForum.php.
References ilObjUser\_lookupLanguage().
Referenced by __formatMessage(), formatNotification(), formatPostActivationNotification(), and ilForumCronNotification\sendMails().
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 1345 of file class.ilForum.php.
References ilObject\_lookupTitle().
Referenced by _isModerator(), and getModerators().
|
static |
Get thread infos of object.
public
int | obj_id of forum |
int | sort mode SORT_TITLE or SORT_DATE |
Definition at line 2546 of file class.ilForum.php.
References $ilDB, $res, and $row.
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 1373 of file class.ilForum.php.
References _getModerators().
Referenced by generatePost().
|
static |
Definition at line 2576 of file class.ilForum.php.
Referenced by ilObjMediaObject\getParentObjectIdForUsage(), ilObjForumGUI\mergeThreadsObject(), ilForumTopic\movePosts(), sendForumNotifications(), and sendThreadNotifications().
ilForum::_lookupPostMessage | ( | $a_id | ) |
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 1438 of file class.ilForum.php.
References $ilDB.
Referenced by generatePost().
ilForum::convertDate | ( | $date | ) |
converts the date format
string | $date |
Definition at line 1426 of file class.ilForum.php.
References ilDatePresentation\formatDate(), and IL_CAL_DATETIME.
Referenced by getOnePost().
ilForum::countActiveUserArticles | ( | $a_user_id | ) |
Definition at line 1400 of file class.ilForum.php.
References $ilDB, $ilUser, $res, and getForumId().
ilForum::countUserArticles | ( | $a_user_id | ) |
get number of articles from given user-ID
integer | $user,: | user-ID |
Definition at line 1385 of file class.ilForum.php.
References $ilDB, $res, and getForumId().
ilForum::deletePost | ( | $post | ) |
delete post and sub-posts
integer | $post,: | ID public |
Definition at line 790 of file class.ilForum.php.
References $ilDB, $mobs, __deletePostFiles(), ilObjMediaObject\_exists(), ilObjMediaObject\_getMobsOfObject(), ilObjMediaObject\_removeUsage(), deletePostTree(), ilNewsItem\getFirstNewsIdForContext(), 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 1679 of file class.ilForum.php.
References $ilDB, $res, $result, and $row.
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 2070 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 1991 of file class.ilForum.php.
References $ilDB, $query, $res, $row, 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 2112 of file class.ilForum.php.
References $ilDB, 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 1624 of file class.ilForum.php.
References $lng, and ilObject\_exists().
Referenced by getFirstPostNode(), and getPostNode().
ilForum::formatNotification | ( | $post_data, | |
$cron = 0 , |
|||
$attachments = array() , |
|||
$user_id | |||
) |
$post_data | ||
int | $cron | |
array | $attachments | |
int | $user_id | user_id of mail-recipient |
Definition at line 2466 of file class.ilForum.php.
References $ilIliasIniFile, _getLanguageInstanceByUsrId(), and ilMail\getSalutation().
Referenced by sendForumNotifications(), and sendThreadNotifications().
ilForum::formatNotificationSubject | ( | $post_data | ) |
array | $post_data | use $post_data['top_name'] for forum-title |
Definition at line 2454 of file class.ilForum.php.
Referenced by __sendMessage(), sendForumNotifications(), sendPostActivationNotification(), and sendThreadNotifications().
|
private |
$post_data | |
$user_id |
Definition at line 2351 of file class.ilForum.php.
References _getLanguageInstanceByUsrId(), and ilMail\getSalutation().
Referenced by sendPostActivationNotification().
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 446 of file class.ilForum.php.
References $ilDB, $result, _isModerator(), ilRTE\_replaceMediaObjectImageSrc(), addPostTree(), getForumRefId(), getImportName(), ilObjectFactory\getInstanceByRefId(), insertPostNode(), NEWS_NOTICE, NEWS_USERS, prepareText(), and sendPostActivationNotification().
Referenced by generateThread().
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 562 of file class.ilForum.php.
References $ilDB, generatePost(), and getImportName().
ilForum::getDbTable | ( | ) |
get name of database table
Definition at line 219 of file class.ilForum.php.
References $dbTable.
ilForum::getFirstPostByThread | ( | $a_thread_id | ) |
Get first post of thread.
public
int | thread id |
Definition at line 1310 of file class.ilForum.php.
ilForum::getFirstPostNode | ( | $tree_id | ) |
get data of the first node from frm_posts_tree and frm_posts public
integer | tree id |
Definition at line 1579 of file class.ilForum.php.
References $ilDB, $res, $row, and fetchPostNodeData().
ilForum::getForumId | ( | ) |
//
Definition at line 151 of file class.ilForum.php.
References $id.
Referenced by __deletePostFiles(), countActiveUserArticles(), countUserArticles(), and getUserStatistic().
ilForum::getForumRefId | ( | ) |
get forum ref_id public
Definition at line 161 of file class.ilForum.php.
References $ref_id.
Referenced by __formatMessage(), generatePost(), and getModerators().
ilForum::getImportName | ( | ) |
Definition at line 1976 of file class.ilForum.php.
Referenced by generatePost(), and generateThread().
ilForum::getMDB2DataType | ( | ) |
get content of additional condition
Definition at line 276 of file class.ilForum.php.
References $mdb2DataType.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
ilForum::getMDB2DataValue | ( | ) |
/* get content of additional condition
Definition at line 263 of file class.ilForum.php.
References $mdb2DataValue.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
ilForum::getMDB2Query | ( | ) |
get content of additional condition
Definition at line 249 of file class.ilForum.php.
References $mdb2Query.
Referenced by getOneThread(), getOneTopic(), and updateVisits().
ilForum::getModeratorFromPost | ( | $pos_pk | ) |
get one post-dataset
integer | post id |
Definition at line 1873 of file class.ilForum.php.
ilForum::getModerators | ( | ) |
get all users assigned to local role il_frm_moderator_<frm_ref_id>
Definition at line 1331 of file class.ilForum.php.
References _getModerators(), and getForumRefId().
Referenced by sendPostActivationNotification().
ilForum::getOnePost | ( | $post | ) |
get one post-dataset
integer | post id |
Definition at line 397 of file class.ilForum.php.
References $ilDB, $res, $row, and convertDate().
Referenced by __sendMessage().
ilForum::getOneThread | ( | ) |
get one thread-dataset by WhereCondition
Definition at line 368 of file class.ilForum.php.
References $ilDB, $query, $result, getMDB2DataType(), getMDB2DataValue(), and getMDB2Query().
Referenced by __sendMessage().
ilForum::getOneTopic | ( | ) |
get one topic-dataset by WhereCondition
Definition at line 321 of file class.ilForum.php.
References $ilDB, $query, $res, $row, getMDB2DataType(), getMDB2DataValue(), and getMDB2Query().
Referenced by moveThreads().
ilForum::getOrderField | ( | ) |
get name of orderField
Definition at line 190 of file class.ilForum.php.
References $orderField.
ilForum::getPageHits | ( | ) |
get number of max.
visible datasets
Definition at line 309 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 1550 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 1602 of file class.ilForum.php.
References $ilDB, $res, $row, and fetchPostNodeData().
Referenced by deletePost().
ilForum::getUserStatistic | ( | $is_moderator = false | ) |
Definition at line 1232 of file class.ilForum.php.
References $ilDB, $ilUser, $query, $res, $row, and getForumId().
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 1476 of file class.ilForum.php.
References $ilDB, $res, 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 2090 of file class.ilForum.php.
References $ilDB, and $result.
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 2140 of file class.ilForum.php.
References $ilDB, and $result.
Referenced by enableThreadNotification().
|
static |
$obj_id | |
$source_id | |
$target_id |
ilException |
Definition at line 2637 of file class.ilForum.php.
References $target_id, ilForumTopic\deleteByThreadId(), ilObjForum\mergeForumUserRead(), ilForumPost\mergePosts(), ilForumNotification\mergeThreadNotificiations(), updateLastPostByObjId(), and ilForumPostsTree\updateTargetRootRgt().
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 614 of file class.ilForum.php.
References $id, $ilDB, $res, $row, ilObject\_lookupObjectId(), 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 737 of file class.ilForum.php.
References $_SESSION, $ilDB, $res, ilNewsItem\getFirstNewsIdForContext(), and prepareText().
ilForum::prepareText | ( | $text, | |
$edit = 0 , |
|||
$quote_user = '' , |
|||
$type = '' |
|||
) |
prepares given string public
string | |
integer |
Definition at line 1784 of file class.ilForum.php.
References $lng, $txtQuote2, and ilUtil\insertLatexImages().
Referenced by generatePost(), and postCensorship().
ilForum::sendForumNotifications | ( | $post_data | ) |
Definition at line 2252 of file class.ilForum.php.
References $ilDB, $ilUser, $lng, $ref_id, $res, $result, $row, ilObject\_getAllReferences(), ilObjUser\_lookupLogin(), _lookupObjIdForForumId(), formatNotification(), formatNotificationSubject(), and setLanguage().
ilForum::sendPostActivationNotification | ( | $post_data | ) |
Definition at line 2392 of file class.ilForum.php.
References $ilDB, $ilUser, $lng, $result, ilObjUser\_lookupLogin(), formatNotificationSubject(), formatPostActivationNotification(), getModerators(), and setLanguage().
Referenced by generatePost().
ilForum::sendThreadNotifications | ( | $post_data | ) |
Definition at line 2160 of file class.ilForum.php.
References $_SESSION, $ilDB, $lng, $ref_id, $res, $result, $row, ilObject\_getAllReferences(), ilObjUser\_lookupLogin(), _lookupObjIdForForumId(), formatNotification(), formatNotificationSubject(), and setLanguage().
ilForum::setDbTable | ( | $dbTable | ) |
set database table
string | $dbTable | database table |
Definition at line 201 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 117 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 134 of file class.ilForum.php.
ilForum::setImportName | ( | $a_import_name | ) |
Definition at line 1980 of file class.ilForum.php.
ilForum::setLanguage | ( | $lng | ) |
Definition at line 81 of file class.ilForum.php.
References $lng.
Referenced by sendForumNotifications(), sendPostActivationNotification(), and sendThreadNotifications().
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 234 of file class.ilForum.php.
Referenced by __sendMessage(), and moveThreads().
|
private |
set database field for sorting results
string | $orderField | database field for sorting |
Definition at line 172 of file class.ilForum.php.
References $orderField.
ilForum::setPageHits | ( | $pageHits | ) |
set number of max.
visible datasets
integer | $pageHits |
Definition at line 290 of file class.ilForum.php.
References $pageHits.
|
static |
Definition at line 2592 of file class.ilForum.php.
References $ilDB.
Referenced by mergeThreads().
ilForum::updateVisits | ( | $ID | ) |
update page hits of given forum- or thread-ID public
integer |
Definition at line 1750 of file class.ilForum.php.
References $_SESSION, $ilDB, $query, $res, getMDB2DataType(), getMDB2DataValue(), and getMDB2Query().
|
private |
Definition at line 44 of file class.ilForum.php.
|
private |
Definition at line 37 of file class.ilForum.php.
Referenced by getDbTable(), and setDbTable().
|
private |
Definition at line 67 of file class.ilForum.php.
Referenced by getForumId(), and moveThreads().
ilForum::$ilias |
Definition at line 28 of file class.ilForum.php.
Referenced by __construct().
ilForum::$lng |
Definition at line 29 of file class.ilForum.php.
Referenced by __construct(), fetchPostNodeData(), prepareText(), sendForumNotifications(), sendPostActivationNotification(), sendThreadNotifications(), and setLanguage().
|
private |
Definition at line 56 of file class.ilForum.php.
Referenced by getMDB2DataType().
|
private |
Definition at line 55 of file class.ilForum.php.
Referenced by getMDB2DataValue().
|
private |
Definition at line 54 of file class.ilForum.php.
Referenced by getMDB2Query().
|
private |
Definition at line 52 of file class.ilForum.php.
Referenced by getOrderField(), and setOrderField().
|
private |
Definition at line 64 of file class.ilForum.php.
Referenced by getPageHits(), and setPageHits().
|
private |
Definition at line 60 of file class.ilForum.php.
|
private |
Definition at line 61 of file class.ilForum.php.
|
private |
Definition at line 58 of file class.ilForum.php.
|
private |
Definition at line 59 of file class.ilForum.php.
Referenced by prepareText().
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().