2011-12-17 22:07:11 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Plugin Name: Bubbles
|
|
|
|
* Plugin URI: http://kremalicious.com
|
2011-12-17 22:08:53 +01:00
|
|
|
* Description: Transforms the standard WordPress update & comment notification bubbles into iOS-styled ones. Just activate and enjoy the red bubbles.
|
2011-12-17 22:07:11 +01:00
|
|
|
* Author: Matthias Kretschmann
|
|
|
|
* Author URI: http://matthiaskretschmann.com
|
|
|
|
* Version: 0.1.0
|
|
|
|
* License: GPL
|
|
|
|
*/
|
|
|
|
|
2011-12-17 22:08:03 +01:00
|
|
|
|
|
|
|
if (function_exists('load_plugin_textdomain')) {
|
|
|
|
load_plugin_textdomain('bbls', false, dirname(plugin_basename(__FILE__)).'/languages' );
|
|
|
|
}
|
2011-12-17 22:07:11 +01:00
|
|
|
|
|
|
|
function bubbles_init() {
|
2011-12-17 22:08:03 +01:00
|
|
|
bubbles_register_settings();
|
|
|
|
if ( get_option('menu') == 'yes') {
|
2011-12-17 22:09:28 +01:00
|
|
|
wp_register_style('bubbles-menu-css', plugins_url('css/bubbles-menu.css', __FILE__), false, '9001');
|
2011-12-17 22:08:03 +01:00
|
|
|
wp_enqueue_style('bubbles-menu-css');
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( get_option('bar') == 'yes') {
|
2011-12-17 22:09:28 +01:00
|
|
|
wp_register_style('bubbles-bar-css', plugins_url('css/bubbles-bar.css', __FILE__), false, '9001');
|
2011-12-17 22:08:03 +01:00
|
|
|
wp_enqueue_style('bubbles-bar-css');
|
|
|
|
}
|
2011-12-17 22:08:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function bubbles_bar_only_init() {
|
|
|
|
if ( get_option('bar') == 'yes') {
|
2011-12-17 22:09:28 +01:00
|
|
|
wp_register_style('bubbles-bar-css', plugins_url('css/bubbles-bar.css', __FILE__), false, '9001');
|
2011-12-17 22:08:26 +01:00
|
|
|
wp_enqueue_style('bubbles-bar-css');
|
|
|
|
}
|
2011-12-17 22:08:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function bubbles_settings() {
|
|
|
|
add_options_page('Bubbles Options', 'Bubbles', 'manage_options', 'bubbles_settings', 'bubbles_settings_page');
|
|
|
|
}
|
|
|
|
|
|
|
|
function bubbles_register_settings() {
|
|
|
|
register_setting('bubbles', 'menu');
|
|
|
|
register_setting('bubbles', 'bar');
|
|
|
|
}
|
|
|
|
|
|
|
|
function bubbles_settings_page() {
|
|
|
|
require_once('bubbles-settings.php');
|
|
|
|
}
|
|
|
|
|
|
|
|
function bubbles_activation() {
|
|
|
|
bubbles_register_settings();
|
|
|
|
update_option('menu', 'yes');
|
|
|
|
update_option('bar', 'yes');
|
2011-12-17 22:07:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( is_admin() ) {
|
|
|
|
add_action('admin_init', 'bubbles_init');
|
2011-12-17 22:08:03 +01:00
|
|
|
add_action('admin_menu', 'bubbles_settings');
|
2011-12-17 22:08:26 +01:00
|
|
|
} elseif ( !is_admin() && get_option('bar') == 'yes' ) {
|
|
|
|
add_action('admin_bar_init', 'bubbles_bar_only_init');
|
2011-12-17 22:07:11 +01:00
|
|
|
}
|
|
|
|
|
2011-12-17 22:08:03 +01:00
|
|
|
register_activation_hook(__FILE__, 'bubbles_activation');
|
|
|
|
|
2011-12-17 22:07:11 +01:00
|
|
|
?>
|