OnAirWidget/onair.php
2023-08-22 07:56:54 +02:00

66 lines
1.6 KiB
PHP

<?php
/*
Plugin Name: OnAIR
Plugin URI: www.f4iyt.fr
Description: Plugin for information onair hamradio.
Author: Xavier
Version: 1.0f
*/
global $onair_version;
$onair_version = "3";
function onair_administration() {
include('onair_administration.php');
}
function onairAdm_admin_actions() {
add_menu_page("Options", "OnAIR", 10, "onair_administration", "onair_administration");
}
function onair_frontend($args) {
echo $args['before_widget'];
echo $args['before_title'].'OnAIR'.$args['after_title'];
include('onair_widget.php');
echo $args['after_widget'];
}
function onair_init(){
register_sidebar_widget("onair", "onair_frontend");
}
/*
function my_init_method() {
if (!is_admin() )
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-dialog');
wp_register_style('jquery_ui_css', plugins_url( 'js/jquery-ui.css' , __FILE__ ));
wp_enqueue_style('jquery_ui_css');
}
*/
function add_onair_stylesheet() {
wp_register_style('onairStyleSheets', plugins_url('onair.css' , __FILE__ ));
wp_enqueue_style( 'onairStyleSheets');
}
function set_onair_options () {
global $onair_db_version;
add_option('onair_showtext','Fréquency:28.360Mhz USB');
add_option('onair_showOn','true');
}
add_action('admin_menu', 'onairAdm_admin_actions');
add_action("plugins_loaded", "onair_init");
add_action('wp_print_styles', 'add_onair_stylesheet');
add_action('init', 'my_init_method');
register_activation_hook( __FILE__, 'set_onair_options' );
?>