本文整理匯總了PHP中titania::build_quick_actions方法的典型用法代碼示例。如果您正苦於以下問題:PHP titania::build_quick_actions方法的具體用法?PHP titania::build_quick_actions怎麽用?PHP titania::build_quick_actions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類titania
的用法示例。
在下文中一共展示了titania::build_quick_actions方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: build_quick_actions
/**
* Build the quick moderation actions for output for this topic
*
* @param mixed $topic
*/
public static function build_quick_actions($topic)
{
// Auth check
$is_authed = false;
if (phpbb::$auth->acl_get('u_titania_mod_post_mod')) {
$is_authed = true;
} else {
if (phpbb::$auth->acl_get('u_titania_post_mod_own')) {
if (is_object(titania::$contrib) && titania::$contrib->contrib_id == $topic->parent_id && titania::$contrib->is_author || titania::$contrib->is_active_coauthor) {
$is_authed = true;
} else {
if (!is_object(titania::$contrib) || !titania::$contrib->contrib_id == $topic->parent_id) {
$contrib = new titania_contribution();
$contrib->load((int) $topic->parent_id);
if ($contrib->is_author || $contrib->is_active_coauthor) {
$is_authed = true;
}
}
}
}
}
if (!$is_authed) {
return;
}
$actions = array('MAKE_NORMAL' => $topic->topic_sticky ? titania_url::append_url(titania_url::$current_page_url, array('action' => 'unsticky_topic')) : false, 'MAKE_STICKY' => !$topic->topic_sticky ? titania_url::append_url(titania_url::$current_page_url, array('action' => 'sticky_topic')) : false, 'LOCK_TOPIC' => !$topic->topic_locked ? titania_url::append_url(titania_url::$current_page_url, array('action' => 'lock_topic')) : false, 'UNLOCK_TOPIC' => $topic->topic_locked ? titania_url::append_url(titania_url::$current_page_url, array('action' => 'unlock_topic')) : false, 'SOFT_DELETE_TOPIC' => titania_url::append_url(titania_url::$current_page_url, array('action' => 'delete_topic')), 'UNDELETE_TOPIC' => titania_url::append_url(titania_url::$current_page_url, array('action' => 'undelete_topic')));
if (phpbb::$auth->acl_get('u_titania_post_hard_delete')) {
$actions = array_merge($actions, array('HARD_DELETE_TOPIC' => titania_url::append_url(titania_url::$current_page_url, array('action' => 'hard_delete_topic'))));
}
phpbb::$template->assign_var('TOPIC_QUICK_ACTIONS', titania::build_quick_actions($actions));
}