1
0
mirror of https://github.com/kremalicious/Badged.git synced 2024-12-29 08:07:44 +01:00

now works on toolbar in frontend too

slightly different options page layout

git-svn-id: http://plugins.svn.wordpress.org/badged/trunk@476934 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
kremalicious 2011-12-17 21:08:26 +00:00
parent e35c73a088
commit 2188521ad1
3 changed files with 19 additions and 16 deletions

View File

@ -100,7 +100,7 @@
#bubblesoptions form h2 { #bubblesoptions form h2 {
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
border-top: 1px solid #eee; border-top: 1px solid #eee;
margin-top: 1em; margin-top: .5em;
padding: 10px 0; padding: 10px 0;
} }

View File

@ -13,25 +13,21 @@
<tr valign="top"> <tr valign="top">
<td colspan="2"> <td colspan="2">
<h2><?php _e( 'View Options', 'bbls' ); ?></h2> <h2><?php _e( 'View Options', 'bbls' ); ?></h2>
</td> </td>
</tr> </tr>
<tr valign="top"> <tr valign="top">
<th scope="row" class="indent"> <th scope="row" class="indent">
<label for="menu"><?php _e( 'Style Notifications in Admin Menu', 'bbls' ); ?></label> <?php _e( 'Style Notifications in', 'bbls' ); ?>
</th> </th>
<td> <td>
<input type="checkbox" name="menu" value="yes"<?php echo get_option('menu') == 'yes' ? ' checked' : '';?> /> <fieldset>
</td> <input type="checkbox" name="menu" id="menu" value="yes"<?php echo get_option('menu') == 'yes' ? ' checked' : '';?> />
</tr> <label for="menu"><?php _e( 'Admin Menu', 'bbls' ); ?></label>
<br />
<tr valign="top"> <input type="checkbox" name="bar" id="bar" value="yes"<?php echo get_option('bar') == 'yes' ? ' checked' : '';?> />
<th scope="row" class="indent"> <label for="bar"><?php _e( 'Toolbar', 'bbls' ); ?></label>
<label for="bar"><?php _e( 'Style Notifications in Adminbar', 'bbls' ); ?></label> </fieldset>
</th>
<td>
<input type="checkbox" name="bar" value="yes"<?php echo get_option('bar') == 'yes' ? ' checked' : '';?> />
</td> </td>
</tr> </tr>

View File

@ -15,7 +15,6 @@ if (function_exists('load_plugin_textdomain')) {
} }
function bubbles_init() { function bubbles_init() {
bubbles_register_settings(); bubbles_register_settings();
if ( get_option('menu') == 'yes') { if ( get_option('menu') == 'yes') {
wp_register_style('bubbles-menu-css', plugins_url('/bubbles/bubbles-menu.css'), false, '9001'); wp_register_style('bubbles-menu-css', plugins_url('/bubbles/bubbles-menu.css'), false, '9001');
@ -26,7 +25,13 @@ function bubbles_init() {
wp_register_style('bubbles-bar-css', plugins_url('/bubbles/bubbles-bar.css'), false, '9001'); wp_register_style('bubbles-bar-css', plugins_url('/bubbles/bubbles-bar.css'), false, '9001');
wp_enqueue_style('bubbles-bar-css'); wp_enqueue_style('bubbles-bar-css');
} }
}
function bubbles_bar_only_init() {
if ( get_option('bar') == 'yes') {
wp_register_style('bubbles-bar-css', plugins_url('/bubbles/bubbles-bar.css'), false, '9001');
wp_enqueue_style('bubbles-bar-css');
}
} }
function bubbles_settings() { function bubbles_settings() {
@ -51,6 +56,8 @@ function bubbles_activation() {
if ( is_admin() ) { if ( is_admin() ) {
add_action('admin_init', 'bubbles_init'); add_action('admin_init', 'bubbles_init');
add_action('admin_menu', 'bubbles_settings'); add_action('admin_menu', 'bubbles_settings');
} elseif ( !is_admin() && get_option('bar') == 'yes' ) {
add_action('admin_bar_init', 'bubbles_bar_only_init');
} }
register_activation_hook(__FILE__, 'bubbles_activation'); register_activation_hook(__FILE__, 'bubbles_activation');