pages/manager/ManagerProgramHandler.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00015 //$Id$
00016 
00017 import('pages.manager.ManagerHandler');
00018 
00019 class ManagerProgramHandler extends ManagerHandler {
00023    function ManagerProgramHandler() {
00024       parent::ManagerHandler();
00025    }
00026 
00030    function program() {
00031       $this->validate();
00032       $this->setupTemplate(true);
00033 
00034       $schedConf =& Request::getSchedConf();
00035       if (!$schedConf) Request::redirect (null, null, 'index');
00036 
00037       import('manager.form.ProgramSettingsForm');
00038 
00039       $settingsForm = new ProgramSettingsForm();
00040       if ($settingsForm->isLocaleResubmit()) {
00041          $settingsForm->readInputData();
00042       } else {
00043          $settingsForm->initData();
00044       };
00045       $settingsForm->display();
00046    }
00047 
00051    function saveProgramSettings() {
00052       $this->validate();
00053       $this->setupTemplate(true);
00054 
00055       $schedConf =& Request::getSchedConf();
00056       if (!$schedConf) Request::redirect (null, null, 'index');
00057 
00058       import('manager.form.ProgramSettingsForm');
00059 
00060       $settingsForm = new ProgramSettingsForm();
00061       $settingsForm->readInputData();
00062       $formLocale = $settingsForm->getFormLocale();
00063       $programTitle = Request::getUserVar('programFileTitle');
00064 
00065       $editData = false;
00066 
00067       if (Request::getUserVar('uploadProgramFile')) {
00068          if (!$settingsForm->uploadProgram('programFile', $formLocale)) {
00069             $settingsForm->addError('programFile', __('common.uploadFailed'));
00070          }
00071          $editData = true;
00072       } elseif (Request::getUserVar('deleteProgramFile')) {
00073          $settingsForm->deleteProgram('programFile', $formLocale);
00074          $editData = true;
00075       }
00076 
00077       if (!$editData && $settingsForm->validate()) {
00078          $settingsForm->execute();
00079 
00080          $templateMgr =& TemplateManager::getManager();
00081          $templateMgr->assign(array(
00082             'currentUrl' => Request::url(null, null, null, 'program'),
00083             'pageTitle' => 'schedConf.program',
00084             'message' => 'common.changesSaved',
00085             'backLink' => Request::url(null, null, Request::getRequestedPage()),
00086             'backLinkLabel' => 'manager.conferenceSiteManagement'
00087          ));
00088          $templateMgr->display('common/message.tpl');
00089 
00090       } else {
00091          $settingsForm->display();
00092       }
00093    }
00094 
00095 }
00096 ?>

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