Skip to content

Commit

Permalink
bug 3075: Prevent deactivate default theme
Browse files Browse the repository at this point in the history
git-svn-id: http://piwigo.org/svn/trunk@28989 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
mistic100 committed Jul 7, 2014
1 parent be610d6 commit f2c16c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions admin/themes_installed.php
Expand Up @@ -91,15 +91,19 @@
if (in_array($theme_id, $db_theme_ids))
{
$tpl_theme['STATE'] = 'active';
$tpl_theme['IS_DEFAULT'] = ($theme_id == $default_theme);
$tpl_theme['DEACTIVABLE'] = true;

if (count($db_theme_ids) <= 1)
{
$tpl_theme['DEACTIVABLE'] = false;
$tpl_theme['DEACTIVATE_TOOLTIP'] = l10n('Impossible to deactivate this theme, you need at least one theme.');
}

$tpl_theme['IS_DEFAULT'] = ($theme_id == $default_theme);
if ($tpl_theme['IS_DEFAULT'])
{
$tpl_theme['DEACTIVABLE'] = false;
$tpl_theme['DEACTIVATE_TOOLTIP'] = l10n('Impossible to deactivate the default theme.');
}
}
else
{
Expand Down
1 change: 1 addition & 0 deletions language/en_UK/admin.lang.php
Expand Up @@ -414,6 +414,7 @@
$lang['Images manual order was saved'] = "Images manual order saved";
$lang['Impossible automatic correction'] = "Automatic correction impossible";
$lang['Impossible to activate this theme, the parent theme is missing: %s'] = 'This theme could not be activated, as the parent theme is missing: %s';
$lang['Impossible to deactivate the default theme.'] = 'Impossible to deactivate the default theme.';
$lang['Impossible to deactivate this language, first set another language as default.'] = 'Impossible to deactivate this language, first set another language as default.';
$lang['Impossible to deactivate this language, you need at least one language.'] = 'Impossible to deactivate this language, you need at least one language.';
$lang['Impossible to deactivate this theme, you need at least one theme.'] = 'Impossible to deactivate this theme, you need at least one theme.';
Expand Down
1 change: 1 addition & 0 deletions language/fr_FR/admin.lang.php
Expand Up @@ -975,4 +975,5 @@
$lang['close'] = 'fermer';
$lang['Activate it now'] = 'Activate it now';
$lang['Allow users to add a link to their website'] = 'Autoriser les utilisateurs à donner un lien vers leur site web';
$lang['Impossible to deactivate the default theme.'] = 'Impossible de désactiver le thème par défaut.';
?>

0 comments on commit f2c16c2

Please sign in to comment.