[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-admin/includes/settings/subscriptions/newsletter/ -> form.php (source)

   1  <!-- subscriptions > newsletter -->
   2  <?php // newsletter
   3  
   4  global $mp_general, $mp_subscriptions, $mp_registered_newsletters;
   5  
   6  if ( !isset( $subscriptions ) ) $subscriptions = $mp_subscriptions;
   7  if ( !isset( $subscriptions['default_newsletters'] ) ) $subscriptions['default_newsletters'] = array();
   8  
   9  $col = count( MailPress_newsletter::xml_files );
  10  $item  = 1;
  11  $row = $col * $item;
  12  $i = $j = $td = $tr = $alt = 0;
  13  
  14  $out = '';
  15  
  16  foreach ( $mp_registered_newsletters as $mp_registered_newsletter )
  17  {
  18      if ( intval ( $i/$row ) == $i/$row ) 
  19      {
  20          $alt++;
  21          $alternate = ( 1 == $alt ) ? ' class="bkgndc bd1sc"' : ( ( ( $alt/2 ) != intval( $alt/2 ) ) ? ' class="bkgndc"' : '' );
  22          $tr = true; 
  23          $td = 0;
  24  
  25          $out .= '<tr' . $alternate . '><th>';
  26          $out .= apply_filters( 'MailPress_subscriptions_newsletter_th', '** ' . __( 'Post' ) . ' **', $mp_registered_newsletter );
  27          $out .= '</th>';
  28      }
  29      if ( intval ( $j/$item ) == $j/$item )
  30      {
  31          $out .= '<td>';
  32          ++$td;
  33      }
  34  
  35      $default_style = ( isset( $subscriptions['newsletters'][$mp_registered_newsletter['id']] ) ) ? '' : ' class="hidden"' ;
  36      $out .= '<label for="newsletter_' . $mp_registered_newsletter['id'] . '">';
  37      $out .= '<input type="checkbox" name="subscriptions[newsletters][' . $mp_registered_newsletter['id'] . ']" id="newsletter_' . $mp_registered_newsletter['id'] . '" class="newsletter"' . checked( isset( $subscriptions['newsletters'][$mp_registered_newsletter['id']] ), true, false ) . ' newsletter="' . $mp_registered_newsletter['id'] . '" newsletter_description="' . esc_attr( $mp_registered_newsletter['descriptions']['admin'] ) . '" />';
  38      $out .= '&#160;' . $mp_registered_newsletter['descriptions']['admin'];
  39      $out .= '</label><br />';
  40      $out .= '<label for="default_newsletter_' . $mp_registered_newsletter['id'] . '">';
  41      $out .= '<span id="span_default_newsletter_' . $mp_registered_newsletter['id'] . '"' . $default_style . '>';
  42      $out .= '<input type="checkbox" name="subscriptions[default_newsletters][' . $mp_registered_newsletter['id'] . ']" id="default_newsletter_' . $mp_registered_newsletter['id'] . '"' . checked( isset( $subscriptions['default_newsletters'][$mp_registered_newsletter['id']] ), true, false ) . ' />';
  43      $out .= '&#160;' . __( 'default', 'MailPress' ) . '</span></label>';
  44  
  45      $j++;
  46      if ( intval ( $j/$item ) == $j/$item ) $out .= '</td>';
  47      $i++;
  48      if ( intval ( $i/$row ) == $i/$row ) {  $out .= '</tr>'; $tr = false; }
  49  }
  50  if ( intval ( $j/$item ) != $j/$item )
  51  {
  52      $out .= '</td>'; 
  53      while ( $td < $item ) {  $out .= '<td></td>'; ++$td;}
  54  }
  55  if ( intval ( $i/$row ) != $i/$row )   $out .= '</tr>';
  56  $out .= "\n";
  57  ?>
  58              <tr class="mp_sep">
  59                  <th class="thtitle"><?php _e( 'Newsletters', 'MailPress' ); ?></th>
  60                  <td colspan="4"><input type="hidden" name="newsletter[on]" value="on" /></td>
  61              </tr>
  62              <tr>
  63                  <th><?php _e( 'Show At Most', 'MailPress' ); ?></th>
  64                  <td colspan="4" class="nopad">
  65                      <select name="newsletter[post_limits]">
  66  <option value="0">&#160;</option>
  67  <?php MP_AdminPage::select_number( 1, 99, MailPress_newsletter::get_post_limits() ); ?>
  68                      </select>
  69                  &#160;<?php _e( 'posts <i>(blank = WordPress Reading setting)</i>', 'MailPress' ); ?>
  70                  </td>
  71              </tr>
  72  <?php echo $out; ?>
  73  <?php do_action( 'MailPress_settings_subscriptions_newsletter_form' ); ?>


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1