Plugin Directory

Changeset 663360


Ignore:
Timestamp:
02/04/2013 07:43:38 PM (13 years ago)
Author:
micc83
Message:

Version 0.1.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wpdevtool/trunk/views/admin.php

    r663355 r663360  
    6161   
    6262    register_setting( 'wpdevtool_admin-settings', 'wpdevtool_maintenance', 'intval' );
    63     register_setting( 'wpdevtool_admin-settings', 'wpdevtool_maintenance_message', 'wpdevtool_maintenance_text_eval' );
     63    register_setting( 'wpdevtool_admin-settings', 'wpdevtool_maintenance_message', 'wp_kses_post' );
    6464    register_setting( 'wpdevtool_admin-settings', 'wpdevtool_debug_bar', 'intval' );
    65 <<<<<<< .mine
    6665    register_setting( 'wpdevtool_admin-settings', 'wpdevtool_handle_errors', 'intval' );
    6766    register_setting( 'wpdevtool_admin-settings', 'wpdevtool_redirect_emails', 'intval' );
     
    7069    register_setting( 'wpdevtool_admin-settings', 'wpdevtool_only_admin_errors', 'intval' );
    7170    register_setting( 'wpdevtool_admin-settings', 'wpdevtool_errors_backtrace', 'intval' );
    72 =======
    73     register_setting( 'wpdevtool_admin-settings', 'wpdevtool_redirect_emails', 'intval' );
    74     register_setting( 'wpdevtool_admin-settings', 'wpdevtool_redirect_email', 'wpdevtool_catch_all_email_eval' );
    75 >>>>>>> .r663351
    7671   
    7772}
     
    7974
    8075/**
    81 <<<<<<< .mine
    8276 * Unregister WpDevTool admin page data on plugin uninstall
    83 =======
    84  * Maintenance text validation
    85  *
    86  * @since 0.0.3
    87  * @params string Maintenance text
    88  * @return string Text through wp_kes_post or old value on empty field
    89  */
    90 function wpdevtool_maintenance_text_eval( $maintenance_text ) {
    91     if ( empty( $maintenance_text ) ) {
    92         add_settings_error( 'wpdevtool_admin-settings', 'code', __( 'Maintenance text cant be left empty!', 'wpdevtool' ), 'error' );
    93         return get_option( 'wpdevtool_maintenance_message' );
    94     }
    95     return wp_kses_post( $maintenance_text );
    96 }
    97 
    98 /**
    99  * Catch All Email validation
    100  *
    101  * @since 0.0.3
    102  * @params string Maintenance text
    103  * @return string Text through wp_kes_post or old value on empty field
    104  */
    105 function wpdevtool_catch_all_email_eval( $email ) {
    106     if ( empty( $email ) || !is_email( $email ) ) {
    107         add_settings_error( 'wpdevtool_admin-settings', 'code', __( 'Something went wrong with the catch all email address', 'wpdevtool' ), 'error' );
    108         return get_option( 'wpdevtool_redirect_email' );
    109     }
    110     return $email;
    111 }
    112 
    113 /**
    114  * Manage error messages
    115 >>>>>>> .r663351
    11677 *
    11778 * @since 0.1.0
     
    211172    <!-- Admin page -->
    212173    <div class="wrap wpdevtool">
    213 <<<<<<< .mine
    214174       
    215175        <div class="icon32 icon-wpdevtool-32"><br></div>
     
    234194                                <tr valign="top">
    235195                                    <th scope="row">
    236 =======
    237         <h2><strong style="color: #21759b;">WpDevTool</strong> - <?php _e( 'WordPress Development Tool', 'wpdevtool' ); ?></h2>
    238         <div class="postbox left_col">
    239             <div class="handlediv">
    240                 <br>
    241             </div>
    242             <h3 class="hndle"><?php _e( 'WpDevTool Options', 'wpdevtool' ); ?></h3>
    243             <div class="inside">
    244                 <form method="post" action="options.php">
    245                     <?php settings_fields( 'wpdevtool_admin-settings' ); ?>
    246                     <table class="form-table">
    247                         <!-- Enable Maintenance Mode -->
    248                         <tr valign="top">
    249                             <th scope="row">
    250                                 <label for="wpdevtool_maintenance"><?php _e( 'Enable maintenance mode', 'wpdevtool' ); ?></label>
    251                                 <p class="description"><?php _e( 'Return a HTTP RESPONSE 503 (Service Temporary Unavailable) landing page', 'wpdevtool' ); ?></p>
    252                             </th>
    253                             <td>
    254                                 <fieldset>
    255                                     <legend class="screen-reader-text">
    256 >>>>>>> .r663351
    257196                                        <label for="wpdevtool_maintenance"><?php _e( 'Enable maintenance mode', 'wpdevtool' ); ?></label>
    258 <<<<<<< .mine
    259197                                        <p class="description"><?php _e( 'Return a HTTP RESPONSE 503 (Service Temporary Unavailable) landing page', 'wpdevtool' ); ?></p>
    260198                                    </th>
     
    272210                                <tr valign="top">
    273211                                    <th scope="row">
    274 =======
    275                                     </legend>
    276                                     <input name="wpdevtool_maintenance" type="checkbox" id="wpdevtool_maintenance" value="1" <?php checked( '1', get_option('wpdevtool_maintenance') ); ?>  >
    277                                 </fieldset>
    278                             </td>
    279                         </tr>
    280                         <!-- Maintenance Page Text -->
    281                         <tr valign="top" <?php if ( !get_option('wpdevtool_maintenance') ) echo('style="display:none"'); ?>>
    282                             <th scope="row">
    283                                 <label for="wpdevtool_maintenance_message"><span class="required_field">*</span> <?php _e( 'Maintenance message', 'wpdevtool' ); ?></label>
    284                                 <p class="description"><?php _e( "Shortcodes: <br>[email] Blog email <br>[name] Blog name", 'wpdevtool' ); ?></p>
    285                             </th>
    286                             <td>
    287                                 <fieldset>
    288                                     <legend class="screen-reader-text">
    289                                         <label for="wpdevtool_maintenance_message"><?php _e( 'Enable maintenance mode', 'wpdevtool' ); ?></label>
    290                                     </legend>
    291                                     <input name="wpdevtool_maintenance_message" type="text" id="wpdevtool_maintenance_message" value="<?php echo get_option('wpdevtool_maintenance_message'); ?>" class="long-text code">
    292                                 </fieldset>
    293                             </td>
    294                         </tr>
    295                         <!-- Enable Debug bar -->
    296                         <tr valign="top">
    297                             <th scope="row">
    298                                 <label for="wpdevtool_debug_bar"><?php _e( 'Enable Debug Bar', 'wpdevtool' ); ?></label>
    299                                 <p class="description"><?php _e( 'Show a simple debug bar on the bottom of every template page', 'wpdevtool' ); ?></p>
    300                             </th>
    301                             <td>
    302                                 <fieldset>
    303                                     <legend class="screen-reader-text">
    304 >>>>>>> .r663351
    305212                                        <label for="wpdevtool_debug_bar"><?php _e( 'Enable Debug Bar', 'wpdevtool' ); ?></label>
    306 <<<<<<< .mine
    307213                                        <p class="description"><?php _e( 'Show a simple debug bar on the bottom of every template page', 'wpdevtool' ); ?></p>
    308214                                    </th>
     
    474380           
    475381            </form>
    476 =======
    477                                     </legend>
    478                                     <input name="wpdevtool_debug_bar" type="checkbox" id="wpdevtool_debug_bar" value="1" <?php checked( '1', get_option('wpdevtool_debug_bar') ); ?> >
    479                                 </fieldset>
    480                             </td>
    481                         </tr>
    482                         <!-- Redirect All Emails -->
    483                         <tr valign="top">
    484                             <th scope="row">
    485                                 <label for="wpdevtool_redirect_emails"><?php _e( 'Redirect all emails', 'wpdevtool' ); ?></label>
    486                                 <p class="description"><?php _e( 'Redirect all WordPress emails to a single address', 'wpdevtool' ); ?></p>
    487                             </th>
    488                             <td>
    489                                 <fieldset>
    490                                     <legend class="screen-reader-text">
    491                                         <label for="wpdevtool_redirect_emails"><?php _e( 'Redirect all emails', 'wpdevtool' ); ?></label>
    492                                     </legend>
    493                                     <input name="wpdevtool_redirect_emails" type="checkbox" id="wpdevtool_redirect_emails" value="1" <?php checked( '1', get_option('wpdevtool_redirect_emails') ); ?>  >
    494                                 </fieldset>
    495                             </td>
    496                         </tr>
    497                         <!-- Maintenance Page Text -->
    498                         <tr valign="top" <?php if ( !get_option('wpdevtool_redirect_emails') ) echo('style="display:none"'); ?>>
    499                             <th scope="row">
    500                                 <label for="wpdevtool_redirect_email"><span class="required_field">*</span> <?php _e( 'Catch all Email', 'wpdevtool' ); ?></label>
    501                                 <p class="description"><?php _e( "Catch all the emails sent through wp_mail()", 'wpdevtool' ); ?></p>
    502                             </th>
    503                             <td>
    504                                 <fieldset>
    505                                     <legend class="screen-reader-text">
    506                                         <label for="wpdevtool_redirect_email"><?php _e( 'Catch all Email', 'wpdevtool' ); ?></label>
    507                                     </legend>
    508                                     <input name="wpdevtool_redirect_email" type="text" id="wpdevtool_redirect_email" value="<?php echo get_option('wpdevtool_redirect_email'); ?>" class="long-text code">
    509                                 </fieldset>
    510                             </td>
    511                         </tr>
    512                         <!-- Check if WP_DEBUG is set to TRUE -->
    513                         <tr valign="top">
    514                             <th scope="row">
    515                                 <label for="wp_debug"><?php _e( 'WP_DEBUG is active', 'wpdevtool' ); ?></label>
    516                                 <p class="description"><?php _e( 'Check wheter you have set WP_DEBUG to TRUE', 'wpdevtool' ); ?></p>
    517                             </th>
    518                             <td>
    519                                 <fieldset>
    520                                     <legend class="screen-reader-text">
    521                                         <label for="wp_debug"><?php _e( 'WP_DEBUG is active', 'wpdevtool' ); ?></label>
    522                                     </legend>
    523                                     <input name="wp_debug" type="checkbox" id="wp_debug" value="1" disabled <?php checked( '1', WP_DEBUG ); ?> >
    524                                 </fieldset>
    525                             </td>
    526                         </tr>
    527                         <!-- Check if WP_DEBUG_LOG is set to TRUE -->
    528                         <tr valign="top">
    529                             <th scope="row">
    530                                 <label for="silent_logging"><?php _e( 'Logging is enabled', 'wpdevtool' ); ?></label>
    531                                 <p class="description"><?php _e( 'To enable silent logging give a look to Contextual Help', 'wpdevtool' ); ?></p>
    532                             </th>
    533                             <td>
    534                                 <fieldset>
    535                                     <legend class="screen-reader-text">
    536                                         <label for="silent_logging"><?php _e( 'Logging is enabled', 'wpdevtool' ); ?></label>
    537                                     </legend>
    538                                     <input name="silent_logging" type="checkbox" id="silent_logging" value="1" disabled <?php checked( '1', WP_DEBUG_LOG ); ?> >
    539                                 </fieldset>
    540                             </td>
    541                         </tr>
    542                     </table>
    543                     <?php do_settings_sections('wpdevtool_admin'); ?>
    544                     <?php submit_button(); ?>
    545                 </form>
    546             </div>
    547 >>>>>>> .r663351
    548382        </div>
    549383    </div>
Note: See TracChangeset for help on using the changeset viewer.