buddypress/1.0b1/bp-xprofile/bp-xprofile-cssjs.php
Andy Peatling 35dae8e670 Tagging 1.0b1 xprofile.
git-svn-id: https://buddypress.svn.wordpress.org/tags/extended-profiles@776 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
2008-12-15 23:29:31 +00:00

55 lines
1.9 KiB
PHP

<?php
function xprofile_add_js() {
if ( $_SERVER['SCRIPT_NAME'] == '/wp-signup.php' )
wp_enqueue_script( 'jquery' );
}
add_action( 'wp', 'xprofile_add_js' );
function xprofile_add_css() {
if ( $_SERVER['SCRIPT_NAME'] == '/wp-signup.php' )
wp_enqueue_style( 'bp-xprofile-signup', site_url() . '/wp-content/mu-plugins/bp-xprofile/css/signup.css' );
wp_print_styles();
}
add_action( 'wp_head', 'xprofile_add_css' );
function xprofile_add_structure_css() {
/* Enqueue the structure CSS file to give basic positional formatting for xprofile pages */
wp_enqueue_style( 'bp-xprofile-structure', site_url() . '/wp-content/mu-plugins/bp-xprofile/css/structure.css' );
}
add_action( 'bp_styles', 'xprofile_add_structure_css' );
function xprofile_add_admin_css() {
if ( strpos( $_GET['page'], 'xprofile' ) !== false ) {
echo '<link rel="stylesheet" href="' . site_url() . '/wp-content/mu-plugins/bp-xprofile/css/admin.css" type="text/css" />';
}
}
add_action( 'admin_head', 'xprofile_add_admin_css' );
function xprofile_add_admin_js() {
if ( strpos( $_GET['page'], 'xprofile' ) !== false )
echo '<script type="text/javascript" src="' . site_url() . '/wp-content/mu-plugins/bp-xprofile/js/admin.js"></script>';
}
add_action( 'admin_head', 'xprofile_add_admin_js' );
function xprofile_add_cropper_js() {
global $bp;
if ( $_SERVER['SCRIPT_NAME'] == '/wp-activate.php' || $bp['current_component'] == ACTIVATION_SLUG || $bp['current_action'] == 'change-avatar' ) {
wp_enqueue_script('jquery');
wp_enqueue_script('prototype');
wp_enqueue_script('scriptaculous-root');
wp_enqueue_script('cropper');
add_action( 'wp_head', 'bp_core_add_cropper_js' );
}
if ( isset($_GET['page']) && $_GET['page'] == 'bp-xprofile.php' ) {
add_action( 'admin_head', 'bp_core_add_cropper_js' );
}
}
add_action( 'activate_header', 'xprofile_add_cropper_js' );
add_action( 'template_redirect', 'xprofile_add_cropper_js' );
add_action( 'admin_menu', 'xprofile_add_cropper_js' );
?>