| 598 | | while ( ($theme_dir = readdir($themes_dir)) !== false ) { |
| 599 | | if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) { |
| 600 | | if ( $theme_dir[0] == '.' || $theme_dir == 'CVS' ) |
| 601 | | continue; |
| | 597 | $found_theme = false; |
| | 598 | foreach ( $themes_directory as $theme_dir ) { |
| | 599 | if ( is_dir( $theme_root . '/' . $theme_dir ) && ( $theme_dir[0] == '.' || $theme_dir == 'CVS' ) ) |
| | 600 | continue; |
| | 601 | if ( ! file_exists( $theme_root . '/' . $theme_dir . '/style.css' ) ) |
| | 602 | continue; |
| | 603 | $found_themes[ $theme_dir ] = array( |
| | 604 | 'theme_file' => $theme_dir . '/style.css', |
| | 605 | 'theme_root' => $theme_root, |
| | 606 | ); |
| | 607 | $found_theme = true; |
| | 608 | } |
| 615 | | if ( !$found_stylesheet ) { // look for themes in that dir |
| 616 | | $subdir = "$theme_root/$theme_dir"; |
| 617 | | $subdir_name = $theme_dir; |
| 618 | | $theme_subdirs = @opendir( $subdir ); |
| | 618 | $found_theme = false; |
| | 619 | foreach ( $themes_directory as $theme_dir ) { |
| | 620 | if ( is_dir( $sub_theme_root . '/' . $theme_dir ) && ( $theme_dir[0] == '.' || $theme_dir == 'CVS' ) ) |
| | 621 | continue; |
| | 622 | if ( ! file_exists( $sub_theme_root . '/' . $theme_dir . '/style.css' ) ) |
| | 623 | continue; |
| | 624 | $found_themes[ $sub_theme_dir . '/' . $theme_dir ] = array( |
| | 625 | 'theme_file' => $sub_theme_dir . '/' . $theme_dir . '/style.css', |
| | 626 | 'theme_root' => $theme_root, |
| | 627 | ); |
| | 628 | $found_theme = true; |
| | 629 | } |
| 620 | | $found_subdir_themes = false; |
| 621 | | while ( ($theme_subdir = readdir($theme_subdirs)) !== false ) { |
| 622 | | if ( is_dir( $subdir . '/' . $theme_subdir) && is_readable($subdir . '/' . $theme_subdir) ) { |
| 623 | | if ( $theme_subdir[0] == '.' || $theme_subdir == 'CVS' ) |
| 624 | | continue; |
| 625 | | |
| 626 | | $stylish_dir = @opendir($subdir . '/' . $theme_subdir); |
| 627 | | $found_stylesheet = false; |
| 628 | | |
| 629 | | while ( ($theme_file = readdir($stylish_dir)) !== false ) { |
| 630 | | if ( $theme_file == 'style.css' ) { |
| 631 | | $theme_files["$theme_dir/$theme_subdir"] = array( 'theme_file' => $subdir_name . '/' . $theme_subdir . '/' . $theme_file, 'theme_root' => $theme_root ); |
| 632 | | $found_stylesheet = true; |
| 633 | | $found_subdir_themes = true; |
| 634 | | break; |
| 635 | | } |
| 636 | | } |
| 637 | | @closedir($stylish_dir); |
| 638 | | } |
| 639 | | } |
| 640 | | @closedir($theme_subdirs); |
| 641 | | if ( !$found_subdir_themes ) |
| 642 | | $wp_broken_themes[$theme_dir] = array('Name' => $theme_dir, 'Title' => $theme_dir, 'Description' => __('Stylesheet is missing.')); |
| 643 | | } |
| | 631 | if ( ! $found_theme ) { |
| | 632 | $wp_broken_themes[ $sub_theme_dir ] = array( |
| | 633 | 'Name' => $sub_theme_dir, |
| | 634 | 'Title' => $theme_dir, |
| | 635 | 'Description' => __( 'Stylesheet is missing.' ), |
| | 636 | ); |