function load_all_ub_modules() { if (is_dir(ub_files_dir('modules'))) { if ($dh = opendir(ub_files_dir('modules'))) { $ub_modules = array(); while (($module = readdir($dh)) !== false) { if (substr($module, -4) == '.php') { $ub_modules[] = $module; } } closedir($dh); sort($ub_modules); $ub_modules = apply_filters('ultimatebranding_available_modules', $ub_modules); foreach ($ub_modules as $ub_module) { include_once ub_files_dir('modules/' . $ub_module); } } } do_action('ultimatebranding_modules_loaded'); }
function css_help() { ob_start(); include_once ub_files_dir('help/contextual.css.php'); $help = ob_get_clean(); $this->screen->add_help_tab(array('id' => 'css', 'title' => __('Custom CSS', 'ub'), 'content' => $help)); }
function create_admin_page() { include_once ub_files_dir('modules/custom-admin-bar-files/lib/forms/plugin_settings.php'); }
function show_module_status() { global $action, $page; ?> <table class='widefat'> <thead> <th><?php _e('Available Modules', 'ub'); ?> </th> <th><a href='<?php echo wp_nonce_url("?page=" . $page . "&action=enableallmodules", 'enable-all-modules'); ?> '><?php _e('Enable', 'ub'); ?> </a> / <a href='<?php echo wp_nonce_url("?page=" . $page . "&action=disableallmodules", 'disable-all-modules'); ?> '><?php _e('Disable All', 'ub'); ?> </a></th> </thead> <tfoot> <th><?php _e('Available Modules', 'ub'); ?> </th> <th><a href='<?php echo wp_nonce_url("?page=" . $page . "&action=enableallmodules", 'enable-all-modules'); ?> '><?php _e('Enable', 'ub'); ?> </a> / <a href='<?php echo wp_nonce_url("?page=" . $page . "&action=disableallmodules", 'disable-all-modules'); ?> '><?php _e('Disable All', 'ub'); ?> </a></th> </tfoot> <tbody> <?php if (!empty($this->modules)) { $default_headers = array('Name' => 'Plugin Name', 'Author' => 'Author', 'Description' => 'Description', 'AuthorURI' => 'Author URI'); foreach ($this->modules as $module => $plugin) { $module_data = get_file_data(ub_files_dir('modules/' . $module), $default_headers, 'plugin'); // deactivate any conflisting plugins if (in_array($module, array_keys($this->plugin_msg))) { $this->deactivate_module($module); } if (ub_is_active_module($module)) { ?> <tr class='activemodule'> <td> <?php echo $module_data['Name']; ?> </td> <td> <a href='<?php echo wp_nonce_url("?page=" . $page . "&action=disable&module=" . $module . "", 'disable-module-' . $module); ?> ' class='disblelink'><?php _e('Disable', 'ub'); ?> </a> </td> </tr> <?php } else { ?> <tr class='inactivemodule'> <td> <?php echo $module_data['Name']; ?> </td> <td> <?php if (!in_array($module, array_keys($this->plugin_msg))) { ?> <a href='<?php echo wp_nonce_url("?page=" . $page . "&action=enable&module=" . $module . "", 'enable-module-' . $module); ?> ' class='enablelink'><?php _e('Enable', 'ub'); ?> </a> <?php } ?> </td> </tr> <?php } } } else { ?> <tr> <td colspan='2'><?php _e('No modules avaiable.', 'ub'); ?> </td> </tr> <?php } ?> </tbody> </table> <?php }
$href = $link['url']; break; } if (!$href) { continue; } if (isset($link['target']) && !empty($link['target'])) { $wp_admin_bar->add_menu(array('parent' => 'wdcab_root', 'id' => 'wdcab_' . preg_replace('/[^-a-z0-9]/', '-', strtolower($link['title'])), 'title' => stripslashes($link['title']), 'href' => $href, 'meta' => array('target' => $link['target']))); } else { $wp_admin_bar->add_menu(array('parent' => 'wdcab_root', 'id' => 'wdcab_' . preg_replace('/[^-a-z0-9]/', '-', strtolower($link['title'])), 'title' => stripslashes($link['title']), 'href' => $href)); } } } function ub_wdcab_remove_from_admin_bar() { global $wp_version; $version = preg_replace('/-.*$/', '', $wp_version); if (version_compare($version, '3.3', '>=')) { global $wp_admin_bar; $opts = ub_get_option('wdcab'); $disabled = is_array(@$opts['disabled_menus']) ? $opts['disabled_menus'] : array(); foreach ($disabled as $id) { $wp_admin_bar->remove_node($id); } } } require_once ub_files_dir('modules/custom-admin-bar-files/lib/class_wdcab_admin_form_renderer.php'); require_once ub_files_dir('modules/custom-admin-bar-files/lib/class_wdcab_admin_pages.php'); $ub_wdcab_adminpages = new ub_Wdcab_AdminPages(); add_action('admin_bar_menu', 'ub_wdcab_add_to_admin_bar', 1); add_action('admin_bar_menu', 'ub_wdcab_remove_from_admin_bar', 999);
Plugin Name: Custom Admin Bar Plugin URI: http://premium.wpmudev.org/project/custom-admin-bar Description: Adds a custom drop-down entry to your admin bar. Version: 1.6.1 Author: Barry (Incsub), Ve Bailovity (Incsub), Marko Miljus (Incsub), Sam Najian (Incsub) Author URI: http://premium.wpmudev.org WDP ID: 238 Copyright 2009-2013 Incsub (http://incsub.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (Version 2 - GPLv2) as published by the Free Software Foundation. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ require_once( ub_files_dir('modules/custom-admin-bar-files/inc/UB_Admin_Bar.php') ); require_once( ub_files_dir('modules/custom-admin-bar-files/inc/UB_Admin_Bar_Menu.php') ); require_once( ub_files_dir('modules/custom-admin-bar-files/inc/UB_Admin_Bar_Forms.php') ); require_once( ub_files_dir('modules/custom-admin-bar-files/inc/UB_Admin_Bar_Tab.php') ); $ub_wdcab_adminpages = new UB_Admin_Bar_Tab();