/**
  * Validate and save changes to site settings.
  * @param $args array
  * @param $request object
  */
 function saveSettings($args, &$request)
 {
     $this->validate();
     $this->setupTemplate(true);
     import('admin.form.SiteSettingsForm');
     $settingsForm = new SiteSettingsForm();
     $settingsForm->readInputData();
     $editData = false;
     if ($request->getUserVar('uploadStyleSheet')) {
         if ($settingsForm->uploadStyleSheet('styleSheet')) {
             $editData = true;
         } else {
             $settingsForm->addError('styleSheet', Locale::translate('admin.settings.styleSheet.invalid'));
         }
     } elseif ($request->getUserVar('deleteStyleSheet')) {
         $editData = true;
         $settingsForm->deleteImage('styleSheet');
     } elseif ($request->getUserVar('uploadCustomLogo')) {
         if ($settingsForm->uploadImage('customLogo')) {
             $editData = true;
         } else {
             $settingsForm->addError('customLogo', Locale::translate('admin.settings.customLogo.invalid'));
         }
     } elseif ($request->getUserVar('deleteCustomLogo')) {
         $editData = true;
         $settingsForm->deleteImage('customLogo');
     }
     if (!$editData && $settingsForm->validate()) {
         $settingsForm->execute();
         import('notification.NotificationManager');
         $notificationManager = new NotificationManager();
         $notificationManager->createTrivialNotification('notification.notification', 'common.changesSaved');
         $request->redirect(null, 'index');
     }
     $settingsForm->display();
 }
 /**
  * Validate and save changes to site settings.
  */
 function saveSettings()
 {
     $this->validate();
     $this->setupTemplate(true);
     import('admin.form.SiteSettingsForm');
     $settingsForm = new SiteSettingsForm();
     $settingsForm->readInputData();
     $editData = false;
     if (Request::getUserVar('uploadStyleSheet')) {
         if ($settingsForm->uploadStyleSheet('styleSheet')) {
             $editData = true;
         } else {
             $settingsForm->addError('styleSheet', Locale::translate('admin.settings.styleSheet.invalid'));
         }
     } elseif (Request::getUserVar('deleteStyleSheet')) {
         $editData = true;
         $settingsForm->deleteImage('styleSheet');
     } elseif (Request::getUserVar('uploadCustomLogo')) {
         if ($settingsForm->uploadImage('customLogo')) {
             $editData = true;
         } else {
             $settingsForm->addError('customLogo', Locale::translate('admin.settings.customLogo.invalid'));
         }
     } elseif (Request::getUserVar('deleteCustomLogo')) {
         $editData = true;
         $settingsForm->deleteImage('customLogo');
     }
     if (!$editData && $settingsForm->validate()) {
         $settingsForm->execute();
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign(array('currentUrl' => 'admin/settings', 'pageTitle' => 'admin.siteSettings', 'message' => 'common.changesSaved', 'backLink' => Request::url('admin'), 'backLinkLabel' => 'admin.siteAdmin'));
         $templateMgr->display('common/message.tpl');
     } else {
         $settingsForm->display();
     }
 }