| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Adminimize |
| 4 |
* @subpackage Post 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 |
|
| 13 |
<div id="poststuff" class="ui-sortable meta-box-sortables"> |
| 14 |
<div class="postbox"> |
| 15 |
<div class="handlediv" title="<?php _e('Click to toggle'); ?>"><br/></div> |
| 16 |
<h3 class="hndle" id="config_edit_post"><?php _e('Write options - Post', FB_ADMINIMIZE_TEXTDOMAIN ); ?></h3> |
| 17 |
<div class="inside"> |
| 18 |
<br class="clear" /> |
| 19 |
|
| 20 |
<table summary="config_edit_post" class="widefat"> |
| 21 |
<thead> |
| 22 |
<tr> |
| 23 |
<th><?php _e('Write options - Post', FB_ADMINIMIZE_TEXTDOMAIN ); ?></th> |
| 24 |
<?php |
| 25 |
foreach ($user_roles_names as $role_name) { ?> |
| 26 |
<th><?php _e('Deactivate for', FB_ADMINIMIZE_TEXTDOMAIN ); echo '<br/>' . $role_name; ?></th> |
| 27 |
<?php } ?> |
| 28 |
</tr> |
| 29 |
</thead> |
| 30 |
|
| 31 |
<tbody> |
| 32 |
<?php |
| 33 |
$metaboxes = array( |
| 34 |
'#contextual-help-link-wrap', |
| 35 |
'#screen-options-link-wrap', |
| 36 |
'#titlediv', |
| 37 |
'#pageslugdiv', |
| 38 |
'#tagsdiv,#tagsdivsb,#tagsdiv-post_tag', |
| 39 |
'#formatdiv', |
| 40 |
'#categorydiv,#categorydivsb', |
| 41 |
'#category-add-toggle', |
| 42 |
'#postexcerpt', |
| 43 |
'#trackbacksdiv', |
| 44 |
'#postcustom', |
| 45 |
'#commentsdiv', |
| 46 |
'#passworddiv', |
| 47 |
'#authordiv', |
| 48 |
'#revisionsdiv', |
| 49 |
'.side-info', |
| 50 |
'#notice', |
| 51 |
'#post-body h2', |
| 52 |
'#media-buttons', |
| 53 |
'#wp-word-count', |
| 54 |
'#slugdiv,#edit-slug-box', |
| 55 |
'#misc-publishing-actions', |
| 56 |
'#commentstatusdiv', |
| 57 |
'#editor-toolbar #edButtonHTML, #quicktags' |
| 58 |
); |
| 59 |
|
| 60 |
if ( function_exists('current_theme_supports') && current_theme_supports( 'post-thumbnails', 'post' ) ) |
| 61 |
array_push($metaboxes, '#postimagediv'); |
| 62 |
if (class_exists('SimpleTagsAdmin')) |
| 63 |
array_push($metaboxes, '#suggestedtags'); |
| 64 |
if (function_exists('tc_post')) |
| 65 |
array_push($metaboxes, '#textcontroldiv'); |
| 66 |
if (class_exists('HTMLSpecialCharactersHelper')) |
| 67 |
array_push($metaboxes, '#htmlspecialchars'); |
| 68 |
if (class_exists('All_in_One_SEO_Pack')) |
| 69 |
array_push($metaboxes, '#postaiosp, #aiosp'); |
| 70 |
if (function_exists('tdomf_edit_post_panel_admin_head')) |
| 71 |
array_push($metaboxes, '#tdomf'); |
| 72 |
if (function_exists('post_notification_form')) |
| 73 |
array_push($metaboxes, '#post_notification'); |
| 74 |
if (function_exists('sticky_add_meta_box')) |
| 75 |
array_push($metaboxes, '#poststickystatusdiv'); |
| 76 |
|
| 77 |
// quick edit areas, id and class |
| 78 |
$quickedit_areas = array( |
| 79 |
'div.row-actions .inline', |
| 80 |
'fieldset.inline-edit-col-left', |
| 81 |
'fieldset.inline-edit-col-left label', |
| 82 |
'fieldset.inline-edit-col-left label.inline-edit-author', |
| 83 |
'fieldset.inline-edit-col-left .inline-edit-group', |
| 84 |
'fieldset.inline-edit-col-center', |
| 85 |
'fieldset.inline-edit-col-center .inline-edit-categories-label', |
| 86 |
'fieldset.inline-edit-col-center .category-checklist', |
| 87 |
'fieldset.inline-edit-col-right', |
| 88 |
'fieldset.inline-edit-col-right .inline-edit-tags', |
| 89 |
'fieldset.inline-edit-col-right .inline-edit-group', |
| 90 |
'tr.inline-edit-post p.inline-edit-save' |
| 91 |
); |
| 92 |
$metaboxes = array_merge($metaboxes, $quickedit_areas); |
| 93 |
|
| 94 |
$metaboxes_names = array( |
| 95 |
__('Help'), |
| 96 |
__('Screen Options'), |
| 97 |
__('Title', FB_ADMINIMIZE_TEXTDOMAIN), |
| 98 |
__('Permalink', FB_ADMINIMIZE_TEXTDOMAIN ), |
| 99 |
__('Tags', FB_ADMINIMIZE_TEXTDOMAIN ), |
| 100 |
__('Format', FB_ADMINIMIZE_TEXTDOMAIN), |
| 101 |
__('Categories', FB_ADMINIMIZE_TEXTDOMAIN ), |
| 102 |
__('Add New Category', FB_ADMINIMIZE_TEXTDOMAIN ), |
| 103 |
__('Excerpt', FB_ADMINIMIZE_TEXTDOMAIN ), |
| 104 |
__('Trackbacks', FB_ADMINIMIZE_TEXTDOMAIN ), |
| 105 |
__('Custom Fields'), |
| 106 |
__('Comments', FB_ADMINIMIZE_TEXTDOMAIN ), |
| 107 |
__('Password Protect This Post', FB_ADMINIMIZE_TEXTDOMAIN ), |
| 108 |
__('Post Author'), |
| 109 |
__('Post Revisions'), |
| 110 |
__('Related, Shortcuts', FB_ADMINIMIZE_TEXTDOMAIN ), |
| 111 |
__('Messages', FB_ADMINIMIZE_TEXTDOMAIN ), |
| 112 |
__('h2: Advanced Options', FB_ADMINIMIZE_TEXTDOMAIN ), |
| 113 |
__('Media Buttons (all)', FB_ADMINIMIZE_TEXTDOMAIN ), |
| 114 |
__('Word count', FB_ADMINIMIZE_TEXTDOMAIN ), |
| 115 |
__('Post Slug', FB_ADMINIMIZE_TEXTDOMAIN), |
| 116 |
__('Publish Actions', FB_ADMINIMIZE_TEXTDOMAIN ), |
| 117 |
__('Discussion'), |
| 118 |
__('HTML Editor Button') |
| 119 |
); |
| 120 |
|
| 121 |
if ( function_exists('current_theme_supports') && current_theme_supports( 'post-thumbnails', 'post' ) ) |
| 122 |
array_push($metaboxes_names, __('Post Thumbnail', FB_ADMINIMIZE_TEXTDOMAIN) ); |
| 123 |
if (class_exists('SimpleTagsAdmin')) |
| 124 |
array_push($metaboxes_names, 'Suggested tags from'); |
| 125 |
if (function_exists('tc_post')) |
| 126 |
array_push($metaboxes_names, 'Text Control'); |
| 127 |
if (class_exists('HTMLSpecialCharactersHelper')) |
| 128 |
array_push($metaboxes_names, 'HTML Special Characters'); |
| 129 |
if (class_exists('All_in_One_SEO_Pack')) |
| 130 |
array_push($metaboxes_names, 'All in One SEO Pack'); |
| 131 |
if (function_exists('tdomf_edit_post_panel_admin_head')) |
| 132 |
array_push($metaboxes_names, 'TDOMF'); |
| 133 |
if (function_exists('post_notification_form')) |
| 134 |
array_push($metaboxes_names, 'Post Notification'); |
| 135 |
if (function_exists('sticky_add_meta_box')) |
| 136 |
array_push($metaboxes_names, 'Post Sticky Status'); |
| 137 |
|
| 138 |
// quick edit names |
| 139 |
$quickedit_names = array( |
| 140 |
'<strong>' .__('Quick Edit Link', FB_ADMINIMIZE_TEXTDOMAIN) . '</strong>', |
| 141 |
__('QE', FB_ADMINIMIZE_TEXTDOMAIN) . ' ' . __('Inline Edit Left', FB_ADMINIMIZE_TEXTDOMAIN), |
| 142 |
' QE ⇒' . ' ' . __('All Labels', FB_ADMINIMIZE_TEXTDOMAIN), |
| 143 |
' QE ⇒' . ' ' . __('Author'), |
| 144 |
' QE ⇒' . ' ' . __('Password and Private', FB_ADMINIMIZE_TEXTDOMAIN), |
| 145 |
__('QE', FB_ADMINIMIZE_TEXTDOMAIN) . ' ' . __('Inline Edit Center', FB_ADMINIMIZE_TEXTDOMAIN), |
| 146 |
' QE ⇒' . ' ' . __('Categories Title', FB_ADMINIMIZE_TEXTDOMAIN), |
| 147 |
' QE ⇒' . ' ' . __('Categories List', FB_ADMINIMIZE_TEXTDOMAIN), |
| 148 |
__('QE', FB_ADMINIMIZE_TEXTDOMAIN) . ' ' . __('Inline Edit Right', FB_ADMINIMIZE_TEXTDOMAIN), |
| 149 |
' QE ⇒' . ' ' . __('Tags'), |
| 150 |
' QE ⇒' . ' ' . __('Status, Sticky', FB_ADMINIMIZE_TEXTDOMAIN), |
| 151 |
__('QE', FB_ADMINIMIZE_TEXTDOMAIN) . ' ' . __('Cancel/Save Button', FB_ADMINIMIZE_TEXTDOMAIN) |
| 152 |
); |
| 153 |
$metaboxes_names = array_merge($metaboxes_names, $quickedit_names); |
| 154 |
|
| 155 |
// add own post options |
| 156 |
$_mw_adminimize_own_post_values = _mw_adminimize_get_option_value('_mw_adminimize_own_post_values'); |
| 157 |
$_mw_adminimize_own_post_values = preg_split( "/\r\n/", $_mw_adminimize_own_post_values ); |
| 158 |
foreach ( (array) $_mw_adminimize_own_post_values as $key => $_mw_adminimize_own_post_value ) { |
| 159 |
$_mw_adminimize_own_post_value = trim($_mw_adminimize_own_post_value); |
| 160 |
array_push($metaboxes, $_mw_adminimize_own_post_value); |
| 161 |
} |
| 162 |
|
| 163 |
$_mw_adminimize_own_post_options = _mw_adminimize_get_option_value('_mw_adminimize_own_post_options'); |
| 164 |
$_mw_adminimize_own_post_options = preg_split( "/\r\n/", $_mw_adminimize_own_post_options ); |
| 165 |
foreach ( (array) $_mw_adminimize_own_post_options as $key => $_mw_adminimize_own_post_option ) { |
| 166 |
$_mw_adminimize_own_post_option = trim($_mw_adminimize_own_post_option); |
| 167 |
array_push($metaboxes_names, $_mw_adminimize_own_post_option); |
| 168 |
} |
| 169 |
|
| 170 |
$x = 0; |
| 171 |
$class = ''; |
| 172 |
foreach ($metaboxes as $index => $metabox) { |
| 173 |
if ($metabox != '') { |
| 174 |
$class = ( ' class="alternate"' == $class ) ? '' : ' class="alternate"'; |
| 175 |
$checked_user_role_ = array(); |
| 176 |
foreach ($user_roles as $role) { |
| 177 |
$checked_user_role_[$role] = ( isset($disabled_metaboxes_post_[$role]) && in_array($metabox, $disabled_metaboxes_post_[$role]) ) ? ' checked="checked"' : ''; |
| 178 |
} |
| 179 |
echo '<tr' . $class . '>' . "\n"; |
| 180 |
echo '<td>' . $metaboxes_names[$index] . ' <span style="color:#ccc; font-weight: 400;">(' . $metabox . ')</span> </td>' . "\n"; |
| 181 |
foreach ($user_roles as $role) { |
| 182 |
echo '<td class="num"><input id="check_post'. $role.$x .'" type="checkbox"' . $checked_user_role_[$role] . ' name="mw_adminimize_disabled_metaboxes_post_'. $role .'_items[]" value="' . $metabox . '" /></td>' . "\n"; |
| 183 |
} |
| 184 |
echo '</tr>' . "\n"; |
| 185 |
$x++; |
| 186 |
} |
| 187 |
} |
| 188 |
?> |
| 189 |
</tbody> |
| 190 |
</table> |
| 191 |
|
| 192 |
<?php |
| 193 |
//your own post options |
| 194 |
?> |
| 195 |
<br style="margin-top: 10px;" /> |
| 196 |
<table summary="config_own_post" class="widefat"> |
| 197 |
<thead> |
| 198 |
<tr> |
| 199 |
<th><?php _e('Your own post options', FB_ADMINIMIZE_TEXTDOMAIN ); echo '<br />'; _e('ID or class', FB_ADMINIMIZE_TEXTDOMAIN ); ?></th> |
| 200 |
<th><?php echo '<br />'; _e('Option', FB_ADMINIMIZE_TEXTDOMAIN ); ?></th> |
| 201 |
</tr> |
| 202 |
</thead> |
| 203 |
|
| 204 |
<tbody> |
| 205 |
<tr valign="top"> |
| 206 |
<td colspan="2"><?php _e('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.', FB_ADMINIMIZE_TEXTDOMAIN ); ?></td> |
| 207 |
</tr> |
| 208 |
<tr valign="top"> |
| 209 |
<td> |
| 210 |
<textarea name="_mw_adminimize_own_post_options" cols="60" rows="3" id="_mw_adminimize_own_post_options" style="width: 95%;" ><?php echo _mw_adminimize_get_option_value('_mw_adminimize_own_post_options'); ?></textarea> |
| 211 |
<br /> |
| 212 |
<?php _e('Possible nomination for ID or class. Separate multiple nominations through a carriage return.', FB_ADMINIMIZE_TEXTDOMAIN ); ?> |
| 213 |
</td> |
| 214 |
<td> |
| 215 |
<textarea class="code" name="_mw_adminimize_own_post_values" cols="60" rows="3" id="_mw_adminimize_own_post_values" style="width: 95%;" ><?php echo _mw_adminimize_get_option_value('_mw_adminimize_own_post_values'); ?></textarea> |
| 216 |
<br /> |
| 217 |
<?php _e('Possible IDs or classes. Separate multiple values through a carriage return.', FB_ADMINIMIZE_TEXTDOMAIN ); ?> |
| 218 |
</td> |
| 219 |
</tr> |
| 220 |
</tbody> |
| 221 |
</table> |
| 222 |
|
| 223 |
<p id="submitbutton"> |
| 224 |
<input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" /> |
| 225 |
<input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php _e('Update Options', FB_ADMINIMIZE_TEXTDOMAIN ); ?> »" /><input type="hidden" name="page_options" value="'dofollow_timeout'" /> |
| 226 |
</p> |
| 227 |
<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> |
| 228 |
|
| 229 |
</div> |
| 230 |
</div> |
| 231 |
</div> |
| 232 |
|