b2evolution PHP Cross Reference Blogging Systems

Source: /inc/tools/views/_email_blocked.form.php - 92 lines - 3901 bytes - Text - Print

Description: This file display the email address form

   1  <?php
   2  /**

   3   * This file display the email address form

   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   * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.

  10   *

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

  12   *

  13   * @package admin

  14   *

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

  16   * @author fplanque: Francois PLANQUE.

  17   *

  18   * @version $Id: _email_blocked.form.php 849 2012-02-16 09:09:09Z yura $

  19   */
  20  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  21  
  22  global $edited_EmailBlocked;
  23  
  24  // Determine if we are creating or updating...

  25  global $action;
  26  $creating = $action == 'blocked_new';
  27  
  28  $Form = new Form( NULL, 'slug_checkchanges', 'post', 'compact' );
  29  
  30  $Form->global_icon( T_('Cancel editing!'), 'close', regenerate_url( 'action,emblk_ID' ) );
  31  
  32  $Form->begin_form( 'fform', $creating ?  T_('New email address') : T_('Email address') );
  33  
  34      $Form->add_crumb( 'email_blocked' );
  35      $Form->hidden( 'action', 'blocked_save' );
  36      $Form->hiddens_by_key( get_memorized( 'action' ) );
  37  
  38      $Form->text_input( 'emblk_address', $edited_EmailBlocked->get( 'address' ), 50, T_('Email address'), '', array( 'maxlength'=> 255, 'required'=>true ) );
  39  
  40      $email_status_icon = '<div id="email_status_icon">'.emblk_get_status_icon( $edited_EmailBlocked->get( 'status' ) ).'</div>';
  41      $Form->select_input_array( 'emblk_status', $edited_EmailBlocked->get( 'status' ), emblk_get_status_titles(), 'Status', '', array( 'force_keys_as_values' => true, 'background_color' => emblk_get_status_colors(), 'required' => true, 'field_suffix' => $email_status_icon ) );
  42  
  43      $Form->info( T_('Last sent date'), mysql2localedatetime_spans( $edited_EmailBlocked->get( 'last_sent_ts' ), "M-d" ) );
  44  
  45      $Form->text_input( 'emblk_sent_count', $edited_EmailBlocked->get( 'sent_count' ), 20, T_('Sent count'), '' );
  46  
  47      $Form->text_input( 'emblk_sent_last_returnerror', $edited_EmailBlocked->get( 'sent_last_returnerror' ), 20, T_('Sent count since last error'), '' );
  48  
  49      $Form->info( T_('Last error date'), mysql2localedatetime_spans( $edited_EmailBlocked->get( 'last_error_ts' ), "M-d" ) );
  50  
  51      $Form->text_input( 'emblk_prmerror_count', $edited_EmailBlocked->get( 'prmerror_count' ), 20, T_('Permanent errors count'), '' );
  52  
  53      $Form->text_input( 'emblk_tmperror_count', $edited_EmailBlocked->get( 'tmperror_count' ), 20, T_('Temporary errors count'), '' );
  54  
  55      $Form->text_input( 'emblk_spamerror_count', $edited_EmailBlocked->get( 'spamerror_count' ), 20, T_('Spam errors count'), '' );
  56  
  57      $Form->text_input( 'emblk_othererror_count', $edited_EmailBlocked->get( 'othererror_count' ), 20, T_('Other errors count'), '' );
  58  
  59  if( $creating )
  60  {
  61      $Form->end_form( array( array( 'submit', 'submit', T_('Record'), 'SaveButton' ),
  62                              array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
  63  }
  64  else
  65  {
  66      $Form->end_form( array( array( 'submit', 'submit', T_('Update'), 'SaveButton' ),
  67                              array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
  68  }
  69  
  70  ?>
  71  <script type="text/javascript">
  72  var email_status_icons = new Array;
  73  <?php
  74  $email_status_icons = emblk_get_status_icons();
  75  foreach( $email_status_icons as $status => $icon )
  76  {    // Init js array with email status icons
  77  ?>
  78  email_status_icons['<?php echo $status; ?>'] = '<?php echo $icon; ?>';
  79  <?php } ?>
  80  
  81  jQuery( '#emblk_status' ).change( function()
  82  {
  83      if( typeof email_status_icons[ jQuery( this ).val() ] != 'undefined' )
  84      {
  85          jQuery( '#email_status_icon' ).html( email_status_icons[ jQuery( this ).val() ] );
  86      }
  87      else
  88      {
  89          jQuery( '#email_status_icon' ).html( '' );
  90      }
  91  } );
  92  </script>

title

Description

title

Description

title

Description

title

title

Body