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 {
border-bottom: 1px solid #eee;
border-top: 1px solid #eee;
margin-top: 1em;
margin-top: .5em;
padding: 10px 0;
}

View File

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

View File

@ -15,7 +15,6 @@ if (function_exists('load_plugin_textdomain')) {
}
function bubbles_init() {
bubbles_register_settings();
if ( get_option('menu') == 'yes') {
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_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() {
@ -51,6 +56,8 @@ function bubbles_activation() {
if ( is_admin() ) {
add_action('admin_init', 'bubbles_init');
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');