validate(); $this->setupTemplate(true); import('classes.manager.form.LanguageSettingsForm'); $settingsForm = new LanguageSettingsForm(); $settingsForm->initData(); $settingsForm->display(); } /** * Save changes to language settings. * @param $args array * @param $request object */ function saveLanguageSettings($args, &$request) { $this->validate(); $this->setupTemplate(true); import('classes.manager.form.LanguageSettingsForm'); $settingsForm = new LanguageSettingsForm(); $settingsForm->readInputData(); if ($settingsForm->validate()) { $settingsForm->execute(); $user =& $request->getUser(); import('classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); $notificationManager->createTrivialNotification($user->getId()); $request->redirect(null, null, 'index'); } else { $settingsForm->display(); } } /** * Reload the default localized settings for the journal. * @param $args array * @param $request object */ function reloadLocalizedDefaultSettings($args, &$request) { // make sure the locale is valid $locale = $request->getUserVar('localeToLoad'); if ( !AppLocale::isLocaleValid($locale) ) { $request->redirect(null, null, 'languages'); } $this->validate(); $this->setupTemplate(true); $journal =& $request->getJournal(); $journalSettingsDao =& DAORegistry::getDAO('JournalSettingsDAO'); $journalSettingsDao->reloadLocalizedDefaultSettings( $journal->getId(), 'registry/journalSettings.xml', array( 'indexUrl' => $request->getIndexUrl(), 'journalPath' => $journal->getData('path'), 'primaryLocale' => $journal->getPrimaryLocale(), 'journalName' => $journal->getTitle($journal->getPrimaryLocale()) ), $locale ); $user =& $request->getUser(); // Display a notification import('classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); $notificationManager->createTrivialNotification($user->getId()); $request->redirect(null, null, 'languages'); } } ?>