mp-wp_genesis 1 <?php
mp-wp_genesis 2 /**
mp-wp_genesis 3 * General settings administration panel.
mp-wp_genesis 4 *
mp-wp_genesis 5 * @package WordPress
mp-wp_genesis 6 * @subpackage Administration
mp-wp_genesis 7 */
mp-wp_genesis 8
mp-wp_genesis 9 /** WordPress Administration Bootstrap */
mp-wp_genesis 10 require_once('./admin.php');
mp-wp_genesis 11
mp-wp_genesis 12 $title = __('General Settings');
mp-wp_genesis 13 $parent_file = 'options-general.php';
mp-wp_genesis 14
mp-wp_genesis 15 /**
mp-wp_genesis 16 * Display JavaScript on the page.
mp-wp_genesis 17 *
mp-wp_genesis 18 * @package WordPress
mp-wp_genesis 19 * @subpackage General_Settings_Panel
mp-wp_genesis 20 */
mp-wp_genesis 21 function add_js() {
mp-wp_genesis 22 ?>
mp-wp_genesis 23 <script type="text/javascript">
mp-wp_genesis 24 //<![CDATA[
mp-wp_genesis 25 jQuery(document).ready(function($){
mp-wp_genesis 26 $("input[name='date_format']").click(function(){
mp-wp_genesis 27 if ( "date_format_custom_radio" != $(this).attr("id") )
mp-wp_genesis 28 $("input[name='date_format_custom']").val( $(this).val() );
mp-wp_genesis 29 });
mp-wp_genesis 30 $("input[name='date_format_custom']").focus(function(){
mp-wp_genesis 31 $("#date_format_custom_radio").attr("checked", "checked");
mp-wp_genesis 32 });
mp-wp_genesis 33
mp-wp_genesis 34 $("input[name='time_format']").click(function(){
mp-wp_genesis 35 if ( "time_format_custom_radio" != $(this).attr("id") )
mp-wp_genesis 36 $("input[name='time_format_custom']").val( $(this).val() );
mp-wp_genesis 37 });
mp-wp_genesis 38 $("input[name='time_format_custom']").focus(function(){
mp-wp_genesis 39 $("#time_format_custom_radio").attr("checked", "checked");
mp-wp_genesis 40 });
mp-wp_genesis 41 });
mp-wp_genesis 42 //]]>
mp-wp_genesis 43 </script>
mp-wp_genesis 44 <?php
mp-wp_genesis 45 }
mp-wp_genesis 46 add_filter('admin_head', 'add_js');
mp-wp_genesis 47
mp-wp_genesis 48 include('./admin-header.php');
mp-wp_genesis 49 ?>
mp-wp_genesis 50
mp-wp_genesis 51 <div class="wrap">
mp-wp_genesis 52 <?php screen_icon(); ?>
mp-wp_genesis 53 <h2><?php echo wp_specialchars( $title ); ?></h2>
mp-wp_genesis 54
mp-wp_genesis 55 <form method="post" action="options.php">
mp-wp_genesis 56 <?php settings_fields('general'); ?>
mp-wp_genesis 57
mp-wp_genesis 58 <table class="form-table">
mp-wp_genesis 59 <tr valign="top">
mp-wp_genesis 60 <th scope="row"><label for="blogname"><?php _e('Blog Title') ?></label></th>
mp-wp_genesis 61 <td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" class="regular-text" /></td>
mp-wp_genesis 62 </tr>
mp-wp_genesis 63 <tr valign="top">
mp-wp_genesis 64 <th scope="row"><label for="blogdescription"><?php _e('Tagline') ?></label></th>
mp-wp_genesis 65 <td><input name="blogdescription" type="text" id="blogdescription" value="<?php form_option('blogdescription'); ?>" class="regular-text" />
mp-wp_genesis 66 <span class="setting-description"><?php _e('In a few words, explain what this blog is about.') ?></span></td>
mp-wp_genesis 67 </tr>
mp-wp_genesis 68 <tr valign="top">
mp-wp_genesis 69 <th scope="row"><label for="siteurl"><?php _e('WordPress address (URL)') ?></label></th>
mp-wp_genesis 70 <td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>" class="regular-text code<?php if ( defined( 'WP_SITEURL' ) ) : ?> disabled" disabled="disabled"<?php else: ?>"<?php endif; ?> /></td>
mp-wp_genesis 71 </tr>
mp-wp_genesis 72 <tr valign="top">
mp-wp_genesis 73 <th scope="row"><label for="home"><?php _e('Blog address (URL)') ?></label></th>
mp-wp_genesis 74 <td><input name="home" type="text" id="home" value="<?php form_option('home'); ?>" class="regular-text code<?php if ( defined( 'WP_HOME' ) ) : ?> disabled" disabled="disabled"<?php else: ?>"<?php endif; ?> />
mp-wp_genesis 75 <span class="setting-description"><?php _e('Enter the address here if you want your blog homepage <a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">to be different from the directory</a> you installed WordPress.'); ?></span></td>
mp-wp_genesis 76 </tr>
mp-wp_genesis 77 <tr valign="top">
mp-wp_genesis 78 <th scope="row"><label for="admin_email"><?php _e('E-mail address') ?> </label></th>
mp-wp_genesis 79 <td><input name="admin_email" type="text" id="admin_email" value="<?php form_option('admin_email'); ?>" class="regular-text code" />
mp-wp_genesis 80 <span class="setting-description"><?php _e('This address is used for admin purposes, like new user notification.') ?></span></td>
mp-wp_genesis 81 </tr>
mp-wp_genesis 82 <tr valign="top">
mp-wp_genesis 83 <th scope="row"><?php _e('Membership') ?></th>
mp-wp_genesis 84 <td> <fieldset><legend class="hidden"><?php _e('Membership') ?></legend><label for="users_can_register">
mp-wp_genesis 85 <input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked('1', get_option('users_can_register')); ?> />
mp-wp_genesis 86 <?php _e('Anyone can register') ?></label>
mp-wp_genesis 87 </fieldset></td>
mp-wp_genesis 88 </tr>
mp-wp_genesis 89 <tr valign="top">
mp-wp_genesis 90 <th scope="row"><label for="default_role"><?php _e('New User Default Role') ?></label></th>
mp-wp_genesis 91 <td>
mp-wp_genesis 92 <select name="default_role" id="default_role"><?php wp_dropdown_roles( get_option('default_role') ); ?></select>
mp-wp_genesis 93 </td>
mp-wp_genesis 94 </tr>
mp-wp_genesis 95 <tr>
mp-wp_genesis 96 <th scope="row"><label for="gmt_offset"><?php _e('Timezone') ?> </label></th>
mp-wp_genesis 97 <td>
mp-wp_genesis 98 <select name="gmt_offset" id="gmt_offset">
mp-wp_genesis 99 <?php
mp-wp_genesis 100 $current_offset = get_option('gmt_offset');
mp-wp_genesis 101 $offset_range = array (-12, -11.5, -11, -10.5, -10, -9.5, -9, -8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.5, -1, -0.5,
mp-wp_genesis 102 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 5.75, 6, 6.5, 7, 7.5, 8, 8.5, 8.75, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 13.75, 14);
mp-wp_genesis 103 foreach ( $offset_range as $offset ) {
mp-wp_genesis 104 if ( 0 < $offset )
mp-wp_genesis 105 $offset_name = '+' . $offset;
mp-wp_genesis 106 elseif ( 0 == $offset )
mp-wp_genesis 107 $offset_name = '';
mp-wp_genesis 108 else
mp-wp_genesis 109 $offset_name = (string) $offset;
mp-wp_genesis 110
mp-wp_genesis 111 $offset_name = str_replace(array('.25','.5','.75'), array(':15',':30',':45'), $offset_name);
mp-wp_genesis 112
mp-wp_genesis 113 $selected = '';
mp-wp_genesis 114 if ( $current_offset == $offset ) {
mp-wp_genesis 115 $selected = " selected='selected'";
mp-wp_genesis 116 $current_offset_name = $offset_name;
mp-wp_genesis 117 }
mp-wp_genesis 118 echo "<option value=\"$offset\"$selected>" . sprintf(__('UTC %s'), $offset_name) . '</option>';
mp-wp_genesis 119 }
mp-wp_genesis 120 ?>
mp-wp_genesis 121 </select>
mp-wp_genesis 122 <?php _e('hours') ?>
mp-wp_genesis 123 <span id="utc-time"><?php printf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'), date_i18n(__('Y-m-d G:i:s'), false, 'gmt')); ?></span>
mp-wp_genesis 124 <?php if ($current_offset) : ?>
mp-wp_genesis 125 <span id="local-time"><?php printf(__('UTC %1$s is <code>%2$s</code>'), $current_offset_name, date_i18n(__('Y-m-d G:i:s'))); ?></span>
mp-wp_genesis 126 <?php endif; ?>
mp-wp_genesis 127 <br/>
mp-wp_genesis 128 <span class="setting-description"><?php _e('Unfortunately, you have to manually update this for Daylight Savings Time. Lame, we know, but will be fixed in the future.'); ?></span>
mp-wp_genesis 129 </td>
mp-wp_genesis 130 </tr>
mp-wp_genesis 131 <tr>
mp-wp_genesis 132 <th scope="row"><?php _e('Date Format') ?></th>
mp-wp_genesis 133 <td>
mp-wp_genesis 134 <fieldset><legend class="hidden"><?php _e('Date Format') ?></legend>
mp-wp_genesis 135 <?php
mp-wp_genesis 136
mp-wp_genesis 137 $date_formats = apply_filters( 'date_formats', array(
mp-wp_genesis 138 __('F j, Y'),
mp-wp_genesis 139 'Y/m/d',
mp-wp_genesis 140 'm/d/Y',
mp-wp_genesis 141 'd/m/Y',
mp-wp_genesis 142 ) );
mp-wp_genesis 143
mp-wp_genesis 144 $custom = TRUE;
mp-wp_genesis 145
mp-wp_genesis 146 foreach ( $date_formats as $format ) {
mp-wp_genesis 147 echo "\t<label title='" . attribute_escape($format) . "'><input type='radio' name='date_format' value='" . attribute_escape($format) . "'";
mp-wp_genesis 148 if ( get_option('date_format') === $format ) { // checked() uses "==" rather than "==="
mp-wp_genesis 149 echo " checked='checked'";
mp-wp_genesis 150 $custom = FALSE;
mp-wp_genesis 151 }
mp-wp_genesis 152 echo ' /> ' . date_i18n( $format ) . "</label><br />\n";
mp-wp_genesis 153 }
mp-wp_genesis 154
mp-wp_genesis 155 echo ' <label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
mp-wp_genesis 156 checked( $custom, TRUE );
mp-wp_genesis 157 echo '/> ' . __('Custom:') . ' </label><input type="text" name="date_format_custom" value="' . attribute_escape( get_option('date_format') ) . '" class="small-text" /> ' . date_i18n( get_option('date_format') ) . "\n";
mp-wp_genesis 158
mp-wp_genesis 159 echo "\t<p>" . __('<a href="http://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date formatting</a>. Click "Save Changes" to update sample output.') . "</p>\n";
mp-wp_genesis 160 ?>
mp-wp_genesis 161 </fieldset>
mp-wp_genesis 162 </td>
mp-wp_genesis 163 </tr>
mp-wp_genesis 164 <tr>
mp-wp_genesis 165 <th scope="row"><?php _e('Time Format') ?></th>
mp-wp_genesis 166 <td>
mp-wp_genesis 167 <fieldset><legend class="hidden"><?php _e('Time Format') ?></legend>
mp-wp_genesis 168 <?php
mp-wp_genesis 169
mp-wp_genesis 170 $time_formats = apply_filters( 'time_formats', array(
mp-wp_genesis 171 __('g:i a'),
mp-wp_genesis 172 'g:i A',
mp-wp_genesis 173 'H:i',
mp-wp_genesis 174 ) );
mp-wp_genesis 175
mp-wp_genesis 176 $custom = TRUE;
mp-wp_genesis 177
mp-wp_genesis 178 foreach ( $time_formats as $format ) {
mp-wp_genesis 179 echo "\t<label title='" . attribute_escape($format) . "'><input type='radio' name='time_format' value='" . attribute_escape($format) . "'";
mp-wp_genesis 180 if ( get_option('time_format') === $format ) { // checked() uses "==" rather than "==="
mp-wp_genesis 181 echo " checked='checked'";
mp-wp_genesis 182 $custom = FALSE;
mp-wp_genesis 183 }
mp-wp_genesis 184 echo ' /> ' . date_i18n( $format ) . "</label><br />\n";
mp-wp_genesis 185 }
mp-wp_genesis 186
mp-wp_genesis 187 echo ' <label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"';
mp-wp_genesis 188 checked( $custom, TRUE );
mp-wp_genesis 189 echo '/> ' . __('Custom:') . ' </label><input type="text" name="time_format_custom" value="' . attribute_escape( get_option('time_format') ) . '" class="small-text" /> ' . date_i18n( get_option('time_format') ) . "\n";
mp-wp_genesis 190 ?>
mp-wp_genesis 191 </fieldset>
mp-wp_genesis 192 </td>
mp-wp_genesis 193 </tr>
mp-wp_genesis 194 <tr>
mp-wp_genesis 195 <th scope="row"><label for="start_of_week"><?php _e('Week Starts On') ?></label></th>
mp-wp_genesis 196 <td><select name="start_of_week" id="start_of_week">
mp-wp_genesis 197 <?php
mp-wp_genesis 198 for ($day_index = 0; $day_index <= 6; $day_index++) :
mp-wp_genesis 199 $selected = (get_option('start_of_week') == $day_index) ? 'selected="selected"' : '';
mp-wp_genesis 200 echo "\n\t<option value='$day_index' $selected>" . $wp_locale->get_weekday($day_index) . '</option>';
mp-wp_genesis 201 endfor;
mp-wp_genesis 202 ?>
mp-wp_genesis 203 </select></td>
mp-wp_genesis 204 </tr>
mp-wp_genesis 205 <?php do_settings_fields('general', 'default'); ?>
mp-wp_genesis 206 </table>
mp-wp_genesis 207
mp-wp_genesis 208 <?php do_settings_sections('general'); ?>
mp-wp_genesis 209
mp-wp_genesis 210 <p class="submit">
mp-wp_genesis 211 <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
mp-wp_genesis 212 </p>
mp-wp_genesis 213 </form>
mp-wp_genesis 214
mp-wp_genesis 215 </div>
mp-wp_genesis 216
mp-wp_genesis 217 <?php include('./admin-footer.php') ?>