PluginProbe
Adminimize / 1.11.9
Adminimize v1.11.9
1.11.14 1.11.13 1.11.1 1.11.10 1.11.11 1.11.12 1.11.2 1.11.3 1.11.4 1.11.5 1.11.6 1.11.7 1.11.8 1.11.9 1.3 1.4.7 1.6 1.7.12 1.7.13 1.7.14 1.7.15 1.7.16 1.7.17 1.7.18 1.7.19 All 53 releases
adminimize / inc-options / theme_options.php

theme_options.php in Adminimize 1.11.9, at inc-options/theme_options.php

135 lines 5.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Adminimize
4 * @subpackage Backend Theme options
5 * @author Frank Bültge
6 */
7 if ( ! function_exists( 'add_action' ) ) {
8 echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
9 exit;
10 }
11 ?>
12 <div id="poststuff" class="ui-sortable meta-box-sortables">
13 <div class="postbox">
14 <h3 class="hndle ui-sortable-handle" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>" id="set_theme" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><?php
15 esc_attr_e( 'Set Theme', 'adminimize' ) ?></h3>
16
17 <div class="inside">
18 <br class="clear" />
19
20 <?php if ( ! isset( $_POST[ '_mw_adminimize_action' ] ) || ! ( $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_load_theme' ) ) { ?>
21 <form name="set_theme" method="post" id="_mw_adminimize_set_theme" action="?page=<?php echo esc_attr(
22 $_GET[ 'page' ]
23 ); ?>">
24 <?php wp_nonce_field( 'mw_adminimize_nonce' ); ?>
25 <p><?php esc_attr_e(
26 'For better performance on sites with many users, you should load userlist data before making any changes in the theme options for users.',
27 'adminimize'
28 ); ?></p>
29
30 <p id="submitbutton">
31 <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_load_theme" />
32 <input type="submit" name="_mw_adminimize_load" value="<?php esc_attr_e(
33 'Load User Data', 'adminimize'
34 ); ?> &raquo;" class="button button-primary" />
35 </p>
36 </form>
37 <?php }
38 if ( isset( $_POST[ '_mw_adminimize_action' ] ) && ( $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_load_theme' ) ) { ?>
39 <form name="set_theme" method="post" id="_mw_adminimize_set_theme" action="?page=<?php echo esc_attr(
40 $_GET[ 'page' ]
41 ); ?>">
42 <?php wp_nonce_field( 'mw_adminimize_nonce' ); ?>
43 <table class="widefat usertheme">
44 <thead>
45 <tr class="thead">
46 <th class="num">&nbsp;</th>
47 <th class="num"><?php esc_attr_e( 'User-ID', 'adminimize' ) ?></th>
48 <th><?php esc_attr_e( 'Username', 'adminimize' ) ?></th>
49 <th><?php esc_attr_e( 'Display name publicly as', 'adminimize' ) ?></th>
50 <th><?php esc_attr_e( 'Admin Color Scheme', 'adminimize' ) ?></th>
51 <th><?php esc_attr_e( 'User Level', 'adminimize' ) ?></th>
52 <th><?php esc_attr_e( 'Role', 'adminimize' ) ?></th>
53 </tr>
54 </thead>
55 <tbody id="users" class="list:user user-list">
56 <?php
57 /** @var \WPDB $wpdb */
58 $wp_user_search = (array) $wpdb->get_results(
59 "SELECT ID, user_login, display_name FROM $wpdb->users ORDER BY ID"
60 );
61
62 foreach ( $wp_user_search as $userid ) {
63 $user_id = (int) $userid->ID;
64 $user_login = stripslashes( $userid->user_login );
65 $display_name = stripslashes( $userid->display_name );
66 $current_color = get_user_option( 'admin_color', $user_id );
67 $user_level = (int) get_user_option( $table_prefix . 'user_level', $user_id );
68 $user_object = new WP_User( $user_id );
69 $roles = $user_object->roles;
70 $role = array_shift( $roles );
71 /** @var \WP_Roles $wp_roles */
72 $role_name = '';
73 if ( isset( $wp_roles->role_names[ $role ] ) ) {
74 $role_name = $wp_roles->role_names[ $role ];
75 }
76
77 if ( function_exists( 'translate_user_role' ) ) {
78 $role_name = translate_user_role( $role_name );
79 } elseif ( function_exists( 'before_last_bar' ) ) {
80 $role_name = before_last_bar( $role_name );
81 } else {
82 $role_name = strrpos( $role_name, '|' );
83 }
84
85 $return = '';
86 $return .= '<tr>' . "\n";
87 $return .= "\t" . '<td class="num"><input type="checkbox" name="mw_adminimize_theme_items[]" value="' . $user_id . '" /></td>' . "\n";
88 $return .= "\t" . '<td class="num">' . $user_id . '</td>' . "\n";
89 $return .= "\t" . '<td>' . $user_login . '</td>' . "\n";
90 $return .= "\t" . '<td>' . $display_name . '</td>' . "\n";
91 $return .= "\t" . '<td>' . $current_color . '</td>' . "\n";
92 $return .= "\t" . '<td class="num">' . $user_level . '</td>' . "\n";
93 $return .= "\t" . '<td>' . $role_name . '</td>' . "\n";
94 $return .= '</tr>' . "\n";
95
96 echo $return;
97 }
98 ?>
99 <tr valign="top">
100 <td class="num">&nbsp;</td>
101 <td class="num">&nbsp;</td>
102 <td>&nbsp;</td>
103 <td>&nbsp;</td>
104 <td>
105 <label for="_mw_adminimize_set_theme"></label>
106 <select id="_mw_adminimize_set_theme" name="_mw_adminimize_set_theme">
107 <?php /** @var array $_wp_admin_css_colors */
108 foreach ( $_wp_admin_css_colors as $color => $color_info ): ?>
109 <option value="<?php echo $color; ?>"><?php echo $color_info->name . ' (' . $color . ')' ?></option>
110 <?php endforeach; ?>
111 </select>
112 </td>
113 <td>&nbsp;</td>
114 <td>&nbsp;</td>
115 </tr>
116 </tbody>
117 </table>
118 <p id="submitbutton">
119 <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_set_theme" />
120 <input type="hidden" name="_mw_adminimize_load" value="_mw_adminimize_load_theme" />
121 <input type="submit" name="_mw_adminimize_save" value="<?php esc_attr_e(
122 'Set Theme', 'adminimize'
123 ); ?> &raquo;" class="button button-primary" />
124 </p>
125 </form>
126 <?php } ?>
127
128 <p>
129 <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;"><?php esc_attr_e(
130 'scroll to top', 'adminimize'
131 ); ?></a><br class="clear" /></p>
132 </div>
133 </div>
134 </div>
135