aboutsummaryrefslogtreecommitdiffstats
path: root/admin/themes
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/themes/default/template/themes_installed.tpl8
-rw-r--r--admin/themes_installed.php21
2 files changed, 25 insertions, 4 deletions
diff --git a/admin/themes/default/template/themes_installed.tpl b/admin/themes/default/template/themes_installed.tpl
index 0a5a0cc85..4b050c51c 100644
--- a/admin/themes/default/template/themes_installed.tpl
+++ b/admin/themes/default/template/themes_installed.tpl
@@ -33,13 +33,21 @@
<div class="themeName">{$theme.name}</div>
<div class="themeShot"><img src="{$theme.screenshot}"></div>
<div class="themeActions">
+
+ {if $theme.activable}
<a href="{$activate_baseurl}{$theme.id}" title="{'Make this theme available to users'|@translate}">{'Activate'|@translate}</a>
+ {else}
+ <span title="{$theme.activate_tooltip}">{'Activate'|@translate}</span>
+ {/if}
+
|
+
{if $theme.deletable}
<a href="{$delete_baseurl}{$theme.id}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');" title="{'Delete this theme'|@translate}">{'Delete'|@translate}</a>
{else}
<span title="{$theme.delete_tooltip}">{'Delete'|@translate}</span>
{/if}
+
</div>
</div>
diff --git a/admin/themes_installed.php b/admin/themes_installed.php
index 82efe569a..dda2ab6ed 100644
--- a/admin/themes_installed.php
+++ b/admin/themes_installed.php
@@ -89,7 +89,24 @@ foreach ($themes->fs_themes as $theme_id => $fs_theme)
}
else
{
+ // is the theme "activable" ?
+ $fs_theme['activable'] = true;
+
+ $missing_parent = $themes->missing_parent_theme($theme_id);
+ if (isset($missing_parent))
+ {
+ $fs_theme['activable'] = false;
+
+ $fs_theme['activate_tooltip'] = sprintf(
+ l10n('Impossible to activate this theme, the parent theme is missing: %s'),
+ $missing_parent
+ );
+ }
+
+ // is the theme "deletable" ?
$children = $themes->get_children_themes($theme_id);
+
+ $fs_theme['deletable'] = true;
if (count($children) > 0)
{
@@ -100,10 +117,6 @@ foreach ($themes->fs_themes as $theme_id => $fs_theme)
implode(', ', $children)
);
}
- else
- {
- $fs_theme['deletable'] = true;
- }
array_push($inactive_themes, $fs_theme);
}