| 103 | | if ( $themes_dir ) { |
|---|
| 104 | | while ( ($theme_dir = $themes_dir->read()) !== false ) { |
|---|
| 105 | | if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) { |
|---|
| 106 | | if ( $theme_dir{0} == '.' || $theme_dir == '..' || $theme_dir == 'CVS' ) |
|---|
| 107 | | continue; |
|---|
| 108 | | $stylish_dir = @ dir($theme_root . '/' . $theme_dir); |
|---|
| 109 | | $found_stylesheet = false; |
|---|
| 110 | | while ( ($theme_file = $stylish_dir->read()) !== false ) { |
|---|
| 111 | | if ( $theme_file == 'style.css' ) { |
|---|
| 112 | | $theme_files[] = $theme_dir . '/' . $theme_file; |
|---|
| 113 | | $found_stylesheet = true; |
|---|
| 114 | | break; |
|---|
| | 103 | if ( !$themes_dir ) |
|---|
| | 104 | return false; |
|---|
| | 105 | |
|---|
| | 106 | while ( ($theme_dir = $themes_dir->read()) !== false ) { |
|---|
| | 107 | if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) { |
|---|
| | 108 | if ( $theme_dir{0} == '.' || $theme_dir == '..' || $theme_dir == 'CVS' ) |
|---|
| | 109 | continue; |
|---|
| | 110 | $stylish_dir = @ dir($theme_root . '/' . $theme_dir); |
|---|
| | 111 | $found_stylesheet = false; |
|---|
| | 112 | while ( ($theme_file = $stylish_dir->read()) !== false ) { |
|---|
| | 113 | if ( $theme_file == 'style.css' ) { |
|---|
| | 114 | $theme_files[] = $theme_dir . '/' . $theme_file; |
|---|
| | 115 | $found_stylesheet = true; |
|---|
| | 116 | break; |
|---|
| | 117 | } |
|---|
| | 118 | } |
|---|
| | 119 | if ( !$found_stylesheet ) { // look for themes in that dir |
|---|
| | 120 | $subdir = "$theme_root/$theme_dir"; |
|---|
| | 121 | $subdir_name = $theme_dir; |
|---|
| | 122 | $theme_subdir = @dir( $subdir ); |
|---|
| | 123 | while ( ($theme_dir = $theme_subdir->read()) !== false ) { |
|---|
| | 124 | if ( is_dir( $subdir . '/' . $theme_dir) && is_readable($subdir . '/' . $theme_dir) ) { |
|---|
| | 125 | if ( $theme_dir{0} == '.' || $theme_dir == '..' || $theme_dir == 'CVS' ) |
|---|
| | 126 | continue; |
|---|
| | 127 | $stylish_dir = @ dir($subdir . '/' . $theme_dir); |
|---|
| | 128 | $found_stylesheet = false; |
|---|
| | 129 | while ( ($theme_file = $stylish_dir->read()) !== false ) { |
|---|
| | 130 | if ( $theme_file == 'style.css' ) { |
|---|
| | 131 | $theme_files[] = $subdir_name . '/' . $theme_dir . '/' . $theme_file; |
|---|
| | 132 | $found_stylesheet = true; |
|---|
| | 133 | break; |
|---|
| | 134 | } |
|---|
| | 135 | } |
|---|