Changeset 529508 for shadowbox-js/trunk/inc/admin.php
- Timestamp:
- 04/10/2012 03:25:36 PM (14 years ago)
- File:
-
- 1 edited
-
shadowbox-js/trunk/inc/admin.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shadowbox-js/trunk/inc/admin.php
r496740 r529508 418 418 } 419 419 //$this->build_shadowbox ( true ); // Attempt to build and cache shadowbox.js 420 if ( ! $this->check_for_src_file () ) 421 update_option ( 'shadowbox-js-missing-src', true ); 420 $this->check_for_src_file (); 422 421 } 423 422 … … 493 492 $status = false; 494 493 495 if ( $status === false ) 494 $option = get_option( 'shadowbox-js-missing-src' ); 495 496 if ( $status === false && ! $option ) 496 497 update_option ( 'shadowbox-js-missing-src', true ); 498 else if ( $status === true && $option ) 499 update_option ( 'shadowbox-js-missing-src', false ); 497 500 498 501 return $status; … … 601 604 602 605 $uploads = wp_upload_dir (); 603 if ( empty( $uploads['error'] ) && ! empty( $uploads['basedir'] ) ) 606 if ( empty( $uploads['error'] ) && ! empty( $uploads['basedir'] ) ) { 607 $baseurl = $uploads['baseurl']; 604 608 $basedir = $uploads['basedir']; 605 else 609 } else { 610 $baseurl = WP_CONTENT_URL . '/uploads'; 606 611 $basedir = WP_CONTENT_DIR . '/uploads'; 612 } 607 613 608 614 $shadowbox_dir = "$basedir/shadowbox-js/"; 609 615 $shadowbox_src_dir = "{$shadowbox_dir}src"; 616 $shadowbox_src_url = "{$baseurl}/shadowbox-js/src"; 610 617 611 618 // Ouput correct content-type, and caching headers … … 623 630 // Replace S.path with the correct path, so we don't have to rely on autodetection which is broken with this method 624 631 if ( $include == 'core' ) 625 $output .= str_replace ( 'S.path=null;' , "S.path=' $plugin_url/shadowbox/';" , file_get_contents ( "$shadowbox_src_dir/$include.js" ) );632 $output .= str_replace ( 'S.path=null;' , "S.path='{$shadowbox_src_url}/';" , file_get_contents ( "$shadowbox_src_dir/$include.js" ) ); 626 633 else 627 $output .= file_get_contents ( " $shadowbox_src_dir/$include.js" );634 $output .= file_get_contents ( "{$shadowbox_src_dir}/{$include}.js" ); 628 635 } 629 636 630 637 $library = $this->get_option ( 'library' ); 631 $output .= file_get_contents ( " $shadowbox_src_dir/adapters/$library.js" );638 $output .= file_get_contents ( "{$shadowbox_src_dir}/adapters/{$library}.js" ); 632 639 633 640 foreach ( array ( 'load' , 'plugins' , 'cache' ) as $include ) 634 $output .= file_get_contents ( " $shadowbox_src_dir/$include.js" );641 $output .= file_get_contents ( "{$shadowbox_src_dir}/{$include}.js" ); 635 642 636 643 if ( $this->get_option ( 'useSizzle' ) == 'true' && $this->get_option ( 'library' ) != 'jquery' ) 637 $output .= file_get_contents ( " $shadowbox_src_dir/find.js" );644 $output .= file_get_contents ( "{$shadowbox_src_dir}/find.js" ); 638 645 639 646 $players = (array) $this->get_option ( 'players' ); 640 647 if ( in_array ( 'flv' , $players ) || in_array ( 'swf' , $players ) ) 641 $output .= file_get_contents ( " $shadowbox_src_dir/flash.js" );648 $output .= file_get_contents ( "{$shadowbox_src_dir}/flash.js" ); 642 649 643 650 $language = $this->get_option ( 'language' ); 644 $output .= file_get_contents ( " $shadowbox_src_dir/languages/$language.js" );651 $output .= file_get_contents ( "{$shadowbox_src_dir}/languages/{$language}.js" ); 645 652 646 653 foreach ( $players as $player ) 647 $output .= file_get_contents ( " $shadowbox_src_dir/players/$player.js" );654 $output .= file_get_contents ( "{$shadowbox_src_dir}/players/{$player}.js" ); 648 655 649 656 foreach ( array ( 'skin' , 'outro' ) as $include ) 650 $output .= file_get_contents ( " $shadowbox_src_dir/$include.js" );657 $output .= file_get_contents ( "{$shadowbox_src_dir}/{$include}.js" ); 651 658 652 659 wp_cache_set ( $this->md5 () , 'shadowbox-js' );
Note: See TracChangeset
for help on using the changeset viewer.