public function save(HTTPRequestCustom $request)
 {
     $installed_themes = ThemesManager::get_installed_themes_map();
     foreach ($installed_themes as $theme) {
         if ($request->get_string('delete-' . $theme->get_id(), '')) {
             AppContext::get_response()->redirect(AdminThemeUrlBuilder::delete_theme($theme->get_id()));
         }
     }
     if ($request->get_bool('update', false)) {
         foreach ($installed_themes as $theme) {
             if ($theme->get_id() !== ThemesManager::get_default_theme()) {
                 $id_theme = $theme->get_id();
                 $activated = $request->get_bool('activated-' . $id_theme, false);
                 $authorizations = Authorizations::auth_array_simple(Theme::ACCES_THEME, $id_theme);
                 ThemesManager::change_informations($id_theme, $activated, $authorizations);
             }
         }
         AppContext::get_response()->redirect(AdminThemeUrlBuilder::list_installed_theme());
     }
 }
 public function update_themes()
 {
     $active_themes_number = 0;
     foreach (ThemesManager::get_installed_themes_map() as $id => $theme) {
         if ($theme->get_configuration()->get_compatibility() == self::NEW_KERNEL_VERSION) {
             $active_themes_number++;
         } else {
             ThemesManager::uninstall($id);
             $this->add_information_to_file('theme ' . $id, 'has been uninstalled because : incompatible with new version');
         }
     }
     if (empty($active_themes_number)) {
         ThemesManager::install('base');
         $user_accounts_config = UserAccountsConfig::load();
         $user_accounts_config->set_default_theme('base');
         UserAccountsConfig::save();
     }
 }