function execute($request)
{
parent::execute();
$siteDao = DAORegistry::getDAO('SiteDAO');
$site = $siteDao->getSite();
$site->setRedirect($this->getData('redirect'));
$site->setMinPasswordLength($this->getData('minPasswordLength'));
// Clear the template cache if theme has changed
if ($this->getData('themePluginPath') != $site->getSetting('themePluginPath')) {
$templateMgr = TemplateManager::getManager($request);
$templateMgr->clearTemplateCache();
$templateMgr->clearCssCache();
}
$siteSettingsDao = $this->siteSettingsDao;
foreach ($this->getLocaleFieldNames() as $setting) {
$siteSettingsDao->updateSetting($setting, $this->getData($setting), null, true);
}
$setting = $site->getSetting('pageHeaderTitleImage');
if (!empty($setting)) {
$imageAltText = $this->getData('pageHeaderTitleImageAltText');
$locale = $this->getFormLocale();
$setting[$locale]['altText'] = $imageAltText[$locale];
$site->updateSetting('pageHeaderTitleImage', $setting, 'object', true);
}
$site->updateSetting('showThumbnail', $this->getData('showThumbnail'), 'bool');
$site->updateSetting('showTitle', $this->getData('showTitle'), 'bool');
$site->updateSetting('showDescription', $this->getData('showDescription'), 'bool');
$siteDao->updateObject($site);
return true;
}