Ad-minister to administer.
Author: Henrik Melin, Kal Ström
USAGE:
See the Help tab in Manage -> Ad-minister.
LICENCE:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
require_once ( 'ad-minister-functions.php' );
// Theme action
add_action('ad-minister', administer_template_action, 10, 2);
// XML Export
add_action('rss2_head', 'administer_export');
// Enable translation
add_action('init', 'administer_translate');
// Add administration menu
function administer_admin() {
if (!($user_level = get_option('administer_user_level'))) $user_level = 7;
add_management_page('Ad-minister', 'Ad-minister', $user_level, 'ad-minister', 'administer_main');
}
add_action('admin_menu', 'administer_admin');
// Ajax functions
add_action('wp_ajax_administer_save_content', 'administer_save_content');
add_action('wp_ajax_administer_delete_content', 'administer_delete_content');
add_action('wp_ajax_administer_save_position', 'administer_save_position');
add_action('wp_ajax_administer_delete_position', 'administer_delete_position');
// Handle theme widgets
if (get_option('administer_make_widgets') == 'true') {
add_action('sidebar_admin_page', 'administer_popuplate_widget_controls');
add_action('init', 'administer_load_widgets');
}
// Display on dashboard
if (get_option('administer_dashboard_show') == 'true')
add_action('activity_box_end', 'administer_activity_box_alerts', 1, 1);
// Count the number of impressions the content makes
if (get_option('administer_statistics') == 'true' && !is_admin()) {
add_action('init', 'administer_init_impressions');
add_action('shutdown', 'administer_save_impressions');
}
add_action('init', 'administer_do_redirect', 11);
add_action('administer_stats', 'administer_template_stats');
function administer_load_scripts () {
if (ereg('page\=ad\-minister', $_SERVER['REQUEST_URI'])) {
?>