-$handle = opendir(PATH."theme/") or mxchange_die("Cannot read themes dir!");
-while ($entry = readdir($handle)) {
- // Construct absolute theme.php file name
- $INC = sprintf("theme/%s/theme.php", $entry);
+$includes = getArrayFromDirectory('theme/', '', false, true, array('css', 'images'));
+
+// Walk through all entries and add it
+foreach ($includes as $inc) {
+ // Get directory from it
+ $dir = basename(dirname($inc));