b2evolution PHP Cross Reference Blogging Systems

Source: /inc/users/views/_user_admin.form.php - 456 lines - 21674 bytes - Text - Print

Description: This file implements the UI view for those user preferences which are visible only for admin users. This file is part of the evoCore framework - {@link http://evocore.net/} See also {@link http://sourceforge.net/projects/evocms/}.

   1  <?php
   2  /**
   3   * This file implements the UI view for those user preferences which are visible only for admin users.
   4   *
   5   * This file is part of the evoCore framework - {@link http://evocore.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   * {@internal License choice
  11   * - If you have received this file as part of a package, please find the license.txt file in
  12   *   the same folder or the closest folder above for complete license terms.
  13   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  14   *   then you must choose one of the following licenses before using the file:
  15   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  16   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  17   * }}
  18   *
  19   * {@internal Open Source relicensing agreement:
  20   * }}
  21   *
  22   * @package admin
  23   *
  24   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  25   * @author efy-asimo: Attila Simo
  26   *
  27   * @version $Id: _user_admin.form.php 6136 2014-03-08 07:59:48Z manuel $
  28   */
  29  
  30  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  31  
  32  /**
  33   * @var instance of User class
  34   */
  35  global $edited_User, $UserSettings, $Settings, $Plugins;
  36  
  37  global $current_User;
  38  
  39  global $servertimenow, $admin_url;
  40  
  41  if( !$current_User->check_perm( 'users', 'edit' ) )
  42  { // Check permission:
  43      debug_die( T_( 'You have no permission to see this tab!' ) );
  44  }
  45  
  46  // Begin payload block:
  47  $this->disp_payload_begin();
  48  
  49  // ------------------- PREV/NEXT USER LINKS -------------------
  50  user_prevnext_links( array(
  51          'block_start'  => '<table class="prevnext_user"><tr>',
  52          'prev_start'   => '<td width="33%">',
  53          'prev_end'     => '</td>',
  54          'prev_no_user' => '<td width="33%">&nbsp;</td>',
  55          'back_start'   => '<td width="33%" class="back_users_list">',
  56          'back_end'     => '</td>',
  57          'next_start'   => '<td width="33%" class="right">',
  58          'next_end'     => '</td>',
  59          'next_no_user' => '<td width="33%">&nbsp;</td>',
  60          'block_end'    => '</tr></table>',
  61          'user_tab'     => 'admin'
  62      ) );
  63  // ------------- END OF PREV/NEXT USER LINKS -------------------
  64  
  65  $user_status_icons = get_user_status_icons();
  66  
  67  $Form = new Form( NULL, 'user_checkchanges' );
  68  
  69  $Form->title_fmt = '<span style="float:right">$global_icons$</span><div>$title$</div>'."\n";
  70  
  71  echo_user_actions( $Form, $edited_User, 'edit' );
  72  
  73  $Form->begin_form( 'fform', get_usertab_header( $edited_User, 'admin', T_( 'User admin settings' ) ) );
  74  
  75  $Form->add_crumb( 'user' );
  76  $Form->hidden_ctrl();
  77  $Form->hidden( 'user_tab', 'admin' );
  78  $Form->hidden( 'admin_form', '1' );
  79  
  80  $Form->hidden( 'user_ID', $edited_User->ID );
  81  $Form->hidden( 'edited_user_login', $edited_User->login );
  82  
  83  /***************  User permissions  **************/
  84  
  85  $Form->begin_fieldset( T_('User permissions').get_manual_link('user-admin-permissions'), array( 'class'=>'fieldset clear' ) );
  86  
  87  $edited_User->get_Group();
  88  $level_fieldnote = '[0 - 10]';
  89  
  90  if( $edited_User->ID == 1 )
  91  {    // This is Admin user
  92      echo '<input type="hidden" name="edited_user_grp_ID" value="'.$edited_User->grp_ID.'" />';
  93      $Form->info( T_('Account status'), T_( 'Autoactivated' ) );
  94      $Form->info( T_('User group'), $edited_User->Group->dget('name') );
  95  
  96      $Form->info_field( T_('User level'), $edited_User->get('level'), array( 'note' => $level_fieldnote ) );
  97  }
  98  else
  99  {
 100      $status_icon = '<div id="user_status_icon">'.$user_status_icons[ $edited_User->get( 'status' ) ].'</div>';
 101      $Form->select_input_array( 'edited_user_status', $edited_User->get( 'status' ), get_user_statuses(), T_( 'Account status' ), '', array( 'field_suffix' => $status_icon ) );
 102      $GroupCache = & get_GroupCache();
 103      $Form->select_object( 'edited_user_grp_ID', $edited_User->grp_ID, $GroupCache, T_('User group') );
 104  
 105      $Form->text_input( 'edited_user_level', $edited_User->get('level'), 2, T_('User level'), $level_fieldnote, array( 'required' => true ) );
 106  }
 107  
 108  $Form->end_fieldset(); // user permissions
 109  
 110  $Form->begin_fieldset( T_('Email').get_manual_link('user-admin-email') );
 111      $email_fieldnote = '<a href="mailto:'.$edited_User->get( 'email' ).'" class="roundbutton">'.get_icon( 'email', 'imgtag', array('title'=>T_('Send an email')) ).'</a>';
 112      $Form->text_input( 'edited_user_email', $edited_User->get( 'email' ), 30, T_('Email'), $email_fieldnote, array( 'maxlength' => 100, 'required' => true ) );
 113  
 114      // Get status of email from T_email_blocked table
 115      load_class( 'tools/model/_emailblocked.class.php', 'EmailBlocked' );
 116      $EmailBlockedCache = & get_EmailBlockedCache();
 117      if( $EmailBlocked = & $EmailBlockedCache->get_by_name( $edited_User->get( 'email' ), false, false ) )
 118      {    // The email of this user is located in the T_email_blocked table
 119          $email_status = $EmailBlocked->get( 'status' );
 120      }
 121      else
 122      {    // There is no email address in the T_email_blocked table
 123          $email_status = 'unknown';
 124      }
 125      $email_status_icon = '<div id="email_status_icon">'.emblk_get_status_icon( $email_status ).'</div>';
 126      $Form->select_input_array( 'edited_email_status', $email_status, emblk_get_status_titles(), T_('Email status'), '', array( 'force_keys_as_values' => true, 'background_color' => emblk_get_status_colors(), 'field_suffix' => $email_status_icon ) );
 127  
 128      global $UserSettings;
 129  
 130      // Display notification sender email adderss setting
 131      $default_notification_sender_email = $Settings->get( 'notification_sender_email' );
 132      $notifcation_sender_email = $UserSettings->get( 'notification_sender_email', $edited_User->ID );
 133      $notifcation_sender_email_note = '';
 134      if( empty( $notifcation_sender_email ) )
 135      {
 136          $notifcation_sender_email_note = T_('Will use the default sender address which is:').' '.$default_notification_sender_email;
 137      }
 138      elseif( $default_notification_sender_email != $notifcation_sender_email )
 139      {
 140          $notifcation_sender_email_note = get_icon( 'warning_yellow' ).' '.T_('This is different from the new sender address which is currently:').' '.$default_notification_sender_email;
 141      }
 142      $Form->text_input( 'notification_sender_email', $notifcation_sender_email, 50, T_( 'Sender email address' ), $notifcation_sender_email_note );
 143  
 144      // Display notification sender name setting
 145      $default_notification_sender_name = $Settings->get( 'notification_sender_name' );
 146      $notification_sender_name = $UserSettings->get( 'notification_sender_name', $edited_User->ID );
 147      $notifcation_sender_name_note = '';
 148      if( empty( $notification_sender_name ) )
 149      {
 150          $notifcation_sender_name_note = T_('Will use the default sender name which is:').' '.$default_notification_sender_name;
 151      }
 152      elseif( $default_notification_sender_name != $notification_sender_name )
 153      {
 154          $notifcation_sender_name_note = get_icon( 'warning_yellow' ).' '.T_('This is different from the new sender name which is currently:').' '.$default_notification_sender_name;
 155      }
 156      $Form->text_input( 'notification_sender_name', $notification_sender_name, 50, T_( 'Sender name' ), $notifcation_sender_name_note );
 157  
 158      // Display user account activation info ( Last/Next activate account email )
 159      $account_activation_info = get_account_activation_info( $edited_User );
 160      foreach( $account_activation_info as $field_options )
 161      { // Display each info field
 162          $field_note = isset( $field_options[2] ) ? $field_options[2] : '';
 163          $Form->info_field( $field_options[0], $field_options[1], array( 'note' => $field_note ) );
 164      }
 165  
 166      // Display last unread messages reminder info
 167      $last_unread_messages_reminder = $UserSettings->get( 'last_unread_messages_reminder', $edited_User->ID );
 168      $Form->info_field( T_('Latest unread messages reminder'), empty( $last_unread_messages_reminder ) ? T_('None yet') : format_to_output( $last_unread_messages_reminder ), array( 'note' => T_('Responsable schedule job is "Send reminders about unread messages".') ) );
 169      // Display next unread message reminder info
 170      $reminder_info = get_next_reminder_info( $edited_User->ID );
 171      if( is_array( $reminder_info ) )
 172      { // We have field note to display
 173          $Form->info_field( T_('Next unread messages reminder'), $reminder_info[0], array( 'note' => $reminder_info[1] ) );
 174      }
 175      else
 176      { // Display next reminder info, without note
 177          $Form->info_field( T_('Next unread messages reminder'), $reminder_info );
 178      }
 179  
 180      // Display information about notification emails
 181      $last_notification_email = $UserSettings->get( 'last_notification_email', $edited_User->ID );
 182      if( empty( $last_notification_email ) )
 183      { // Notification email to the edited User was not sent yet
 184          $Form->info_field( T_('Latest notification email'), T_('None yet'), array( 'note' => T_('The latest between all kind of notification emails.') ) );
 185      }
 186      else
 187      { // At least one notification email was sent
 188          // Separator between the last notification email timestamp and counter
 189          $counter_separator = strpos( $last_notification_email, '_' );
 190          $last_notificaiton_timestamp = substr( $last_notification_email, 0, $counter_separator );
 191          $last_notificaiton_date = format_to_output( date2mysql( $last_notificaiton_timestamp ) );
 192          $Form->info_field( T_('Latest notification email'), $last_notificaiton_date, array( 'note' => T_('The latest between all kind of notification emails.') ) );
 193          $notification_counter = ( date( 'Ymd', $servertimenow ) == date( 'Ymd', $last_notificaiton_timestamp ) ) ? substr( $last_notification_email, $counter_separator + 1 ) : 0;
 194          $notification_limit = $UserSettings->get( 'notification_email_limit',  $edited_User->ID );
 195          $Form->info_field( T_('Notifications already sent today'), sprintf( T_('%d out of a maximum allowed of %d'), $notification_counter, $notification_limit ) );
 196      }
 197  
 198      // Display information about newsletters
 199      $last_newsletter = $UserSettings->get( 'last_newsletter', $edited_User->ID );
 200      if( empty( $last_newsletter ) )
 201      { // Newsletter to the edited User was not sent yet
 202          $Form->info_field( T_('Latest newsletter'), T_('None yet') );
 203      }
 204      else
 205      { // At least one newsletter was sent
 206          // Separator between the last newsletter timestamp and counter
 207          $counter_separator = strpos( $last_newsletter, '_' );
 208          $last_newsletter_timestamp = substr( $last_newsletter, 0, $counter_separator );
 209          $last_newsletter_date = format_to_output( date2mysql( $last_newsletter_timestamp ) );
 210          $Form->info_field( T_('Latest newsletter'), $last_newsletter_date );
 211          $newsletter_counter = ( date( 'Ymd', $servertimenow ) == date( 'Ymd', $last_newsletter_timestamp ) ) ? substr( $last_newsletter, $counter_separator + 1 ) : 0;
 212          $newsletter_limit = $UserSettings->get( 'newsletter_limit',  $edited_User->ID );
 213          $Form->info_field( T_('Newsletters already sent today'), sprintf( T_('%d out of a maximum allowed of %d'), $newsletter_counter, $newsletter_limit ) );
 214      }
 215  $Form->end_fieldset(); // Email info
 216  
 217  $Form->begin_fieldset( T_('Usage info').get_manual_link('user-admin-usage') );
 218  
 219      $activity_tab_url = '?ctrl=user&amp;user_ID='.$edited_User->ID.'&amp;user_tab=activity';
 220  
 221      $Form->info_field( T_('ID'), $edited_User->ID );
 222  
 223      // Other users reports from the edited User
 224      $Form->info_field( T_('Reports'), count_reports_from( $edited_User->ID ) );
 225  
 226      // Number of blogs owned by the edited User
 227      $blogs_owned = $edited_User->get_num_blogs();
 228      if( $blogs_owned > 0 )
 229      {
 230          $blogs_owned .= ' - <a href="'.$activity_tab_url.'#owned_blogs_result" class="roundbutton middle" title="'.format_to_output( T_('Go to user activity'), 'htmlattr' ).'">'.get_icon( 'magnifier', 'imgtag', array( 'title' => T_('Go to user activity') ) ).'</a>';
 231      }
 232      $Form->info_field( T_('Blogs owned'), $blogs_owned );
 233  
 234      // Number of post created by the edited User
 235      $posts_created = $edited_User->get_num_posts();
 236      if( $posts_created > 0 )
 237      {
 238          $posts_created .= ' - <a href="'.$activity_tab_url.'#created_posts_result" class="roundbutton middle" title="'.format_to_output( T_('Go to user activity'), 'htmlattr' ).'">'.get_icon( 'magnifier', 'imgtag', array( 'title' => T_('Go to user activity') ) ).'</a>';
 239      }
 240      $Form->info_field( T_('Posts created'), $posts_created );
 241  
 242      // Number of other users post edited by the edited User
 243      $posts_edited = $edited_User->get_num_edited_posts();
 244      if( $posts_edited > 0 )
 245      {
 246          $posts_edited .= ' - <a href="'.$activity_tab_url.'#edited_posts_result" class="roundbutton middle" title="'.format_to_output( T_('Go to user activity'), 'htmlattr' ).'">'.get_icon( 'magnifier', 'imgtag', array( 'title' => T_('Go to user activity') ) ).'</a>';
 247      }
 248      $Form->info_field( T_('Posts edited'), $posts_edited );
 249  
 250      // Number of comments created by the edited User
 251      evo_flush(); // The following might take a while on systems with many comments
 252      $comments_created = $edited_User->get_num_comments();
 253      if( $comments_created > 0 )
 254      {
 255          $comments_created .= ' - <a href="'.$activity_tab_url.'#comments_result" class="roundbutton middle" title="'.format_to_output( T_('Go to user activity'), 'htmlattr' ).'">'.get_icon( 'magnifier', 'imgtag', array( 'title' => T_('Go to user activity') ) ).'</a>';
 256      }
 257      $Form->info_field( T_('Comments'), $comments_created );
 258  
 259      // Number of edited User's sessions
 260      $Form->info_field( T_('# of sessions'), $edited_User->get_num_sessions( true ) );
 261  
 262      // Number of sent and received private messages
 263      $messages_sent = $edited_User->get_num_messages( 'sent' );
 264      if( $messages_sent > 0 )
 265      {
 266          $messages_sent .= ' - <a href="'.$activity_tab_url.'#threads_result" class="roundbutton middle" title="'.format_to_output( T_('Go to user activity'), 'htmlattr' ).'">'.get_icon( 'magnifier', 'imgtag', array( 'title' => T_('Go to user activity') ) ).'</a>';
 267          if( $current_User->check_perm( 'perm_messaging', 'abuse' ) )
 268          {
 269              $messages_sent .= ' - <a href="'.$admin_url.'?ctrl=abuse&amp;colselect_submit=Filter+list&amp;u='.$edited_User->login.'">'.T_('Go to abuse management').' &raquo;</a>';
 270          }
 271      }
 272      $Form->info_field( T_('# of private messages sent'), $messages_sent );
 273      $messages_received = $edited_User->get_num_messages( 'received' );
 274      if( $messages_received > 0 && $current_User->check_perm( 'perm_messaging', 'abuse' ) )
 275      {
 276          $messages_received .= ' - <a href="'.$admin_url.'?ctrl=abuse&amp;colselect_submit=Filter+list&amp;u='.$edited_User->login.'" class="roundbutton middle" title="'.format_to_output( T_('Go to abuse management'), 'htmlattr' ).'">'.get_icon( 'magnifier', 'imgtag', array( 'title' => T_('Go to abuse management') ) ).'</a>';
 277      }
 278      $Form->info_field( T_('# of private messages received'), $messages_received );
 279  
 280      $edited_user_lastseen = $edited_User->get( 'lastseen_ts' );
 281      $Form->info_field( T_('Last seen on'), ( empty( $edited_user_lastseen ) ? '' : mysql2localedatetime( $edited_user_lastseen ) ) );
 282      $Form->info_field( T_('On IP'), $edited_User->get_last_session_param('ipaddress') );
 283  $Form->end_fieldset();
 284  
 285  $from_country = '';
 286  if( !empty( $edited_User->reg_ctry_ID ) )
 287  {    // Get country that was defined by GeoIP Plugin on registration
 288      load_class( 'regional/model/_country.class.php', 'Country' );
 289      load_funcs( 'regional/model/_regional.funcs.php' );
 290      $CountryCache = & get_CountryCache();
 291      $Country = $CountryCache->get_by_ID( $edited_User->reg_ctry_ID );
 292      $from_country = country_flag( $Country->get( 'code' ), $Country->get_name(), 'w16px', 'flag', '', false, true, 'margin-bottom:3px;vertical-align:middle;' ).' '.$Country->get_name();
 293  }
 294  
 295  // Get field suffix for a field 'From Country' from the Plugins
 296  $user_from_country_suffix = '';
 297  $Plugins->restart();
 298  while( $loop_Plugin = & $Plugins->get_next() )
 299  {
 300      $user_from_country_suffix .= $loop_Plugin->GetUserFromCountrySuffix( $tmp_params = array( 'User' => & $edited_User ) );
 301  }
 302  
 303  $Form->begin_fieldset( T_('Registration info').get_manual_link('user-admin-registration') );
 304      $Form->info_field( T_('Account registered on'), $edited_User->dget('datecreated'), array( 'note' => '('.date_ago( strtotime( $edited_User->get( 'datecreated' ) ) ).')') );
 305      $Form->info_field( T_('From IP'), format_to_output( int2ip( $UserSettings->get( 'created_fromIPv4', $edited_User->ID ) ) ) );
 306  
 307      // Get status and name of IP range
 308      $IPRangeCache = & get_IPRangeCache();
 309      if( $IPRange = & $IPRangeCache->get_by_ip( int2ip( $UserSettings->get( 'created_fromIPv4', $edited_User->ID ) ) ) )
 310      {    // IP range exists in DB
 311          $iprange_status = $IPRange->get( 'status' );
 312          $iprange_name = $IPRange->get_name();
 313      }
 314      else
 315      {    // There is no IP range in DB
 316          $iprange_status = '';
 317          $iprange_name = '';
 318      }
 319      $Form->info_field( T_('IP range'), $iprange_name );
 320      $email_status_icon = '<div id="iprange_status_icon">'.aipr_status_icon( $iprange_status ).'</div>';
 321      $Form->select_input_array( 'edited_iprange_status', $iprange_status, aipr_status_titles( true ), T_( 'IP range status' ), '', array( 'force_keys_as_values' => true, 'background_color' => aipr_status_colors(), 'field_suffix' => $email_status_icon ) );
 322  
 323      $Form->info_field( T_('From Country'), $from_country, array( 'field_suffix' => $user_from_country_suffix ) );
 324      $Form->info_field( T_('From Domain'), format_to_output( $UserSettings->get( 'user_domain', $edited_User->ID ) ) );
 325      $Form->info_field( T_('With Browser'), format_to_output( $UserSettings->get( 'user_browser', $edited_User->ID ) ) );
 326  
 327      $Form->text_input( 'edited_user_source', $edited_User->source, 30, T_('Source link/code'), '', array( 'maxlength' => 30 ) );
 328  
 329      $Form->info_field( T_('Registration trigger Page'), $UserSettings->get( 'registration_trigger_url', $edited_User->ID ) );
 330  
 331      $Form->info_field( T_('Initial Blog ID'), $UserSettings->get( 'initial_blog_ID', $edited_User->ID ) );
 332      $Form->info_field( T_('Initial URI'), $UserSettings->get( 'initial_URI', $edited_User->ID ) );
 333      $Form->info_field( T_('Initial referer'), $UserSettings->get( 'initial_referer', $edited_User->ID ) );
 334  
 335      //$registration_ts = strtotime( $edited_User->get( 'datecreated' ) );
 336      if( $edited_User->check_status( 'is_closed' ) )
 337      {
 338          $account_close_ts = $UserSettings->get( 'account_close_ts', $edited_User->ID );
 339          $account_close_date =  empty( $account_close_ts ) ? T_( 'Unknown date' ) : format_to_output( date2mysql( $account_close_ts ) );
 340          //$days_on_site = empty( $account_close_ts ) ? T_( 'Unknown' ) : ( round( ( $account_close_ts - $registration_ts ) / 86400/* 60*60*24 */) );
 341      }
 342      else
 343      {
 344          $account_close_date = 'n/a';
 345          //$days_on_site = ( round( ( $servertimenow - $registration_ts ) / 86400/* 60*60*24 */) );
 346      }
 347  
 348      $Form->info_field( T_('Account closed on'), $account_close_date );
 349      $textarea_params = array( 'cols' => 40, 'class' => 'large', 'maxlength' => 255, 'style' =>'resize: none' );
 350      if( $edited_User->ID == 1 )
 351      {
 352          $textarea_params['disabled'] = "disabled";
 353      }
 354      $Form->textarea_input( 'account_close_reason', $UserSettings->get( 'account_close_reason', $edited_User->ID ), 4, T_('Account close reason'), $textarea_params );
 355      //$Form->info_field( T_('Days on site'), $days_on_site );
 356  
 357  $Form->end_fieldset(); // Registration info
 358  
 359  $action_buttons = array(
 360          array( '', 'actionArray[update]', T_('Save !'), 'SaveButton' ),
 361          array( 'reset', '', T_('Reset'), 'ResetButton' ) );
 362  
 363  $Form->buttons( $action_buttons );
 364  
 365  $Form->end_form();
 366  
 367  // End payload block:
 368  $this->disp_payload_end();
 369  ?>
 370  <script type="text/javascript">
 371  var user_status_icons = new Array;
 372  <?php
 373  foreach( $user_status_icons as $status => $icon )
 374  {    // Init js array with user status icons
 375  ?>
 376  user_status_icons['<?php echo $status; ?>'] = '<?php echo $icon; ?>';
 377  <?php } ?>
 378  
 379  jQuery( '#edited_user_status' ).change( function()
 380  {    // Change icon of the user status
 381      if( typeof user_status_icons[ jQuery( this ).val() ] != 'undefined' )
 382      {
 383          jQuery( '#user_status_icon' ).html( user_status_icons[ jQuery( this ).val() ] );
 384      }
 385      else
 386      {
 387          jQuery( '#user_status_icon' ).html( '' );
 388      }
 389  } );
 390  
 391  var email_status_icons = new Array;
 392  <?php
 393  $email_status_icons = emblk_get_status_icons();
 394  foreach( $email_status_icons as $status => $icon )
 395  {    // Init js array with email status icons
 396  ?>
 397  email_status_icons['<?php echo $status; ?>'] = '<?php echo $icon; ?>';
 398  <?php } ?>
 399  
 400  jQuery( '#edited_email_status' ).change( function()
 401  {    // Change icon of the email status
 402      if( typeof email_status_icons[ jQuery( this ).val() ] != 'undefined' )
 403      {
 404          jQuery( '#email_status_icon' ).html( email_status_icons[ jQuery( this ).val() ] );
 405      }
 406      else
 407      {
 408          jQuery( '#email_status_icon' ).html( '' );
 409      }
 410  } );
 411  
 412  var current_email = '<?php echo $edited_User->get( 'email' ); ?>';
 413  jQuery( 'input#edited_user_email' ).keyup( function()
 414  {    // Disable/Enable to select email status when email address is changed
 415      if( current_email != jQuery( this ).val() )
 416      {    // Disable
 417          if( jQuery( '#edited_email_status' ).html() != '' )
 418          {
 419              email_status_selected = jQuery( '#edited_email_status option:selected' ).val();
 420              email_status_options = jQuery( '#edited_email_status' ).html();
 421          }
 422          //alert(email_status_options);
 423          jQuery( '#edited_email_status' ).html( '' )
 424              .attr( 'disabled', 'disabled' );
 425          jQuery( '#email_status_icon' ).hide();
 426      }
 427      else
 428      {    // Enable
 429          jQuery( '#edited_email_status' ).removeAttr( 'disabled' )
 430              .html( email_status_options );
 431          jQuery( '#edited_email_status option[value=' + email_status_selected + ']' ).attr( 'selected', 'selected' );
 432          jQuery( '#email_status_icon' ).show();
 433      }
 434  } );
 435  
 436  var iprange_status_icons = new Array;
 437  <?php
 438  $iprange_status_icons = aipr_status_icons();
 439  foreach( $iprange_status_icons as $status => $icon )
 440  {    // Init js array with IP range status icons
 441  ?>
 442  iprange_status_icons['<?php echo $status; ?>'] = '<?php echo $icon; ?>';
 443  <?php } ?>
 444  
 445  jQuery( '#edited_iprange_status' ).change( function()
 446  {    // Change icon of the ip range status
 447      if( typeof iprange_status_icons[ jQuery( this ).val() ] != 'undefined' )
 448      {
 449          jQuery( '#iprange_status_icon' ).html( iprange_status_icons[ jQuery( this ).val() ] );
 450      }
 451      else
 452      {
 453          jQuery( '#iprange_status_icon' ).html( '' );
 454      }
 455  } );
 456  </script>

title

Description

title

Description

title

Description

title

title

Body