/** * Common pre-header loader function for all WPI pages added in admin_menu() * * All back-end pages call this function, which then determines that UI to load below the headers. * * @since 3.0 */ static function common_pre_header() { global $current_screen; $browser = WPI_Functions::browser(); $screen_id = $current_screen->id; if (!$screen_id) { return; } //* Load Global Script and CSS Files */ if (file_exists(WPI_Path . '/core/css/jquery-ui-1.8.21.custom.css')) { wp_register_style('wpi-custom-jquery-ui', WPI_URL . '/core/css/jquery-ui-1.8.21.custom.css'); } if (file_exists(WPI_Path . '/core/css/wpi-admin.css')) { wp_register_style('wpi-admin-css', WPI_URL . '/core/css/wpi-admin.css', array(), WP_INVOICE_VERSION_NUM); } //* Load Page Conditional Script and CSS Files if they exist*/ if (file_exists(WPI_Path . "/core/css/{$screen_id}.css")) { wp_register_style('wpi-this-page-css', WPI_URL . "/core/css/{$screen_id}.css", array('wpi-admin-css'), WP_INVOICE_VERSION_NUM); } //* Load IE 7 fix styles */ if (file_exists(WPI_Path . "/core/css/ie7.css") && $browser['name'] == 'ie' && $browser['version'] == 7) { wp_register_style('wpi-ie7', WPI_URL . "/core/css/ie7.css", array('wpi-admin-css'), WP_INVOICE_VERSION_NUM); } //* Load Page Conditional Script and CSS Files if they exist*/ if (file_exists(WPI_Path . "/core/js/{$screen_id}.js")) { wp_register_script('wpi-this-page-js', WPI_URL . "/core/js/{$screen_id}.js", array('wp-invoice-events'), WP_INVOICE_VERSION_NUM); } //* Load Conditional Metabox Files */ if (file_exists(WPI_Path . "/core/ui/metabox/{$screen_id}.php")) { include_once WPI_Path . "/core/ui/metabox/{$screen_id}.php"; } }