| @@ 1035-1059 (lines=25) @@ | ||
| 1032 | * @param bool $force_print |
|
| 1033 | * @return void |
|
| 1034 | */ |
|
| 1035 | private static function _print_scripts( $force_print = FALSE ) { |
|
| 1036 | if (( did_action( 'admin_enqueue_scripts' ) || did_action( 'wp_enqueue_scripts' )) && ! $force_print ) { |
|
| 1037 | if ( wp_script_is( 'ee_error_js', 'enqueued' )) { |
|
| 1038 | return; |
|
| 1039 | } else if ( wp_script_is( 'ee_error_js', 'registered' )) { |
|
| 1040 | add_filter( 'FHEE_load_css', '__return_true' ); |
|
| 1041 | add_filter( 'FHEE_load_js', '__return_true' ); |
|
| 1042 | wp_enqueue_script( 'ee_error_js' ); |
|
| 1043 | wp_localize_script( 'ee_error_js','ee_settings', array( 'wp_debug'=>WP_DEBUG )); |
|
| 1044 | } |
|
| 1045 | } else { |
|
| 1046 | return ' |
|
| 1047 | <script> |
|
| 1048 | /* <![CDATA[ */ |
|
| 1049 | var ee_settings = {"wp_debug":"' . WP_DEBUG . '"}; |
|
| 1050 | /* ]]> */ |
|
| 1051 | </script> |
|
| 1052 | <script src="' . includes_url() . 'js/jquery/jquery.js" type="text/javascript"></script> |
|
| 1053 | <script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script> |
|
| 1054 | <script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/EE_Error.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script> |
|
| 1055 | '; |
|
| 1056 | ||
| 1057 | } |
|
| 1058 | ||
| 1059 | } |
|
| 1060 | ||
| 1061 | ||
| 1062 | ||
| @@ 369-392 (lines=24) @@ | ||
| 366 | * @param bool $force_print |
|
| 367 | * @return string|void |
|
| 368 | */ |
|
| 369 | private function printScripts( $force_print = false ) { |
|
| 370 | if ( ! $force_print && ( did_action( 'admin_enqueue_scripts' ) || did_action( 'wp_enqueue_scripts' ) ) ) { |
|
| 371 | if ( wp_script_is( 'ee_error_js', 'enqueued' ) ) { |
|
| 372 | return ''; |
|
| 373 | } else if ( wp_script_is( 'ee_error_js', 'registered' ) ) { |
|
| 374 | add_filter( 'FHEE_load_css', '__return_true' ); |
|
| 375 | add_filter( 'FHEE_load_js', '__return_true' ); |
|
| 376 | wp_enqueue_script( 'ee_error_js' ); |
|
| 377 | wp_localize_script( 'ee_error_js', 'ee_settings', array( 'wp_debug' => WP_DEBUG ) ); |
|
| 378 | } |
|
| 379 | } else { |
|
| 380 | return ' |
|
| 381 | <script> |
|
| 382 | /* <![CDATA[ */ |
|
| 383 | var ee_settings = {"wp_debug":"' . WP_DEBUG . '"}; |
|
| 384 | /* ]]> */ |
|
| 385 | </script> |
|
| 386 | <script src="' . includes_url() . 'js/jquery/jquery.js" type="text/javascript"></script> |
|
| 387 | <script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script> |
|
| 388 | <script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/EE_Error.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script> |
|
| 389 | '; |
|
| 390 | } |
|
| 391 | return ''; |
|
| 392 | } |
|
| 393 | ||
| 394 | ||
| 395 | ||