pages/manager/ConferenceLanguagesHandler.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00015 //$Id$
00016 
00017 import('pages.manager.ManagerHandler');
00018 
00019 class ConferenceLanguagesHandler extends ManagerHandler {
00023    function ConferenceLanguagesHandler() {
00024       parent::ManagerHandler();
00025    }
00026 
00030    function languages() {
00031       $this->validate();
00032       $this->setupTemplate(true);
00033 
00034       import('manager.form.LanguageSettingsForm');
00035 
00036       $settingsForm = new LanguageSettingsForm();
00037       $settingsForm->initData();
00038       $settingsForm->display();
00039    }
00040 
00046    function saveLanguageSettings($args, &$request) {
00047       $this->validate();
00048       $this->setupTemplate(true);
00049 
00050       import('manager.form.LanguageSettingsForm');
00051 
00052       $settingsForm = new LanguageSettingsForm();
00053       $settingsForm->readInputData();
00054 
00055       if ($settingsForm->validate()) {
00056          $settingsForm->execute();
00057          import('notification.NotificationManager');
00058          $notificationManager = new NotificationManager();
00059          $notificationManager->createTrivialNotification('notification.notification', 'common.changesSaved');
00060          $request->redirect(null, null, null, 'index');
00061       } else {
00062          $settingsForm->display();
00063       }
00064    }
00065 
00071    function reloadLocalizedDefaultSettings($args, &$request) {
00072       // make sure the locale is valid
00073       $locale = $request->getUserVar('localeToLoad');
00074       if ( !AppLocale::isLocaleValid($locale) ) {
00075          $request->redirect(null, null, null, 'languages');
00076       }
00077 
00078       $this->validate();
00079       $this->setupTemplate(true);
00080                
00081       $conference =& $request->getConference();
00082       $conferenceSettingsDao =& DAORegistry::getDAO('ConferenceSettingsDAO');
00083       $conferenceSettingsDao->reloadLocalizedDefaultSettings(
00084          $conference->getId(), 'registry/conferenceSettings.xml',
00085          array(
00086             'indexUrl' => $request->getIndexUrl(),
00087             'conferencePath' => $conference->getData('path'),
00088             'primaryLocale' => $conference->getPrimaryLocale(),
00089             'conferenceName' => $conference->getTitle($conference->getPrimaryLocale())
00090          ),
00091          $locale
00092       );
00093 
00094       $templateMgr =& TemplateManager::getManager();
00095       $templateMgr->assign(array(
00096          'currentUrl' => $request->url(null, null, null, 'languages'),
00097          'pageTitle' => 'common.languages',
00098          'message' => 'common.changesSaved',
00099          'backLink' => $request->url(null, null, $request->getRequestedPage()),
00100          'backLinkLabel' => 'manager.conferenceSiteManagement'
00101       ));
00102       $templateMgr->display('common/message.tpl');
00103    }
00104 
00105 }
00106 
00107 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7