コード例 #1
0
ファイル: _admin.php プロジェクト: nikrou/dotclear
 public static function adminCommentsActionsPage($core, dcCommentsActionsPage $as)
 {
     $stub_actions = new ArrayObject();
     $core->callBehavior('adminCommentsActionsCombo', array($stub_actions));
     if (!empty($stub_actions)) {
         $as->addAction($stub_actions, array('dcLegacyComments', 'onActionLegacy'));
     }
 }
コード例 #2
0
 public static function adminCommentsActionsPage($core, dcCommentsActionsPage $ap)
 {
     if ($core->auth->check('publish,contentadmin', $core->blog->id)) {
         $ap->addAction(array(__('Status') => array(__('Publish') => 'publish', __('Unpublish') => 'unpublish', __('Mark as pending') => 'pending', __('Mark as junk') => 'junk')), array('dcDefaultCommentActions', 'doChangeCommentStatus'));
     }
     if ($core->auth->check('delete,contentadmin', $core->blog->id)) {
         $ap->addAction(array(__('Delete') => array(__('Delete') => 'delete')), array('dcDefaultCommentActions', 'doDeleteComment'));
     }
     $ip_filter_active = true;
     if ($core->blog->settings->antispam->antispam_filters !== null) {
         $filters_opt = @unserialize($core->blog->settings->antispam->antispam_filters);
         if (is_array($filters_opt)) {
             $ip_filter_active = isset($filters_opt['dcFilterIP']) && is_array($filters_opt['dcFilterIP']) && $filters_opt['dcFilterIP'][0] == 1;
         }
     }
     if ($ip_filter_active) {
         $blacklist_actions = array(__('Blacklist IP') => 'blacklist');
         if ($core->auth->isSuperAdmin()) {
             $blacklist_actions[__('Blacklist IP (global)')] = 'blacklist_global';
         }
         $ap->addAction(array(__('IP address') => $blacklist_actions), array('dcDefaultCommentActions', 'doBlacklistIP'));
     }
 }