b2evolution PHP Cross Reference Blogging Systems

Source: /inc/comments/views/_comment_mass.form.php - 70 lines - 2356 bytes - Text - Print

Description: This file implements the Comment form for mass deleting.

   1  <?php
   2  /**

   3   * This file implements the Comment form for mass deleting.

   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.com/}.

   9   *

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

  11   *

  12   * @package admin

  13   *

  14   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}

  15   * @author fplanque: Francois PLANQUE

  16   *

  17   * @version $Id: _comment_mass.form.php 1273 2012-04-20 13:23:46Z yura $

  18   */
  19  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  20  
  21  global $Blog, $tab3;
  22  
  23  $Form = new Form( regenerate_url( 'action', '', '', '&' ), 'comment_massdelete' );
  24  
  25  $Form->global_icon( T_('Cancel deleting!'), 'close', '?ctrl=comments&blog='.$Blog->ID.'&tab3='.$tab3, T_('cancel'), 4, 1 );
  26  
  27  $Form->begin_form( 'fform' );
  28  
  29  $Form->add_crumb( 'comment' );
  30  $Form->hidden( 'ctrl', 'comments' );
  31  
  32      $Form->begin_fieldset( T_('Mass deleting') );
  33  
  34      $mass_type_value = 'delete';
  35      $mass_types = array();
  36      if( !$CommentList->is_trashfilter( false ) )
  37      {    // Don't display this option if trashed comments are also displayed
  38          $mass_types[] = array( 'value' => 'recycle', 'label' => T_('Move to Recycle bin') );
  39          $mass_type_value = 'recycle';
  40      }
  41      $mass_types[] = array( 'value' => 'delete', 'label' => T_('Delete permanently') );
  42  
  43      $Form->labelstart = '<b>';
  44      $Form->labelend = '</b>';
  45      $Form->radio_input( 'mass_type', $mass_type_value, $mass_types, sprintf( T_('Are you sure you want to mass delete %s comments?'), $CommentList->total_rows ), array( 'lines' => true ) );
  46  
  47      $Form->submit_input( array(
  48              'id' => 'mass_submit',
  49              'name' => 'actionArray[mass_delete]',
  50              'value' => $mass_type_value == 'recycle' ? T_('Recycle Now!') : T_('Delete Now!'),
  51              'style' => 'margin-left:25%'
  52          ) );
  53  
  54      $Form->end_fieldset();
  55  
  56  $Form->end_form();
  57  ?>
  58  <script type="text/javascript">
  59  jQuery( 'input[name=mass_type]' ).click( function()
  60  {
  61      if( jQuery( this ).val() == 'delete' )
  62      {
  63          jQuery( '#mass_submit' ).val( '<?php echo TS_('Delete Now!') ?>' );
  64      }
  65      else
  66      {
  67          jQuery( '#mass_submit' ).val( '<?php echo TS_('Recycle Now!') ?>' );
  68      }
  69  } );
  70  </script>

title

Description

title

Description

title

Description

title

title

Body