Changeset 328493
- Timestamp:
- 01/04/2011 02:07:19 AM (15 years ago)
- Location:
- kahis-wp-lite
- Files:
-
- 4 added
- 1 deleted
- 3 edited
-
tags/0.9 (added)
-
tags/0.9/admin-page.php (added)
-
tags/0.9/kwplite.php (added)
-
tags/0.9/readme.txt (added)
-
trunk/admin-page.php (modified) (7 diffs)
-
trunk/k-wp-lite.tmproj (deleted)
-
trunk/kwplite.php (modified) (12 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kahis-wp-lite/trunk/admin-page.php
r215377 r328493 7 7 <div class="wrap" id="<?php echo self::$abbr; ?>"> 8 8 9 <h2><?php echo self::$ short_name; ?></h2>9 <h2><?php echo self::$full_name; ?></h2> 10 10 11 <p> <?php _e('Check what you wantto hide.') ?></p>11 <p>✔ <?php _e('Check to hide.') ?></p> 12 12 13 13 <form method="post" action="options.php"> 14 14 15 <nav role="navigation" class="tabs"> 16 <a href="#col_menu_items" class="active">Menu items</a> 17 <?php 18 $i = 0; 19 foreach (self::$selectors as $s_group_name => $s_group_data) { 20 $i++; 21 if (empty($s_group_data)) continue; 22 echo '<a href="#col_'.$i.'">'.$s_group_name.'</a>'; 23 } ?> 24 25 <a href="#col_custom_css">Custom CSS</a> 26 <div style="clear:both"></div> 27 </nav> 28 15 29 <?php 16 // ============================================================ ==================================17 // =======Menu30 // ============================================================ 31 // Menu 18 32 ?> 19 33 20 <div class="col" >34 <div class="col" id="col_menu_items"> 21 35 <h3>Menu items</h3> 22 36 <ul class="col-content tall"> … … 28 42 $submenu = self::$remember['submenu']; 29 43 30 foreach ($menu as $menuitem) { 44 foreach ($menu as $menuitem) { 31 45 32 ?> 46 // url 47 if (false !== strpos($menuitem[2], '/')) 48 $url = get_bloginfo('wpurl').'/wp-admin/admin.php?page='.$menuitem[2]; 49 else 50 $url = $menuitem[2]; ?> 33 51 34 52 <li><label> … … 36 54 <?php if (isset(self::$settings['menuitems']['1'.md5($menuitem[2])])) echo 'checked="checked"'; ?> /> 37 55 38 <strong><?php if ($menuitem[0]) echo $menuitem[0]; else echo '— <em>separator</em> —' ?></strong> 56 <strong><?php 57 if ($menuitem[0]) 58 echo $menuitem[0] . ' <a href="'. $url . '">→</a>'; 59 else 60 echo '— <em>separator</em> —' ?></strong> 39 61 </label> 40 62 … … 44 66 echo '<ul>'; 45 67 foreach ($submenu[$menuitem[2]] as $menuitem) { 46 ?> 47 68 69 // url 70 if (false !== strpos($menuitem[2], '/')) 71 $url = get_bloginfo('wpurl').'/wp-admin/admin.php?page='.$menuitem[2]; 72 else 73 $url = $menuitem[2]; ?> 48 74 49 75 <li><label> 50 76 <input type="checkbox" name="<?php echo self::$abbr . '_menuitems[2'.md5($menuitem[2]).']'; ?>" 51 77 <?php if (isset(self::$settings['menuitems']['2'.md5($menuitem[2])])) echo 'checked="checked"'; ?> /> 52 53 <?php echo $menuitem[0] ?> 78 <?php echo $menuitem[0] ?> <a href="<?php echo $url ?>">→</a> 54 79 </label> 55 56 80 57 81 <?php … … 67 91 68 92 <?php 69 // ============================================================ ==================================70 // =======Selector-based lists93 // ============================================================ 94 // Selector-based lists 71 95 // go trough self::$settings[elements_to_hide] and echo identifiers from self::$selectors[...][...] 72 96 73 97 $vars_to_save[] = 'elements_to_hide'; 98 $i = 0; 74 99 foreach (self::$selectors as $s_group_name => $s_group_data) { 100 $i++; 75 101 if (empty($s_group_data)) continue; ?> 76 102 77 <div class="col <?php echo $s_group_name ?>" >103 <div class="col <?php echo $s_group_name ?>" id="col_<?php echo $i ?>"> 78 104 <h3><?php echo $s_group_name ?></h3> 79 105 <ul class="col-content"> … … 104 130 105 131 <?php 106 } ?>132 } 107 133 134 // ============================================================ 135 // Custom CSS ?> 108 136 109 <div class="col"> 110 <h3>Custom CSS</h3> 111 <div class="col-content"> 112 <?php $vars_to_save[] = 'custom_css'; ?> 113 <p>Will be applied on administration only. Example content: <code>#whatever {display:none;}</code></p> 114 <p><textarea name="<?php echo self::$abbr; ?>_custom_css" cols="30" rows="15"><?php echo htmlspecialchars(self::$settings['custom_css']); ?></textarea></p> 137 <div class="col" id="col_custom_css"> 138 <h3>Custom CSS</h3> 139 <div class="col-content"> 140 <?php $vars_to_save[] = 'custom_css'; ?> 141 <p>Will be applied on administration only. Example content: <code>#whatever {display:none;}</code></p> 142 <p><textarea name="<?php echo self::$abbr; ?>_custom_css" cols="70" rows="13"><?php echo htmlspecialchars(self::$settings['custom_css']); ?></textarea></p> 143 <p><small><strong>BTW:</strong> You may also use selectors like <code>body.level_lt_10</code> or <code>.level_2</code> to modify look only for some user-groups</small></p> 144 </div> 115 145 </div> 116 </div>117 146 118 147 <div class="cleaner"></div> … … 120 149 <h3>User level</h3> 121 150 <?php $vars_to_save[] = 'userlevel'; ?> 122 <p>Apply settings only for users on level < <input type=" text" name="<?php echo self::$abbr ?>_userlevel" value="<?php echo @self::$settings['userlevel'] ?>" size="3" /> (leave empty to apply settings to all user-levels)151 <p>Apply settings only for users on level < <input type="number" min="0" max="11" size="4" name="<?php echo self::$abbr ?>_userlevel" value="<?php echo @self::$settings['userlevel'] ?>" /> (leave empty to apply settings to all user-levels) 123 152 <br />Help: <a href="http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table">Levels vs. Roles</a></p> 124 125 153 126 154 <p class="submit"> -
kahis-wp-lite/trunk/kwplite.php
r215377 r328493 5 5 Description: Make WordPress look thin. 6 6 Author: Peter Kahoun 7 Version: 0. 8.27 Version: 0.9 8 8 Author URI: http://kahi.cz 9 9 */ 10 11 // @todo next: other selector-boxes [20]12 13 10 class kwplite { 14 11 const DEV = false; … … 48 45 **/ 49 46 static $selectors = array( 47 48 49 'General' => array( 50 51 'header-logo' => array('#header-logo', 'Header: WordPress logo'), 52 'site-visit-button' => array('#site-visit-button', 'Header: Visit site button'), // not since 3.1 53 'favorite-actions' => array('#favorite-actions', 'Header: Favourite actions'), 54 'turbo' => array('.turbo-nag', 'Header: Turbo link'), // not since 3.1 55 'plugins-number' => array('#adminmenu .update-plugins', 'Menu: Plugins number'), 56 'separator1' => '', 57 'tab-settings' => array('#show-settings-link', 'Tab: Settings'), 58 'tab-help' => array('#contextual-help-link-wrap', 'Tab: Help'), 59 'update-nag' => array('#update-nag, .update-nag', 'Update possibility message'), 60 'separator2' => '', 61 'footer' => array('#footer', 'Footer'), 62 'footer-by' => array('#footer-left', 'Footer: links (left part)'), 63 'footer-version' => array('#footer-upgrade', 'Footer: version info (right part)'), 64 ), 65 66 'Dashboard' => array( 67 'right-now' => array('#dashboard_right_now,label[for="dashboard_right_now-hide"]', 'Right now'), 68 'right-now-comments' => array('#dashboard_right_now .table_discussion', 'Right now: Discussion'), 69 'right-now-theme' => array('.versions > p', 'Right now: Theme info'), 70 'right-now-version' => array('#wp-version-message', 'Right now: Version info'), 71 'recent-comments' => array('#dashboard_recent_comments,label[for="dashboard_recent_comments-hide"]', 'Recent comments'), 72 'incoming-links' => array('#dashboard_incoming_links,label[for="dashboard_incoming_links-hide"]', 'Incoming links'), 73 'plugins' => array('#dashboard_plugins,label[for="dashboard_plugins-hide"]', 'Recommended plugins'), 74 'quickpress' => array('#dashboard_quick_press,label[for="dashboard_quick_press-hide"]', 'QuickPress'), 75 'drafts' => array('#dashboard_recent_drafts,label[for="dashboard_recent_drafts-hide"]', 'Recent drafts'), 76 'news1' => array('#dashboard_primary,label[for="dashboard_primary-hide"]', 'WordPress development blog'), 77 'news2' => array('#dashboard_secondary,label[for="dashboard_secondary-hide"]', 'WordPress other news'), 78 ), 79 50 80 'Post' => array( 51 81 'slug' => array('#edit-slug-box,label[for="slugdiv-hide"]', 'Slug (URL)'), … … 58 88 'separator1' => '', 59 89 'content' => array('#postdivrich', 'Content'), 60 'content-tabs' => array('#editor-toolbar ', 'Content: Visual/HTML tabs'),90 'content-tabs' => array('#editor-toolbar > a', 'Content: Visual/HTML tabs'), 61 91 'content-footer1' => array('tr.mceLast', 'Content: Visual editor footer 1 ("Path")'), 62 92 'content-footer2' => array('table#post-status-info', 'Content: Visual editor footer 2'), … … 69 99 'box-trackbacks' => array('#trackbacksdiv,label[for="trackbacksdiv-hide"]', 'Trackbacks'), 70 100 'box-customfields' => array('#postcustom,label[for="postcustom-hide"]', 'Custom fields'), 101 'box-formatdiv' => array('#formatdiv,label[for="formatdiv-hide"]', 'Format'), 71 102 'box-categories' => array('#categorydiv,label[for="categorydiv-hide"]', 'Categories'), 72 103 'box-tags' => array('#tagsdiv-post_tag,label[for="tagsdiv-post_tag-hide"]', 'Tags'), 73 'box-author' => array('#authordiv ', 'Author'),104 'box-author' => array('#authordiv,label[for="authordiv-hide"],#pageauthordiv,label[for="pageauthordiv-hide"]', 'Author'), 74 105 'box-revisions' => array('#revisionsdiv', 'Revisions'), 75 106 'box-postimage' => array('#postimagediv', 'Post image'), … … 80 111 'pageparentdiv' => array('#pageparentdiv', 'Page details (parent page, template and order)'), 81 112 ), 82 // @ todo add boxes added by plugins - see More Fields plugin - search $wp_meta_boxes in more-fields-manage-pages.php113 // @maybe todo add boxes added by plugins - see More Fields plugin - search $wp_meta_boxes in more-fields-manage-pages.php 83 114 // @todo remember - add selectors for quickedit 84 115 // @maybe submit patch to wp core - add ids for sub-fields in #pageparentdiv 85 116 86 'Dashboard' => array(87 'right-now' => array('#dashboard_right_now,label[for="dashboard_right_now-hide"]', 'Right now'),88 'right-now-theme' => array('.versions > p', 'Right now: Theme info'),89 'right-now-version' => array('#wp-version-message', 'Right now: Version info'),90 'recent-comments' => array('#dashboard_recent_comments,label[for="dashboard_recent_comments-hide"]', 'Recent comments'),91 'incoming-links' => array('#dashboard_incoming_links,label[for="dashboard_incoming_links-hide"]', 'Incoming links'),92 'plugins' => array('#dashboard_plugins,label[for="dashboard_plugins-hide"]', 'Recommended plugins'),93 'quickpress' => array('#dashboard_quick_press,label[for="dashboard_quick_press-hide"]', 'QuickPress'),94 'drafts' => array('#dashboard_recent_drafts,label[for="dashboard_recent_drafts-hide"]', 'Recent drafts'),95 'news1' => array('#dashboard_primary,label[for="dashboard_primary-hide"]', 'WordPress development blog'),96 'news2' => array('#dashboard_secondary,label[for="dashboard_secondary-hide"]', 'WordPress other news'),97 ),98 // @maybe right-now subfields: comments (8 cells), category, tags, pages, posts (per 2 cells)99 100 'General' => array(101 102 'header-logo' => array('#header-logo', 'Header: WordPress logo'),103 'site-visit-button' => array('#site-visit-button', 'Header: Visit site button'),104 'favorite-actions' => array('#favorite-actions', 'Header: Favourite actions'),105 'turbo' => array('.turbo-nag', 'Header: Turbo link'),106 'plugins-number' => array('#adminmenu .update-plugins', 'Menu: Plugins number'),107 'separator1' => '',108 'tab-settings' => array('#show-settings-link', 'Tab: Settings'),109 'tab-help' => array('#contextual-help-link-wrap', 'Tab: Help'),110 'update-nag' => array('#update-nag', 'Update possibility message'),111 'separator2' => '',112 'footer' => array('#footer', 'Footer'),113 'footer-by' => array('#footer-left', 'Footer: version info (left part)'),114 'footer-version' => array('#footer-upgrade', 'Footer: links (right part)'),115 ),116 117 117 118 'Links' => array( … … 131 132 ), 132 133 133 'Other' => array( 134 'Media, images & galleries' => array( 135 // @todo test !!! 136 'media_tab-type' => array('#media-upload #tab-type', 'Tab 1: upload'), 137 'media_tab-type_url' => array('#media-upload #tab-type_url', 'Tab 2: insert from URL'), 138 'media_tab-gallery' => array('#media-upload #tab-gallery', 'Tab 3: post\'s attachments'), 139 'media_tab-library' => array('#media-upload #tab-library', 'Media tab 4: media library'), 140 'separator1' => '', 141 'media_item_post_title' => array('#media-upload .post_title', 'Title'), 142 'media_item_image_alt' => array('#media-upload .image_alt, #media-single-form .image_alt', 'Alternate Text'), 143 'media_item_post_excerpt' => array('#media-upload .post_excerpt, #media-single-form .post_excerpt', 'Caption'), 144 'media_item_post_content' => array('#media-upload .post_content, #media-single-form .post_content', 'Description'), 145 'media_item_url' => array('#media-upload .url', 'Link URL'), 146 'media_item_url_button_urlpost' => array('#media-upload .button.urlpost', 'Link URL: "Post URL" button'), 147 'media_item_url_help' => array('#media-upload .url .help', 'Link URL: Help note'), 148 'media_item_align' => array('#media-upload .align', 'Alignment'), 149 'media_item_image-size' => array('#media-upload .image-size', 'Size'), 150 151 'separator2' => '', 152 153 'media_gallery' => array('#media-upload #gallery-settings, #gallery-settings > *,', 'Media: Gallery'), 154 155 156 157 'separator3' => '', 158 159 #sort-buttons 160 161 'media_search' => array('#media-upload form#filter', 'Media search'), 162 163 164 165 166 134 167 // @todo Edit Comments (spam marking and folder) 135 168 // @todo Edit Media (Alternate text, Description, Caption) … … 139 172 140 173 141 142 // Descr: initialization. filling main variables, preparing, hooking 143 // Descr: constructor replacement (this class is designed to be used as static). calling the initialization: see the end. 174 /** 175 * Initialization - filling main variables, preparing data, hooking into WP. Constructor replacement. 176 * 177 * @uses apply_filters('kwplite_selectors_init') 178 */ 144 179 public static function Init () { 145 180 if (self::DEV) error_reporting(E_ALL); … … 162 197 add_action('admin_head', array (self::$abbr, 'admin_head')); 163 198 add_action('admin_menu', array (self::$abbr, 'admin_menu')); 199 add_filter ('admin_body_class', array(__CLASS__,'admin_body_class')); 200 // hookable. $selectors array is modifyable 201 self::$selectors = apply_filters('kwplite_selectors_init', self::$selectors); 164 202 } 165 203 … … 193 231 return; 194 232 195 196 233 // remove hidden items from $menu 197 234 foreach ($menu as $key => $menuitem) { 235 198 236 // if (array_key_exists('1'.md5($menuitem[2]), (self::$settings['menuitems'])) { 199 237 if (isset(self::$settings['menuitems']['1'.md5($menuitem[2])])) { … … 249 287 /* options-page interface */ 250 288 289 #kwplite h3 { 290 font-family: Georgia, serif; font-size: 20px; font-weight: normal; 291 } 292 251 293 #kwplite div.col { 252 float:left; margin-right:20px; 253 min-width:200px; max-width:350px; padding-top:20px; 294 padding:20px; 295 border: 1px solid #ccc; 296 -moz-border-radius: 7px; 297 -webkit-border-radius: 7px; 298 border-radius: 7px; 299 } 300 301 #kwplite div.col .col-content.tall { 302 -moz-column-count: 3; 303 -moz-column-gap: 20px; 304 -webkit-column-count: 3; 305 -webkit-column-gap: 20px; 306 column-count: 3; 307 column-gap: 20px; 254 308 } 255 309 256 310 #kwplite div.col .col-content { 257 height:380px; padding-right:2em; overflow-y:scroll; 258 } 259 260 #kwplite div.col .col-content.tall { 261 height:780px; 311 overflow-y: auto; 312 max-height: 520px; 262 313 } 263 314 … … 283 334 } 284 335 336 /* tabs */ 337 338 #kwplite nav.tabs { 339 display: block; margin: 0 14px; 340 } 341 342 #kwplite nav.tabs a { 343 float: left; margin-right: 3px; position: relative; top: 0px; 344 padding: 5px 15px; 345 border: 1px solid #ccc; border-bottom-color: #f7f7f7; 346 -moz-border-radius: 7px 7px 0 0; 347 -webkit-border-radius: 7px 7px 0 0; 348 border-radius: 7px 7px 0 0; 349 background-color: #f4f4f4; 350 text-decoration: none; 351 } 352 353 #kwplite nav.tabs a.active { 354 top: 1px; 355 background-color: transparent; 356 color: #333; 357 } 358 #kwplite nav.tabs a:hover { 359 color: #333; 360 } 285 361 286 362 /* post-editing elements hiding xxx */ … … 317 393 </style> 318 394 395 <script type="text/javascript"> 396 jQuery(document).ready(function(){ 397 398 // #reusable #tabs 2010.12.12 399 jQuery('#kwplite nav.tabs a') 400 .each(function(i){ 401 402 if (i > 0) 403 jQuery(jQuery(this).attr('href')).hide(); 404 405 }) 406 .click(function(){ 407 408 // clicked = active 409 if (jQuery(this).is('.active')) 410 return false; 411 412 // show content 413 jQuery(jQuery(this).parents('nav').find('.active').attr('href')).hide(); 414 jQuery(jQuery(this).attr('href')).hide().removeClass('hidden').fadeIn('fast'); 415 416 // mark tab 417 jQuery(this).parents('nav').find('.active').removeClass('active'); 418 jQuery(this).addClass('active'); 419 420 return false; 421 }); 422 423 }); 424 425 </script> 319 426 <?php 320 427 } 321 428 429 430 /** 431 * WP Hook: admin_body_class 432 * Modifies body class by adding class-names reflecting currently logged user's level. Usage: Custom CSS rules applied only on specific user-groups. 433 **/ 434 public function admin_body_class ($in) { 435 $current_user = wp_get_current_user(); 436 437 for ($i = 1; $i<11; $i++) 438 if ($i < $current_user->user_level) 439 $in .= ' level_gt_'.$i; 440 elseif ($i == $current_user->user_level) 441 $in .= ' level_'.$i; 442 elseif ($i > $current_user->user_level) 443 $in .= ' level_lt_'.$i; 444 445 return $in; 446 } 322 447 323 448 // ==================== WP administration pages ==================== -
kahis-wp-lite/trunk/readme.txt
r215377 r328493 4 4 Tags: lite, wplite, usability, admin, administration, minimal, light, lightweight, hide, customization 5 5 Requires at least: 2.7 6 Tested up to: 2.9.26 Tested up to: 3.1 7 7 Stable tag: trunk 8 8 9 Hide from your administration functions you don't need! 9 To hide unused functions from the administration. Make it clear. 10 10 11 11 == Description == 12 12 13 There are always parts in your Wordpress administration you don't currently need. This plugin makes it easy to them -unnecessary menu items or any of the boxes on the posting screen (like custom fields or trackback box). Unclutter the administration and work faster.13 There are always parts in the WP administration you don't currently need. This plugin makes it easy to hide them - like unnecessary menu items or any of the boxes on the posting screen (like custom fields or trackback box). Unclutter the administration and work faster. 14 14 15 15 You can also input your own CSS code to modify the look of administration. 16 16 17 17 For more information, support, giving feedback, reporting problems (thank you for that!) or anything else - see the [official plugin's page](http://kahi.cz/wordpress/wp-lite-plugin/). 18 19 = Requirements =20 21 **PHP 5** on your server is necessary to run this plugin.22 18 23 19 == Screenshots == … … 26 22 27 23 == Changelog == 24 25 = 0.9 = 26 * ADD: Some of the details brought by WP 3.1 27 * MOD: Interface improvements 28 29 = 0.8.3 = 30 * FIX: Various small fixes 31 * ADD: Media/Gallery screens items switching 28 32 29 33 = 0.8.2 =
Note: See TracChangeset
for help on using the changeset viewer.