array(), // Unix name from filesystem 'theme_name' => array(), // Title 'theme_author' => array(), // Theme author's name 'theme_email' => array(), // Author's email address 'theme_url' => array(), // URL were you can download it from 'theme_ver' => array(), // Version number of theme ); // Read directory "themes" $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)); // Is the theme active, then include it if (isThemeActive($dir)) { // Found a valid directory so let's load it's theme.php file loadInclude($INC); // Add found theme to array $THEMES['theme_unix'][] = $dir; $THEMES['theme_name'][] = $GLOBALS['theme_data']['name']; $THEMES['theme_author'][] = $GLOBALS['theme_data']['author']; $THEMES['theme_email'][] = $GLOBALS['theme_data']['email']; $THEMES['theme_url'][] = $GLOBALS['theme_data']['url']; $THEMES['theme_ver'][] = $GLOBALS['theme_data']['version']; } // END - if } // END - while // Remove last theme data unset($GLOBALS['theme_data']); // Sort array by Uni* name array_pk_sort($THEMES, array('theme_name')); // Generate output lines for the template $OUT = ''; $SW = 2; foreach ($THEMES['theme_unix'] as $key => $unix) { $default = ''; if (getSession('mxchange_theme') == $unix) $default = ' selected="selected"'; // Add row $OUT .= " ".$THEMES['theme_name'][$key]." ".$THEMES['theme_author'][$key]." ".$THEMES['theme_url'][$key]." v".$THEMES['theme_ver'][$key]." \n"; $SW = 3 - $SW; } // END - foreach if (empty($OUT)) { // No themes found??? $OUT = " ".LOAD_TEMPLATE('admin_settings_saved', true, getMessage('MEMBER_NO_THEMES_FOUND'))." \n"; } // END - if define('__THEME_LIST', $OUT); // Load template LOAD_TEMPLATE("member_themes"); // ?>