WordPress.org

Plugin Directory


Ignore:
Timestamp:
10/17/12 20:45:41 (5 years ago)
Author:
Ipstenu
Message:

Checking in 1.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • join-my-multisite/trunk/admin/settings.php

    r611707 r613778  
    2222} 
    2323  
    24     // Register and define the settings 
     24// In lieu of options.php.... 
     25if( $_POST['action'] == 'update' ) { 
     26 
     27    $new_options = get_option( 'helfjmm_options' ); 
     28        $new_options['type'] = $_POST['jmm_type'];  
     29        $new_options['role'] = $_POST['jmm_role']; 
     30        $new_options['persite'] = $_POST['jmm_persite'];  
     31        $new_options['perpage'] = $_POST['jmm_perpage']; 
     32    update_option('helfjmm_options', $new_options); 
     33    update_option( 'default_user_role', $new_options['role']); 
     34 
     35    // Echo  
     36    ?><div id='message' class='updated fade'><p><strong><?php _e('Options Updated!', 'helfjmm'); ?></strong></p></div><?php 
     37} 
     38 
    2539?> 
    2640    <div class="wrap"> 
     
    3246        ?> 
    3347     
    34         <form method="post" action="options.php"> 
     48        <form method="post" action=""> 
    3549            <input type="hidden" name="action" value="update" /> 
    3650            <input type="hidden" name="page_options" value="helfjmm_options" /> 
     
    4458                        <th scope="row"><?php _e('Membership:', 'helfjmm'); ?></th> 
    4559                        <td><p> 
    46                             <input type="radio" name="helfjmm_options[type]" value="1" <?php if ($jmm_options['type'] == 1) echo 'checked="checked"'; ?>> <label for="jmm-type"><strong><?php _e('Automatic', 'helfjmm'); ?></strong> </label><br /> 
    47                             <input type="radio" name="helfjmm_options[type]" value="2" <?php if ($jmm_options['type'] == 2) echo 'checked="checked"'; ?>> <label for="jmm-type"><strong><?php _e('Manual', 'helfjmm'); ?></strong> </label><br /> 
    48                             <input type="radio" name="helfjmm_options[type]" value="3" <?php if ($jmm_options['type'] == 3) echo 'checked="checked"'; ?>> <label for="jmm-type"><strong><?php _e('None', 'helfjmm'); ?></strong></label> 
     60                            <input type="radio" name="jmm_type" value="1" <?php if ($jmm_options['type'] == 1) echo 'checked="checked"'; ?>> <label for="jmm-type"><strong><?php _e('Automatic', 'helfjmm'); ?></strong> </label><br /> 
     61                            <input type="radio" name="jmm_type" value="2" <?php if ($jmm_options['type'] == 2) echo 'checked="checked"'; ?>> <label for="jmm-type"><strong><?php _e('Manual', 'helfjmm'); ?></strong> </label><br /> 
     62                            <input type="radio" name="jmm_type" value="3" <?php if ($jmm_options['type'] == 3) echo 'checked="checked"'; ?>> <label for="jmm-type"><strong><?php _e('None', 'helfjmm'); ?></strong></label> 
    4963                        </p></td> 
    5064                        <td><p class="description"> 
     
    6276                        <th scope="row"><?php _e('Registration:', 'helfjmm'); ?></th> 
    6377                        <td><p> 
    64                             <input type="checkbox" name="helfjmm_options[persite]" value="1" <?php if ($jmm_options['persite'] == 1) echo 'checked="checked"'; ?>> <label for="jmm-persite"><?php _e('Per-Site Registration.', 'helfjmm'); ?></label> 
     78                            <input type="checkbox" name="jmm_persite" value="1" <?php if ($jmm_options['persite'] == 1) echo 'checked="checked"'; ?>> <label for="jmm-persite"><?php _e('Per-Site Registration.', 'helfjmm'); ?></label> 
    6579                        </p></td> 
    6680                        <td><p class="description"><?php _e('Check this box if you want to use a shortcode to customize per-site registration. If unchecked, registrations will be sent to the network registration page.', 'helfjmm'); ?></p></td> 
     
    7286                        <th scope="row"></th> 
    7387                        <td> 
    74                         <p><select name="helfjmm_options[perpage]" id='jmm_options[perpage]'> 
     88                        <p><select name="jmm_perpage" id='jmm_options[perpage]'> 
    7589                            <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option> 
    76                             <?php if ( current_user_can( 'create_posts', 'page' ) ) : ?> 
    77                             <option value="new" id="new-page"><?php _e( '&mdash; Add new page &mdash;' ); ?></option> 
    78                             <?php endif; ?> 
    7990                            <?php echo walk_page_dropdown_tree( $all_pages, 0, array( 'depth' => 1,'selected' => $jmm_options['perpage'] ) ); ?> 
    8091                        </select></p> 
     
    93104                    ?> 
    94105                     
    95                     <tr> 
     106                    <tr>  
    96107                        <th scope="row"><?php _e('New User Default Role:', 'helfjmm'); ?></th> 
    97108                        <td> 
    98                         <select name="helfjmm_options[role]" id="<?php echo $jmm_options['role']; ?>"> 
     109                        <select name="jmm_role" id="<?php echo $jmm_options['role']; ?>"> 
    99110                        <option value="none"><?php _e( '-- None --', 'helfjmm' )?></option> 
    100111                        <?php wp_dropdown_roles( get_option( 'default_user_role' ) ); ?> 
     
    109120     
    110121        </form> 
    111  
Note: See TracChangeset for help on using the changeset viewer.