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_version' => 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)); // Load include 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_version'][] = $GLOBALS['theme_data']['version']; } // END - while // Sort array by Uni* name array_pk_sort($themes, array('theme_name')); // Generate output lines for the template $OUT = ''; foreach ($themes['theme_unix'] as $key => $unix) { // Already installed is default $formContent = '
{%message,ADMIN_THEME_ALREADY_INSTALLED=' . $unix . '%}
'; // Check if current theme is already imported or not if (!ifThemeExists($unix)) { // Theme not installed $formContent = loadTemplate('admin_import_theme_form', true, $unix); } // END - if // Prepare content $content = array( 'unix' => $unix, 'theme_name' => $themes['theme_name'][$key], 'theme_email' => $themes['theme_email'][$key], 'theme_author' => $themes['theme_author'][$key], 'theme_url' => $themes['theme_url'][$key], 'theme_version' => $themes['theme_version'][$key], 'form_content' => $formContent ); // Add row template $OUT .= loadTemplate('admin_import_theme_row', true, $content); } // END - foreach if (empty($OUT)) { // No themes found??? $OUT .= loadTemplate('admin_import_theme_none', true, displayMessage('{--ADMIN_NO_THEMES_FOUND--}', true)); } // END - if // Load template loadTemplate('admin_import_theme', false, $OUT); // [EOF] ?>