当前位置: 首页>>代码示例>>PHP>>正文


PHP titania::build_quick_actions方法代码示例

本文整理汇总了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));
 }
开发者ID:Noxwizard,项目名称:customisation-db,代码行数:35,代码来源:posts.php


注:本文中的titania::build_quick_actions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。