PluginProbe
Adminimize / 1.11.2
Adminimize v1.11.2
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 / widget_options.php

widget_options.php in Adminimize 1.11.2, at inc-options/widget_options.php

197 lines 6.7 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 Widget Options, settings page
5 * @author Frank Bültge
6 * @since 1.8.1 01/10/2013
7 */
8 if ( ! function_exists( 'add_action' ) ) {
9 echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
10 exit;
11 }
12 ?>
13 <div id="poststuff" class="ui-sortable meta-box-sortables">
14 <div class="postbox">
15 <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br /></div>
16 <h3 class="hndle" id="widget_options"><?php esc_attr_e( 'Widgets', 'adminimize' ); ?></h3>
17
18 <div class="inside">
19 <br class="clear" />
20
21 <table summary="config_widget" class="widefat">
22 <colgroup>
23 <?php
24 $col = 0;
25 foreach ( $user_roles_names as $role_name ) {
26 echo '<col class="col' . $col . '">' . "\n";
27 $col ++;
28 }
29 ?>
30 </colgroup>
31 <thead>
32 <tr>
33 <th><?php esc_attr_e( 'Option', 'adminimize' ); ?></th>
34 <?php
35 foreach ( $user_roles_names as $role_name ) { ?>
36 <th><?php esc_attr_e( 'Deactivate for', 'adminimize' );
37 echo '<br/>' . $role_name; ?></th>
38 <?php } ?>
39 </tr>
40 <tr>
41 <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td>
42 <?php
43 foreach ( $user_roles as $role_slug ) {
44 echo '<td class="num">';
45 echo '<input id="select_all" class="widget_options_' . $role_slug
46 . '" type="checkbox" name="" value="" />';
47 echo '</td>' . "\n";
48 } ?>
49 </tr>
50 </thead>
51
52 <tbody>
53 <?php
54 foreach ( $user_roles as $role ) {
55 $disabled_widget_option_[ $role ] = _mw_adminimize_get_option_value(
56 'mw_adminimize_disabled_widget_option_' . $role . '_items'
57 );
58 }
59
60 $widget_options = array(
61 '#contextual-help-link-wrap',
62 '#screen-options-link-wrap',
63 '#available-widgets',
64 '.inactive-sidebar.orphan-sidebar',
65 '.inactive-sidebar',
66 );
67
68 $widget_options_names = array(
69 esc_attr__( 'Help', 'adminimize' ),
70 esc_attr__( 'Screen Options' ),
71 esc_attr__( 'Available Widgets' ),
72 esc_attr__( 'Inactive Sidebar (not used)' ),
73 esc_attr__( 'Inactive Widgets' ),
74 );
75
76 $registered_sidebars = _mw_adminimize_get_registered_sidebars();
77 foreach ( $registered_sidebars as $key => $value ) {
78
79 $widget_options[] = $key;
80 $widget_options_names[] = $value[ 'name' ];
81 }
82
83 // get registered widgets
84 $registered_widgets = _mw_adminimize_get_all_widgets();
85 foreach ( (array) $registered_widgets as $key => $value ) {
86 $widget_options[] = $key;
87 $widget_options_names[] = $value->name;
88 }
89
90 $_mw_adminimize_own_widget_values = _mw_adminimize_get_option_value(
91 '_mw_adminimize_own_widget_values'
92 );
93 $_mw_adminimize_own_widget_values = preg_split( "/\r\n/", $_mw_adminimize_own_widget_values );
94 foreach ( (array) $_mw_adminimize_own_widget_values as $key => $_mw_adminimize_own_widget_value ) {
95 $_mw_adminimize_own_widget_value = trim( $_mw_adminimize_own_widget_value );
96 $widget_options[] = $_mw_adminimize_own_widget_value;
97 }
98
99 $_mw_adminimize_own_widget_options = _mw_adminimize_get_option_value(
100 '_mw_adminimize_own_widget_options'
101 );
102 $_mw_adminimize_own_widget_options = preg_split( "/\r\n/", $_mw_adminimize_own_widget_options );
103 foreach ( (array) $_mw_adminimize_own_widget_options as $key => $_mw_adminimize_own_widget_option ) {
104 $_mw_adminimize_own_widget_option = trim( $_mw_adminimize_own_widget_option );
105 $widget_options_names[] = $_mw_adminimize_own_widget_option;
106 }
107
108 $x = 0;
109 foreach ( $widget_options as $index => $widget_option ) {
110 if ( $widget_option != '' ) {
111 $checked_user_role_ = array();
112 foreach ( $user_roles as $role ) {
113 $checked_user_role_[ $role ] = ( isset( $disabled_widget_option_[ $role ] )
114 && in_array(
115 $widget_option, $disabled_widget_option_[ $role ]
116 ) ) ? ' checked="checked"' : '';
117 }
118 echo '<tr>' . "\n";
119 echo '<td>' . $widget_options_names[ $index ] . ' <span>(' . $widget_option . ')</span> </td>' . "\n";
120 foreach ( $user_roles as $role ) {
121 echo '<td class="num">';
122 echo '<input id="check_post' . $role . $x . '" class="widget_options_'
123 . preg_replace( '/[^a-z0-9_-]+/', '', $role ) . '" type="checkbox"'
124 . $checked_user_role_[ $role ] . ' name="mw_adminimize_disabled_widget_option_'
125 . $role . '_items[]" value="' . $widget_option . '" />';
126 echo '</td>' . "\n";
127 }
128 echo '</tr>' . "\n";
129 $x ++;
130 }
131 }
132 ?>
133 </tbody>
134 </table>
135
136 <?php
137 //your own global options
138 ?>
139 <br style="margin-top: 10px;" />
140 <table summary="config_edit_post" class="widefat">
141 <thead>
142 <tr>
143 <th><?php esc_attr_e( 'Your own Widget options', 'adminimize' );
144 echo '<br />';
145 esc_attr_e( 'Option name', 'adminimize' ); ?></th>
146 <th><?php echo '<br />';
147 esc_attr_e( 'Selector, ID or class', 'adminimize' ); ?></th>
148 </tr>
149 </thead>
150
151 <tbody>
152 <tr valign="top">
153 <td colspan="2"><?php esc_attr_e(
154 'It is possible to add your own IDs or classes from elements and tags. You can find IDs and classes with the FireBug Add-on for Firefox. Assign a value and the associate name per line.',
155 'adminimize'
156 ); ?></td>
157 </tr>
158 <tr valign="top">
159 <td>
160 <textarea name="_mw_adminimize_own_widget_options" cols="60" rows="3" id="_mw_adminimize_own_widget_options" style="width: 95%;"><?php echo _mw_adminimize_get_option_value(
161 '_mw_adminimize_own_widget_options'
162 ); ?></textarea>
163 <br />
164 <?php esc_attr_e(
165 'Possible nomination for ID or class. Separate multiple nominations through a carriage return.',
166 'adminimize'
167 ); ?>
168 </td>
169 <td>
170 <textarea class="code" name="_mw_adminimize_own_widget_values" cols="60" rows="3" id="_mw_adminimize_own_widget_values" style="width: 95%;"><?php echo _mw_adminimize_get_option_value(
171 '_mw_adminimize_own_widget_values'
172 ); ?></textarea>
173 <br />
174 <?php esc_attr_e(
175 'Possible IDs or classes. Separate multiple values through a carriage return.', 'adminimize'
176 ); ?>
177 </td>
178 </tr>
179 </tbody>
180 </table>
181
182 <p id="submitbutton">
183 <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" />
184 <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php esc_attr_e(
185 'Update Options', 'adminimize'
186 ); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
187 </p>
188
189 <p>
190 <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
191 'scroll to top', 'adminimize'
192 ); ?></a><br class="clear" /></p>
193
194 </div>
195 </div>
196 </div>
197