PKPSiteSettingsForm::execute PHP Method

execute() public method

Save site settings.
public execute ( $request )
    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;
    }

Usage Example

Esempio n. 1
0
 /**
  * Save the from parameters.
  */
 function execute()
 {
     parent::execute();
     $siteSettingsDao =& $this->siteSettingsDao;
     $siteSettingsDao->updateSetting('useAlphalist', (bool) $this->getData('useAlphalist'), 'bool');
     $siteSettingsDao->updateSetting('usePaging', (bool) $this->getData('usePaging'), 'bool');
 }
All Usage Examples Of PKPSiteSettingsForm::execute