Currently this can be implemented via some ugly coding which is as follows.
1. In ManageThemes.controller.php, find:
// Look for a non existent theme directory. (ie theme87.)
$theme_dir = BOARDDIR . '/themes/theme';
$i = 1;
while (file_exists($theme_dir . $i))
$i++;
$context['new_theme_name'] = 'theme' . $i;
Replace them with:
$context['new_theme_name'] = '';
$context['new_light_variant'] = '';
$context['new_besocial_variant'] = '';
2. In the same file, find:
// Install from another directory
Replace them with:
// Copy the default light variant?
elseif (!empty($_REQUEST['copylight'] or $_REQUEST['copybesocial']) && $method == 'copy')
{
// Hopefully the css directory is writable, or we might have a problem.
DEFINE('CSSDIR', BOARDDIR . '/themes/default/css');
if (!is_writable(CSSDIR))
fatal_lang_error('theme_install_write_error', 'critical');
// Make the new directory, standard characters only
if (!empty($_REQUEST['copylight']))
$theme_dir = CSSDIR . '/_' . preg_replace('~[^A-Za-z0-9_\- ]~', '', $_REQUEST['copylight']);
elseif (!empty($_REQUEST['copybesocial']))
$theme_dir = CSSDIR . '/_' . preg_replace('~[^A-Za-z0-9_\- ]~', '', $_REQUEST['copybesocial']);
umask(0);
mkdir($theme_dir, 0777);
// Get some more time if we can
@set_time_limit(600);
if (function_exists('apache_reset_timeout'))
@apache_reset_timeout();
// And now the entire css, images and webfonts directories!
if (!empty($_REQUEST['copylight']))
copytree($settings['default_theme_dir'] . '/css/_light', $theme_dir);
elseif (!empty($_REQUEST['copybesocial']))
copytree($settings['default_theme_dir'] . '/css/_besocial', $theme_dir);
package_flush_cache();
}
// Install from another directory
3. Still in the same file, find:
// Defaults.
$install_info = array(
'theme_url' => $boardurl . '/themes/' . basename($theme_dir),
'images_url' => isset($images_url) ? $images_url : $boardurl . '/themes/' . basename($theme_dir) . '/images',
'theme_dir' => $theme_dir,
'name' => $theme_name
);
Replace them with:
if (!empty($_REQUEST['copylight'] or $_REQUEST['copybesocial'])) {
$install_info = array();
} else {
// Defaults.
$install_info = array(
'theme_url' => $boardurl . '/themes/' . basename($theme_dir),
'images_url' => isset($images_url) ? $images_url : $boardurl . '/themes/' . basename($theme_dir) . '/images',
'theme_dir' => $theme_dir,
'name' => $theme_name
);
}
4. Now open its template file, ManageThemes.template.php, find:
echo '
</dl>
<input type="submit" name="save" value="', $txt['theme_install_go'], '" class="right_submit" />
Replace them with:
if ($context['can_create_new'])
echo '
<dt>
<label for="copy">Copy default theme light variant</label>
</dt>
<dd>
<input type="text" name="copylight" id="copylight" value="', $context['new_light_variant'], '" size="40" class="input_text" />
</dd>';
if ($context['can_create_new'])
echo '
<dt>
<label for="copy">Copy default theme besocial variant</label>
</dt>
<dd>
<input type="text" name="copybesocial" id="copybesocial" value="', $context['new_besocial_variant'], '" size="40" class="input_text" />
</dd>';
echo '
</dl>
<input type="submit" name="save" value="', $txt['theme_install_go'], '" class="right_submit" />
5. In the same file, find:
<a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a> ', $txt['theme_installed_message'], '
Replace them with:
<a href="', $scripturl, '?action=admin;area=theme;sa=list;th=', $context['installed_theme']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['installed_theme']['name'], '</a>
', empty($context['installed_theme']['name']) ? 'A new variant was installed to default theme.' : $txt['theme_installed_message'], '
I tested them in 1.0.9 with no errors, so far but will need to add some $txt to language files, for localisation. Expert opinion is needed though, for feedback, security, improvement, etc.