[ Index ]

MailPress 7.2

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

title

Body

[close]

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

   1  <?php // general
   2  
   3  $subscription_mngt = array ( 'ajax' => __( 'Default', 'MailPress' ), 'page_id' => __( 'Page template', 'MailPress' ), 'cat' => __( 'Category template', 'MailPress' ) );
   4  
   5  if ( !isset( MP_AdminPage::$pst_['_tab'] ) || ( 'general' != MP_AdminPage::$pst_['_tab'] ) )
   6  {
   7      $mp_general = get_option( MailPress::option_name_general );
   8  }
   9  
  10  if ( !isset( $mp_general['subscription_mngt'] ) )
  11  {
  12      $mp_general['subscription_mngt'] = 'ajax';
  13      $mp_general['id'] = '';
  14  }
  15  
  16  $map_providers = array(     'o' => __( 'OpenStreetMap', 'MailPress' ),
  17                      'm' => __( 'Mapbox', 'MailPress' ),
  18                      'g' => __( 'Google Map', 'MailPress' ),
  19                      'b' => __( 'Bing maps', 'MailPress' ),
  20                      'h' => __( 'Here maps', 'MailPress' ),
  21  );
  22  
  23  $map_fields    = array(    'b' => array(    0 => array(    'general' => 'bmapkey',
  24                                              'id' => 'b_key',
  25                                              'label' => __( 'Bing maps key', 'MailPress' ),
  26                                              'size' => 90,
  27                                      ),
  28                      ),
  29                      'g' => array(    0 => array(    'general' => 'gmapkey',
  30                                              'id' => 'g_key',
  31                                              'label' => __( 'Google Map API Key', 'MailPress' ),
  32                                              'size' => 90,
  33                                      ),
  34                      ),
  35                      'h' => array(    0 => array(    'general' => 'here_id',
  36                                              'id' => 'h_id',
  37                                              'label' => __( 'Here app_id', 'MailPress' ),
  38                                              'size' => 30,
  39                                      ),
  40                                  1 => array(    'general' => 'here_code',
  41                                              'id' => 'h_code',
  42                                              'label' => __( 'Here app_code', 'MailPress' ),
  43                                              'size' => 30,
  44                                      ),
  45                      ),
  46                      'm' => array(    0 => array(    'general' => 'mapboxtoken',
  47                                              'id' => 'm_token',
  48                                              'label' => __( 'Mapbox token', 'MailPress' ),
  49                                              'size' => 120,
  50                                      ),
  51                      ),
  52  );
  53  
  54  if ( !isset( $mp_general['map_provider'] ) ) $mp_general['map_provider'] = 'o';
  55  
  56  ?>
  57  <form name="<?php echo basename(__DIR__); ?>" method="post" class="mp_settings">
  58      <input type="hidden" name="_tab" value="<?php echo basename(__DIR__); ?>" />
  59      <table class="form-table">
  60  
  61  
  62  <!-- From -->
  63          <tr class="mp_sep">
  64              <th class="thtitle"><?php _e( 'From', 'MailPress' ); ?></th>
  65              <td class="nopad"></td>
  66          </tr>
  67          <tr>
  68              <th><label for="general_fromemail"><?php _e( 'All Mails Sent From', 'MailPress' ); ?></label></th>
  69              <td class="nopad">
  70                  <table class="subscriptions">
  71                      <tr>
  72                          <td class="pr10<?php if ( isset( MP_AdminPage::$err_mess['fromemail'] ) ) echo ' form-invalid'; ?>">
  73                              <?php _e( 'Email : ', 'MailPress' ); ?>
  74                              <input type="text" name="general[fromemail]" value="<?php echo ( isset( $mp_general['fromemail'] ) ) ? $mp_general['fromemail'] : ''; ?>" class="regular-text" id="general_fromemail" />
  75                          </td>
  76                          <td class="pr10<?php if ( isset( MP_AdminPage::$err_mess['fromname'] ) ) echo ' form-invalid'; ?>">
  77                              <?php _e( 'Name : ', 'MailPress' ); ?> 
  78                              <input type="text" name="general[fromname]" value="<?php echo ( isset( $mp_general['fromname'] ) ) ? esc_attr( $mp_general['fromname'] ) : ''; ?>" class="regular-text" />
  79                          </td>
  80                      </tr>
  81                  </table>
  82              </td>
  83          </tr>
  84  <!-- Blog -->
  85          <tr class="mp_sep">
  86              <th class="thtitle"><?php _e( 'On Blog', 'MailPress' ); ?></th>
  87              <td class="nopad"></td>
  88          </tr>
  89          <tr>
  90              <th><label for="general_fullscreen"><?php _e( 'View Mail In Fullscreen', 'MailPress' ); ?></label></th>
  91              <td>
  92                  <input type="checkbox" name="general[fullscreen]" id="general_fullscreen"<?php checked( isset( $mp_general['fullscreen'] ) ); ?> />
  93              </td>
  94          </tr>
  95          <tr>
  96              <th><label for="general_subscription_mngt"><?php _e( ' Manage Subscriptions From', 'MailPress' ); ?></label></th>
  97              <td class="nopad">
  98                  <table>
  99                      <tr>
 100                          <td>
 101                              <select name="general[subscription_mngt]" class="subscription_mngt" id="general_subscription_mngt">
 102  <?php MP_AdminPage::select_option( $subscription_mngt, $mp_general['subscription_mngt'] ?? false );?>
 103                              </select>
 104                          </td>
 105                          <td class="mngt_id<?php if ( isset( MP_AdminPage::$err_mess['subscription_mngt'] ) ) echo ' form-invalid'; ?><?php if ( 'ajax' == $mp_general['subscription_mngt'] ) echo ' hidden'; ?>">
 106                              <input type="text" name="general[id]" value="<?php echo $mp_general['id']; ?>" class="small-text" />
 107                              <span class="page_id toggle<?php if ( 'page_id' != $mp_general['subscription_mngt'] ) echo ' hidden'; ?>"><?php _e( "Page id", 'MailPress' ); ?></span>
 108                              <span class="cat     toggle<?php if ( 'cat'     != $mp_general['subscription_mngt'] ) echo ' hidden'; ?>"><?php _e( "Category id", 'MailPress' ); ?></span>
 109                          </td>
 110                      </tr>
 111                  </table>
 112              </td>
 113          </tr>
 114  <?php do_action( 'MailPress_settings_general_form' ); ?>
 115  
 116  <!-- Admin -->
 117          <tr class="mp_sep">
 118              <th class="thtitle"><?php _e( 'Admin', 'MailPress' ); ?></th>
 119              <td class="nopad"></td>
 120          </tr>
 121          <tr>
 122              <th><label for="general_dashboard"><?php _e( 'Dashboard Widgets', 'MailPress' ); ?></label></th>
 123              <td>
 124                  <input type="checkbox" name="general[dashboard]"<?php checked( isset( $mp_general['dashboard'] ) ); ?> id="general_dashboard" />
 125              </td>
 126          </tr>
 127          <tr>
 128              <th><label for="general_wp_mail"><?php _e( 'MailPress Version Of wp_mail', 'MailPress' ); ?></label></th>
 129              <td>
 130                  <input type="checkbox" name="general[wp_mail]"<?php checked( isset( $mp_general['wp_mail'] ) ); ?> id="general_wp_mail" />
 131              </td>
 132          </tr>
 133  <?php do_action( 'MailPress_settings_general_form_admin' ); ?>
 134  
 135  <!-- Map -->
 136          <tr>
 137              <th><label for="general_map_provider"><?php _e( 'Map Provider', 'MailPress' ); ?></label></th>
 138              <td>
 139                  <table class="map_provider">
 140                      <tr>
 141                          <th>
 142                              <select name="general[map_provider]" id="general_map_provider">
 143  <?php MP_AdminPage::select_option( $map_providers, $mp_general['map_provider'] ?? false );?>
 144                              </select>
 145                          </th>
 146                          <td>
 147  <?php foreach( $map_fields as $k => $v ) { ?>
 148                              <span id="map_provider_<?php echo $k; ?>" class="map_providers<?php if ( $k != $mp_general['map_provider'] ) echo ' hidden'; ?>">
 149  <?php     foreach( $v as $kk => $vv )
 150          {
 151              $z = ( $kk ) ? '_' . $kk : '';
 152              if ( $kk ) echo "<br />\r\n";
 153  ?>
 154                                  <label id="<?php echo $k . $z; ?>_prompt_text" class="<?php echo ( isset( $mp_general[$vv['general']] ) && !empty( $mp_general[$vv['general']] ) ) ? 'hidden' : 'hide-if-no-js'; ?>" for="<?php echo $vv['id']; ?>"><?php echo $vv['label']; ?></label>
 155                                  <input type="text" size="<?php echo $vv['size']; ?>" name="general[<?php echo $vv['general']; ?>]" id="<?php echo $vv['id']; ?>" value="<?php if ( isset( $mp_general[$vv['general']] ) ) echo $mp_general[$vv['general']]; ?>" />
 156  <?php        } ?>
 157                              </span> 
 158  <?php } ?>
 159                          </td>
 160                      </tr>
 161                  </table>
 162              </td>
 163          </tr>
 164  <!-- Add ons -->
 165  <?php do_action( 'MailPress_settings_general_form_footer' ); ?>
 166  
 167      </table>
 168  
 169  <?php if( !$mp_general ) { ?>
 170      <span class="startmsg"><?php _e( 'You can start to update your mail server configuration, once you have saved your General settings', 'MailPress' ); ?></span>
 171  <?php } ?>
 172  
 173  <?php MP_AdminPage::save_button(); ?>
 174  
 175  </form>


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