feature 1514: improvement, impossible to delete a theme that is required

by another installed theme.

git-svn-id: http://piwigo.org/svn/trunk@5258 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall
2010-03-22 14:11:10 +00:00
parent cf9af7d062
commit 15499d5dc1
4 changed files with 62 additions and 5 deletions
+17 -1
View File
@@ -68,7 +68,7 @@ foreach ($db_themes as $db_theme)
$active_themes = array();
$inactive_themes = array();
foreach($themes->fs_themes as $theme_id => $fs_theme)
foreach ($themes->fs_themes as $theme_id => $fs_theme)
{
if ($theme_id == 'default')
{
@@ -89,6 +89,22 @@ foreach($themes->fs_themes as $theme_id => $fs_theme)
}
else
{
$children = $themes->get_children_themes($theme_id);
if (count($children) > 0)
{
$fs_theme['deletable'] = false;
$fs_theme['delete_tooltip'] = sprintf(
l10n('Impossible to delete this theme. Other themes depends on it: %s'),
implode(', ', $children)
);
}
else
{
$fs_theme['deletable'] = true;
}
array_push($inactive_themes, $fs_theme);
}
}