| @@ -8,35 +8,18 @@ | ||
| 8 | 8 | if ( ! function_exists( 'add_action' ) ) { |
| 9 | 9 | echo "Hi there! I'm just a part of plugin, not much I can do when called directly."; |
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | - | |
| 13 | -if ( ! isset( $user_roles ) ) { | |
| 14 | - $user_roles = _mw_adminimize_get_all_user_roles(); | |
| 15 | -} | |
| 16 | - | |
| 17 | -if ( ! isset( $user_roles_names ) ) { | |
| 18 | - $user_roles_names = _mw_adminimize_get_all_user_roles_names(); | |
| 19 | -} | |
| 20 | 12 | ?> |
| 21 | - | |
| 22 | 13 | <div id="poststuff" class="ui-sortable meta-box-sortables"> |
| 23 | 14 | <div class="postbox"> |
| 24 | - <h3 class="hndle ui-sortable-handle" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>" id="widget_options"><?php esc_attr_e( 'Widgets', 'adminimize' ); ?></h3> | |
| 15 | + <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div> | |
| 16 | + <h3 class="hndle" id="widget_options"><?php esc_attr_e( 'Widgets', 'adminimize' ); ?></h3> | |
| 25 | 17 | |
| 26 | 18 | <div class="inside"> |
| 27 | 19 | <br class="clear" /> |
| 28 | 20 | |
| 29 | 21 | <table summary="config_widget" class="widefat"> |
| 30 | - <colgroup> | |
| 31 | - <?php | |
| 32 | - $col = 0; | |
| 33 | - foreach ( $user_roles_names as $role_name ) { | |
| 34 | - echo '<col class="col' . $col . '">' . "\n"; | |
| 35 | - $col ++; | |
| 36 | - } | |
| 37 | - ?> | |
| 38 | - </colgroup> | |
| 39 | 22 | <thead> |
| 40 | 23 | <tr> |
| 41 | 24 | <th><?php esc_attr_e( 'Option', 'adminimize' ); ?></th> |
| 42 | 25 | <?php |
| @@ -47,11 +30,13 @@ | ||
| 47 | 30 | </tr> |
| 48 | 31 | <tr> |
| 49 | 32 | <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td> |
| 50 | 33 | <?php |
| 51 | - foreach ( $user_roles as $role_slug ) { | |
| 34 | + foreach ( $user_roles_names as $role_name ) { | |
| 35 | + $role_name = strtolower( $role_name ); | |
| 36 | + $role_name = preg_replace( '/[^a-z0-9]+/', '', $role_name ); | |
| 52 | 37 | echo '<td class="num">'; |
| 53 | - echo '<input id="select_all" class="widget_options_' . $role_slug | |
| 38 | + echo '<input id="select_all" class="widget_options_' . $role_name | |
| 54 | 39 | . '" type="checkbox" name="" value="" />'; |
| 55 | 40 | echo '</td>' . "\n"; |
| 56 | 41 | } ?> |
| 57 | 42 | </tr> |
| @@ -127,9 +112,9 @@ | ||
| 127 | 112 | echo '<td>' . $widget_options_names[ $index ] . ' <span>(' . $widget_option . ')</span> </td>' . "\n"; |
| 128 | 113 | foreach ( $user_roles as $role ) { |
| 129 | 114 | echo '<td class="num">'; |
| 130 | 115 | echo '<input id="check_post' . $role . $x . '" class="widget_options_' |
| 131 | - . preg_replace( '/[^a-z0-9_-]+/', '', $role ) . '" type="checkbox"' | |
| 116 | + . preg_replace( '/[^a-z0-9]+/', '', $role ) . '" type="checkbox"' | |
| 132 | 117 | . $checked_user_role_[ $role ] . ' name="mw_adminimize_disabled_widget_option_' |
| 133 | 118 | . $role . '_items[]" value="' . $widget_option . '" />'; |
| 134 | 119 | echo '</td>' . "\n"; |
| 135 | 120 | } |
| @@ -149,11 +134,11 @@ | ||
| 149 | 134 | <thead> |
| 150 | 135 | <tr> |
| 151 | 136 | <th><?php esc_attr_e( 'Your own Widget options', 'adminimize' ); |
| 152 | 137 | echo '<br />'; |
| 153 | - esc_attr_e( 'Option name', 'adminimize' ); ?></th> | |
| 138 | + esc_attr_e( 'ID or class', 'adminimize' ); ?></th> | |
| 154 | 139 | <th><?php echo '<br />'; |
| 155 | - esc_attr_e( 'Selector, ID or class', 'adminimize' ); ?></th> | |
| 140 | + esc_attr_e( 'Option', 'adminimize' ); ?></th> | |
| 156 | 141 | </tr> |
| 157 | 142 | </thead> |
| 158 | 143 | |
| 159 | 144 | <tbody> |
| @@ -194,9 +179,9 @@ | ||
| 194 | 179 | ); ?> »" /><input type="hidden" name="page_options" value="'dofollow_timeout'" /> |
| 195 | 180 | </p> |
| 196 | 181 | |
| 197 | 182 | <p> |
| 198 | - <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;"><?php esc_attr_e( | |
| 183 | + <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e( | |
| 199 | 184 | 'scroll to top', 'adminimize' |
| 200 | 185 | ); ?></a><br class="clear" /></p> |
| 201 | 186 | |
| 202 | 187 | </div> |