b2evolution PHP Cross Reference Blogging Systems

Source: /inc/antispam/views/_antispam_tools_bankruptcy.view.php - 75 lines - 2838 bytes - Text - Print

Description: This file implements the UI controller for the antispam bankruptcy tool.

   1  <?php
   2  /**

   3   * This file implements the UI controller for the antispam bankruptcy tool.

   4   *

   5   * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.

   6   * See also {@link http://sourceforge.net/projects/evocms/}.

   7   *

   8   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.net/}.

   9   *

  10   * @license http://b2evolution.net/about/license.html GNU General Public License (GPL)

  11   *

  12   * {@internal Open Source relicensing agreement:

  13   * }}

  14   *

  15   * @package admin

  16   *

  17   * @version $Id: _antispam_tools_bankruptcy.view.php 2803 2013-01-22 17:01:38Z yura $

  18   */
  19  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  20  
  21  
  22  global $blogs_list, $delete_bankruptcy_blogs, $bankruptcy_blogs_IDs, $comment_status;
  23  
  24  $Form = new Form();
  25  
  26  $Form->add_crumb( 'antispam' );
  27  $Form->hidden_ctrl();
  28  $Form->hidden( 'tab3', 'tools' );
  29  $Form->hidden( 'tool', 'bankruptcy' );
  30  
  31  $Form->begin_form( 'fform', T_('Declare comment spam bankruptcy...') );
  32  
  33  if( isset( $delete_bankruptcy_blogs ) && $delete_bankruptcy_blogs )
  34  {
  35      $Form->begin_fieldset( T_('Deleting log') );
  36  
  37      antispam_bankruptcy_delete( $bankruptcy_blogs_IDs, $comment_status );
  38  
  39      $Form->end_fieldset();
  40  }
  41  
  42  $visibility_statuses = get_visibility_statuses( '', array() );
  43  $Form->begin_fieldset( T_('Filter comments by status') );
  44      $Form->select_input_array( 'comment_status', $comment_status, $visibility_statuses, T_('Look at comments with status'), '' );
  45      $Form->buttons( array( array( 'submit', 'actionArray[bankruptcy_filter]', T_('Filter') ) ) );
  46  $Form->end_fieldset();
  47  
  48  $Form->begin_fieldset( T_('Select blogs') );
  49  
  50  $blogs_list = antispam_bankruptcy_blogs( $comment_status );
  51  if( empty( $blogs_list ) )
  52  { // No blogs
  53      echo '<p>'.sprintf( T_('No comments found with status %s...'), $visibility_statuses[ $comment_status ] ).'</p>';
  54  }
  55  else
  56  { // Print blogs list
  57      foreach( $blogs_list as $blog )
  58      {
  59          echo '<p><input type="checkbox" name="bankruptcy_blogs[]" value="'.$blog->blog_ID.'" id="bankruptcy_blog_'.$blog->blog_ID.'" /> ';
  60          echo '<label for="bankruptcy_blog_'.$blog->blog_ID.'">'.$blog->blog_name.' ('.sprintf( T_('<b>%s</b> comments with status %s'), $blog->comments_count, $visibility_statuses[ $comment_status ] ).')</label></p>';
  61      }
  62  }
  63  
  64  $Form->end_fieldset();
  65  
  66  $buttons = array();
  67  if( !empty( $blogs_list ) )
  68  {
  69      $buttons[] = array( 'submit', 'actionArray[bankruptcy_delete]', sprintf( T_('Delete ALL comments with status %s from the selected blogs!'), $visibility_statuses[ $comment_status ] ), 'RedButton', 
  70          "return confirm('".sprintf( TS_('ALL comments with status %s\nincluding NON spam\nwill be deleted from the selected blogs.\nThis cannot be undone!\nAre you sure?') , $visibility_statuses[ $comment_status ] )."')" );
  71  }
  72  
  73  $Form->end_form( $buttons );
  74  
  75  ?>

title

Description

title

Description

title

Description

title

title

Body