PluginProbe
Adminimize / 1.9.1
Adminimize v1.9.1
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
← All changes | inc-options/theme_options.php +126 -108 1.7.18 → 1.9.1 View file →
@@ -1,108 +1,126 @@
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 - <div class="handlediv" title="<?php _e('Click to toggle'); ?>"><br/></div>
15 - <h3 class="hndle" id="set_theme"><?php _e('Set Theme', FB_ADMINIMIZE_TEXTDOMAIN ) ?></h3>
16 - <div class="inside">
17 - <br class="clear" />
18 -
19 - <?php if ( ! isset($_POST['_mw_adminimize_action']) || !($_POST['_mw_adminimize_action'] == '_mw_adminimize_load_theme') ) { ?>
20 - <form name="set_theme" method="post" id="_mw_adminimize_set_theme" action="?page=<?php echo $_GET['page'];?>" >
21 - <?php wp_nonce_field('mw_adminimize_nonce'); ?>
22 - <p><?php _e('For better peformance with many users on your blog; load only userlist, when you will change the theme options for users.', FB_ADMINIMIZE_TEXTDOMAIN ); ?></p>
23 - <p id="submitbutton">
24 - <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_load_theme" />
25 - <input type="submit" name="_mw_adminimize_load" value="<?php _e('Load User Data', FB_ADMINIMIZE_TEXTDOMAIN ); ?> &raquo;" class="button button-primary" />
26 - </p>
27 - </form>
28 - <?php }
29 - if ( isset($_POST['_mw_adminimize_action']) && ($_POST['_mw_adminimize_action'] == '_mw_adminimize_load_theme') ) { ?>
30 - <form name="set_theme" method="post" id="_mw_adminimize_set_theme" action="?page=<?php echo $_GET['page'];?>" >
31 - <?php wp_nonce_field('mw_adminimize_nonce'); ?>
32 - <table class="widefat">
33 - <thead>
34 - <tr class="thead">
35 - <th>&nbsp;</th>
36 - <th class="num"><?php _e('User-ID') ?></th>
37 - <th><?php _e('Username') ?></th>
38 - <th><?php _e('Display name publicly as') ?></th>
39 - <th><?php _e('Admin-Color Scheme') ?></th>
40 - <th><?php _e('User Level') ?></th>
41 - <th><?php _e('Role') ?></th>
42 - </tr>
43 - </thead>
44 - <tbody id="users" class="list:user user-list">
45 - <?php
46 - $wp_user_search = $wpdb->get_results("SELECT ID, user_login, display_name FROM $wpdb->users ORDER BY ID");
47 -
48 - $style = '';
49 - foreach ( $wp_user_search as $userid ) {
50 - $user_id = (int) $userid->ID;
51 - $user_login = stripslashes($userid->user_login);
52 - $display_name = stripslashes($userid->display_name);
53 - $current_color = get_user_option('admin_color', $user_id);
54 - $user_level = (int) get_user_option($table_prefix . 'user_level', $user_id);
55 - $user_object = new WP_User($user_id);
56 - $roles = $user_object->roles;
57 - $role = array_shift($roles);
58 - if ( function_exists('translate_user_role') )
59 - $role_name = translate_user_role( $wp_roles->role_names[$role] );
60 - elseif ( function_exists('before_last_bar') )
61 - $role_name = before_last_bar( $wp_roles->role_names[$role], 'User role' );
62 - else
63 - $role_name = strrpos( $wp_roles->role_names[$role], '|' );
64 -
65 - $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
66 - $return = '';
67 - $return .= '<tr>' . "\n";
68 - $return .= "\t" . '<td><input type="checkbox" name="mw_adminimize_theme_items[]" value="' . $user_id . '" /></td>' . "\n";
69 - $return .= "\t" . '<td class="num">'. $user_id .'</td>' . "\n";
70 - $return .= "\t" . '<td>'. $user_login .'</td>' . "\n";
71 - $return .= "\t" . '<td>'. $display_name .'</td>' . "\n";
72 - $return .= "\t" . '<td>'. $current_color . '</td>' . "\n";
73 - $return .= "\t" . '<td class="num">'. $user_level . '</td>' . "\n";
74 - $return .= "\t" . '<td>'. $role_name . '</td>' . "\n";
75 - $return .= '</tr>' . "\n";
76 -
77 - echo $return;
78 - }
79 - ?>
80 - <tr valign="top">
81 - <td>&nbsp;</td>
82 - <td>&nbsp;</td>
83 - <td>&nbsp;</td>
84 - <td>&nbsp;</td>
85 - <td>
86 - <select name="_mw_adminimize_set_theme">
87 - <?php foreach ( $_wp_admin_css_colors as $color => $color_info ): ?>
88 - <option value="<?php echo $color; ?>"><?php echo $color_info->name . ' (' . $color . ')' ?></option>
89 - <?php endforeach; ?>
90 - </select>
91 - </td>
92 - <td>&nbsp;</td>
93 - <td>&nbsp;</td>
94 - </tr>
95 - </tbody>
96 - </table>
97 - <p id="submitbutton">
98 - <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_set_theme" />
99 - <input type="hidden" name="_mw_adminimize_load" value="_mw_adminimize_load_theme" />
100 - <input type="submit" name="_mw_adminimize_save" value="<?php _e('Set Theme', FB_ADMINIMIZE_TEXTDOMAIN ); ?> &raquo;" class="button button-primary" />
101 - </p>
102 - </form>
103 - <?php } ?>
104 -
105 - <p><a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php _e('scroll to top', FB_ADMINIMIZE_TEXTDOMAIN); ?></a><br class="clear" /></p>
106 - </div>
107 - </div>
108 - </div>
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 + <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
15 + <h3 class="hndle" id="set_theme" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><?php
16 + esc_attr_e( 'Set Theme', 'adminimize' ) ?></h3>
17 +
18 + <div class="inside">
19 + <br class="clear" />
20 +
21 + <?php if ( ! isset( $_POST[ '_mw_adminimize_action' ] ) || ! ( $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_load_theme' ) ) { ?>
22 + <form name="set_theme" method="post" id="_mw_adminimize_set_theme" action="?page=<?php echo esc_attr(
23 + $_GET[ 'page' ]
24 + ); ?>">
25 + <?php wp_nonce_field( 'mw_adminimize_nonce' ); ?>
26 + <p><?php esc_attr_e(
27 + 'For better peformance with many users on your blog; load only userlist, when you will change the theme options for users.',
28 + 'adminimize'
29 + ); ?></p>
30 +
31 + <p id="submitbutton">
32 + <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_load_theme" />
33 + <input type="submit" name="_mw_adminimize_load" value="<?php esc_attr_e(
34 + 'Load User Data', 'adminimize'
35 + ); ?> &raquo;" class="button button-primary" />
36 + </p>
37 + </form>
38 + <?php }
39 + if ( isset( $_POST[ '_mw_adminimize_action' ] ) && ( $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_load_theme' ) ) { ?>
40 + <form name="set_theme" method="post" id="_mw_adminimize_set_theme" action="?page=<?php echo esc_attr(
41 + $_GET[ 'page' ]
42 + ); ?>">
43 + <?php wp_nonce_field( 'mw_adminimize_nonce' ); ?>
44 + <table class="widefat usertheme">
45 + <thead>
46 + <tr class="thead">
47 + <th class="num">&nbsp;</th>
48 + <th class="num"><?php esc_attr_e( 'User-ID' ) ?></th>
49 + <th><?php esc_attr_e( 'Username' ) ?></th>
50 + <th><?php esc_attr_e( 'Display name publicly as' ) ?></th>
51 + <th><?php esc_attr_e( 'Admin-Color Scheme' ) ?></th>
52 + <th><?php esc_attr_e( 'User Level' ) ?></th>
53 + <th><?php esc_attr_e( 'Role' ) ?></th>
54 + </tr>
55 + </thead>
56 + <tbody id="users" class="list:user user-list">
57 + <?php
58 + $wp_user_search = $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 + if ( function_exists( 'translate_user_role' ) ) {
72 + $role_name = translate_user_role( $wp_roles->role_names[ $role ] );
73 + } elseif ( function_exists( 'before_last_bar' ) ) {
74 + $role_name = before_last_bar( $wp_roles->role_names[ $role ] );
75 + } else {
76 + $role_name = strrpos( $wp_roles->role_names[ $role ], '|' );
77 + }
78 +
79 + $return = '';
80 + $return .= '<tr>' . "\n";
81 + $return .= "\t" . '<td class="num"><input type="checkbox" name="mw_adminimize_theme_items[]" value="' . $user_id . '" /></td>' . "\n";
82 + $return .= "\t" . '<td class="num">' . $user_id . '</td>' . "\n";
83 + $return .= "\t" . '<td>' . $user_login . '</td>' . "\n";
84 + $return .= "\t" . '<td>' . $display_name . '</td>' . "\n";
85 + $return .= "\t" . '<td>' . $current_color . '</td>' . "\n";
86 + $return .= "\t" . '<td class="num">' . $user_level . '</td>' . "\n";
87 + $return .= "\t" . '<td>' . $role_name . '</td>' . "\n";
88 + $return .= '</tr>' . "\n";
89 +
90 + echo $return;
91 + }
92 + ?>
93 + <tr valign="top">
94 + <td class="num">&nbsp;</td>
95 + <td class="num">&nbsp;</td>
96 + <td>&nbsp;</td>
97 + <td>&nbsp;</td>
98 + <td>
99 + <select name="_mw_adminimize_set_theme">
100 + <?php foreach ( $_wp_admin_css_colors as $color => $color_info ): ?>
101 + <option value="<?php echo $color; ?>"><?php echo $color_info->name . ' (' . $color . ')' ?></option>
102 + <?php endforeach; ?>
103 + </select>
104 + </td>
105 + <td>&nbsp;</td>
106 + <td>&nbsp;</td>
107 + </tr>
108 + </tbody>
109 + </table>
110 + <p id="submitbutton">
111 + <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_set_theme" />
112 + <input type="hidden" name="_mw_adminimize_load" value="_mw_adminimize_load_theme" />
113 + <input type="submit" name="_mw_adminimize_save" value="<?php esc_attr_e(
114 + 'Set Theme', 'adminimize'
115 + ); ?> &raquo;" class="button button-primary" />
116 + </p>
117 + </form>
118 + <?php } ?>
119 +
120 + <p>
121 + <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
122 + 'scroll to top', 'adminimize'
123 + ); ?></a><br class="clear" /></p>
124 + </div>
125 + </div>
126 +</div>