| @@ -12,12 +12,8 @@ | ||
| 12 | 12 | if ( ! isset( $wp_admin_bar ) ) { |
| 13 | 13 | $wp_admin_bar = ''; |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -if ( ! isset( $user_roles ) ) { | |
| 17 | - $user_roles = _mw_adminimize_get_all_user_roles(); | |
| 18 | -} | |
| 19 | - | |
| 20 | 16 | if ( ! isset( $user_roles_names ) ) { |
| 21 | 17 | $user_roles_names = _mw_adminimize_get_all_user_roles_names(); |
| 22 | 18 | } |
| 23 | 19 | ?> |
| @@ -22,10 +18,10 @@ | ||
| 22 | 18 | } |
| 23 | 19 | ?> |
| 24 | 20 | <div id="poststuff" class="ui-sortable meta-box-sortables"> |
| 25 | 21 | <div class="postbox"> |
| 26 | - <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br /></div> | |
| 27 | - <h3 class="hndle" id="admin_bar_frontend_options" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><?php | |
| 22 | + <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div> | |
| 23 | + <h3 class="hndle" id="admin_bar_frontend_options" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><?php | |
| 28 | 24 | esc_attr_e( 'Admin Bar Front end Options', 'adminimize' ); ?></h3> |
| 29 | 25 | |
| 30 | 26 | <div class="inside"> |
| 31 | 27 | <br class="clear" /> |
| @@ -51,12 +47,13 @@ | ||
| 51 | 47 | </tr> |
| 52 | 48 | <tr> |
| 53 | 49 | <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td> |
| 54 | 50 | <?php |
| 55 | - foreach ( $user_roles as $role_slug ) { | |
| 51 | + foreach ( $user_roles_names as $role_name ) { | |
| 52 | + $role_name = strtolower( $role_name ); | |
| 56 | 53 | echo '<td class="num">'; |
| 57 | - echo '<input id="select_all" class="admin_bar_frontend_' . $role_slug | |
| 58 | - . '" type="checkbox" value="" />'; | |
| 54 | + echo '<input id="select_all" class="admin_bar_frontend_' . $role_name | |
| 55 | + . '" type="checkbox" name="mw_adminimize_select_all' . $role_name . '" value="" />'; | |
| 59 | 56 | echo '</td>' . "\n"; |
| 60 | 57 | } ?> |
| 61 | 58 | </tr> |
| 62 | 59 | </thead> |
| @@ -87,12 +84,14 @@ | ||
| 87 | 84 | if ( ! $value->title ) { |
| 88 | 85 | $value->title = '<b><i>' . esc_attr__( 'No Title!', 'adminimize' ) . '</i></b>'; |
| 89 | 86 | } |
| 90 | 87 | |
| 88 | + $item_class = ' class="form-invalid"'; | |
| 91 | 89 | $item_string = '• '; |
| 92 | 90 | $before_title = '<b>'; |
| 93 | 91 | $after_title = '</b> <small>' . esc_attr__( 'Group', 'adminimize' ) . '</small>'; |
| 94 | 92 | if ( $is_parent ) { |
| 93 | + $item_class = ''; | |
| 95 | 94 | $item_string = '— '; |
| 96 | 95 | $before_title = ''; |
| 97 | 96 | $after_title = ''; |
| 98 | 97 | } |
| @@ -105,9 +104,9 @@ | ||
| 105 | 104 | ) |
| 106 | 105 | ) ? ' checked="checked"' : ''; |
| 107 | 106 | } |
| 108 | 107 | |
| 109 | - echo '<tr>' . "\n"; | |
| 108 | + echo '<tr' . $item_class . '>' . "\n"; | |
| 110 | 109 | echo '<td>'. $before_title . $item_string . strip_tags( $value->title, '<strong><b><em><i>' ) |
| 111 | 110 | . $after_title . ' <span>(' . $key . ')</span> </td>' . "\n"; |
| 112 | 111 | foreach ( $user_roles as $role ) { |
| 113 | 112 | echo '<td class="num"><input id="check_post' . $role . $x |
| @@ -117,15 +116,15 @@ | ||
| 117 | 116 | } |
| 118 | 117 | echo '</tr>' . "\n"; |
| 119 | 118 | $x ++; |
| 120 | 119 | } |
| 120 | + } else { | |
| 121 | + $message = '<span style="font-size: 35px;">☝</span>' | |
| 122 | + . esc_attr__( | |
| 123 | + 'Display the front end include load or refresh of the site to get all items of the admin bar in the front end area.', | |
| 124 | + 'adminimize' | |
| 125 | + ); | |
| 121 | 126 | } |
| 122 | - $message = '<span style="font-size: 35px;">☝</span>' | |
| 123 | - . esc_attr__( | |
| 124 | - 'You must open the front end of the site in this browser in order for the plugin to discover the Admin Bar items that are currently not visible.', | |
| 125 | - 'adminimize' | |
| 126 | - ); | |
| 127 | - | |
| 128 | 127 | ?> |
| 129 | 128 | </tbody> |
| 130 | 129 | </table> |
| 131 | 130 | |
| @@ -138,9 +137,9 @@ | ||
| 138 | 137 | ); ?> »" /><input type="hidden" name="page_options" value="'dofollow_timeout'" /> |
| 139 | 138 | </p> |
| 140 | 139 | |
| 141 | 140 | <p> |
| 142 | - <a class="alignright button adminimize-scroltop" href="#" | |
| 141 | + <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" | |
| 143 | 142 | style="margin:3px 0 0 30px;"><?php esc_attr_e( |
| 144 | 143 | 'scroll to top', 'adminimize' |
| 145 | 144 | ); ?></a> |
| 146 | 145 | <br class="clear" /> |