$tpl_theme['DEACTIVATE_TOOLTIP'] = l10n('Impossible to deactivate this theme, you need at least one theme.');
        }
        if ($tpl_theme['IS_DEFAULT']) {
            $tpl_theme['DEACTIVABLE'] = false;
            $tpl_theme['DEACTIVATE_TOOLTIP'] = l10n('Impossible to deactivate the default theme.');
        }
    } else {
        $tpl_theme['STATE'] = 'inactive';
        // is the theme "activable" ?
        if (isset($fs_theme['activable']) and !$fs_theme['activable']) {
            $tpl_theme['ACTIVABLE'] = false;
            $tpl_theme['ACTIVABLE_TOOLTIP'] = l10n('This theme was not designed to be directly activated');
        } else {
            $tpl_theme['ACTIVABLE'] = true;
        }
        $missing_parent = $themes->missing_parent_theme($theme_id);
        if (isset($missing_parent)) {
            $tpl_theme['ACTIVABLE'] = false;
            $tpl_theme['ACTIVABLE_TOOLTIP'] = 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);
        $tpl_theme['DELETABLE'] = true;
        if (count($children) > 0) {
            $tpl_theme['DELETABLE'] = false;
            $tpl_theme['DELETE_TOOLTIP'] = l10n('Impossible to delete this theme. Other themes depends on it: %s', implode(', ', $children));
        }
    }
    $tpl_themes[] = $tpl_theme;
}
// sort themes by state then by name