| 595 | | while ( ($theme_dir = readdir($themes_dir)) !== false ) { |
| 596 | | if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) { |
| 597 | | if ( $theme_dir[0] == '.' || $theme_dir == 'CVS' ) |
| 598 | | continue; |
| | 595 | while ( ( $theme_dir = readdir( $themes_dir ) ) !== false ) { |
| | 596 | $subdir = "$theme_root/$theme_dir"; |
| | 597 | |
| | 598 | if ( '.' == $theme_dir[0] || !is_dir( $subdir ) || ! is_readable( $subdir ) ) |
| | 599 | continue; |
| | 600 | |
| | 601 | $stylish_dir = @opendir( $subdir ); |
| | 602 | $found_stylesheet = false; |
| 600 | | $stylish_dir = @opendir($theme_root . '/' . $theme_dir); |
| 601 | | $found_stylesheet = false; |
| 602 | | |
| 603 | | while ( ($theme_file = readdir($stylish_dir)) !== false ) { |
| 604 | | if ( $theme_file == 'style.css' ) { |
| 605 | | $theme_files[$theme_dir] = array( 'theme_file' => $theme_dir . '/' . $theme_file, 'theme_root' => $theme_root ); |
| 606 | | $found_stylesheet = true; |
| 607 | | break; |
| 608 | | } |
| | 604 | while ( ( $theme_file = readdir( $stylish_dir ) ) !== false ) { |
| | 605 | if ( $theme_file == 'style.css' ) { |
| | 606 | $theme_files[$theme_dir] = array( 'theme_file' => $theme_dir . '/' . $theme_file, 'theme_root' => $theme_root ); |
| | 607 | $found_stylesheet = true; |
| | 608 | break; |
| 612 | | if ( !$found_stylesheet ) { // look for themes in that dir |
| 613 | | $subdir = "$theme_root/$theme_dir"; |
| 614 | | $subdir_name = $theme_dir; |
| 615 | | $theme_subdirs = @opendir( $subdir ); |
| | 613 | if ( !$found_stylesheet ) { // look for themes in that dir |
| | 614 | $subdir_name = $theme_dir; |
| | 615 | $theme_subdirs = @opendir( $subdir ); |
| | 616 | $found_subdir_themes = false; |
| | 617 | |
| | 618 | while ( ( $theme_subdir = readdir( $theme_subdirs ) ) !== false ) { |
| | 619 | $sub_subdir = "$subdir/$theme_subdir"; |
| | 620 | |
| | 621 | if ( '.' == $theme_subdir[0] || !is_dir( $sub_subdir ) || !is_readable( $sub_subdir ) ) |
| | 622 | continue; |
| 623 | | $stylish_dir = @opendir($subdir . '/' . $theme_subdir); |
| 624 | | $found_stylesheet = false; |
| 625 | | |
| 626 | | while ( ($theme_file = readdir($stylish_dir)) !== false ) { |
| 627 | | if ( $theme_file == 'style.css' ) { |
| 628 | | $theme_files["$theme_dir/$theme_subdir"] = array( 'theme_file' => $subdir_name . '/' . $theme_subdir . '/' . $theme_file, 'theme_root' => $theme_root ); |
| 629 | | $found_stylesheet = true; |
| 630 | | $found_subdir_themes = true; |
| 631 | | break; |
| 632 | | } |
| 633 | | } |
| 634 | | @closedir($stylish_dir); |
| | 627 | while ( ($theme_file = readdir($stylish_dir)) !== false ) { |
| | 628 | if ( $theme_file == 'style.css' ) { |
| | 629 | $theme_files["$theme_dir/$theme_subdir"] = array( 'theme_file' => $subdir_name . '/' . $theme_subdir . '/' . $theme_file, 'theme_root' => $theme_root ); |
| | 630 | $found_stylesheet = true; |
| | 631 | $found_subdir_themes = true; |
| | 632 | break; |