pages/rtadmin/RTSetupHandler.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00015 //$Id$
00016 
00017 import('rt.ocs.ConferenceRTAdmin');
00018 import('pages.rtadmin.RTAdminHandler');
00019 
00020 class RTSetupHandler extends RTAdminHandler {
00024    function RTSetupHandler() {
00025       parent::RTAdminHandler();
00026    }
00027 
00028    function settings() {
00029       $this->validate();
00030 
00031       $conference = Request::getConference();
00032 
00033       if ($conference) {
00034          $this->setupTemplate(true);
00035          $templateMgr =& TemplateManager::getManager();
00036 
00037          $rtDao =& DAORegistry::getDAO('RTDAO');
00038          $rt = $rtDao->getConferenceRTByConference($conference);
00039 
00040          $versionOptions = array();
00041          $versions = $rtDao->getVersions($conference->getId());
00042          foreach ($versions->toArray() as $version) {
00043             $versionOptions[$version->getVersionId()] = $version->getTitle();
00044          }
00045 
00046          $templateMgr->assign('versionOptions', $versionOptions);
00047          $templateMgr->assign_by_ref('version', $rt->getVersion());
00048          $templateMgr->assign('enabled', $rt->getEnabled());
00049          $templateMgr->assign('abstract', $rt->getAbstract());
00050          $templateMgr->assign('captureCite', $rt->getCaptureCite());
00051          $templateMgr->assign('viewMetadata', $rt->getViewMetadata());
00052          $templateMgr->assign('supplementaryFiles', $rt->getSupplementaryFiles());
00053          $templateMgr->assign('printerFriendly', $rt->getPrinterFriendly());
00054          $templateMgr->assign('authorBio', $rt->getAuthorBio());
00055          $templateMgr->assign('defineTerms', $rt->getDefineTerms());
00056          $templateMgr->assign('addComment', $rt->getAddComment());
00057          $templateMgr->assign('emailAuthor', $rt->getEmailAuthor());
00058          $templateMgr->assign('emailOthers', $rt->getEmailOthers());
00059          $templateMgr->assign('findingReferences', $rt->getFindingReferences());
00060 
00061          $templateMgr->assign('helpTopicId', 'conference.generalManagement.readingTools.settings');
00062          $templateMgr->display('rtadmin/settings.tpl');
00063       } else {
00064          Request::redirect(null, null, Request::getRequestedPage());
00065       }
00066    }
00067 
00068    function saveSettings() {
00069       $this->validate();
00070 
00071       $conference = Request::getConference();
00072 
00073       if ($conference) {
00074          $rtDao =& DAORegistry::getDAO('RTDAO');
00075          $rt = $rtDao->getConferenceRTByConference($conference);
00076 
00077          if (Request::getUserVar('version')=='') $rt->setVersion(null);
00078          else $rt->setVersion(Request::getUserVar('version'));
00079          $rt->setEnabled(Request::getUserVar('enabled')==true);
00080          $rt->setAbstract(Request::getUserVar('abstract')==true);
00081          $rt->setCaptureCite(Request::getUserVar('captureCite')==true);
00082          $rt->setViewMetadata(Request::getUserVar('viewMetadata')==true);
00083          $rt->setSupplementaryFiles(Request::getUserVar('supplementaryFiles')==true);
00084          $rt->setPrinterFriendly(Request::getUserVar('printerFriendly')==true);
00085          $rt->setAuthorBio(Request::getUserVar('authorBio')==true);
00086          $rt->setDefineTerms(Request::getUserVar('defineTerms')==true);
00087          $rt->setAddComment(Request::getUserVar('addComment')==true);
00088          $rt->setEmailAuthor(Request::getUserVar('emailAuthor')==true);
00089          $rt->setEmailOthers(Request::getUserVar('emailOthers')==true);
00090          $rt->setFindingReferences(Request::getUserVar('findingReferences')==true);
00091 
00092          $rtDao->updateConferenceRT($rt);
00093       }
00094       Request::redirect(null, null, Request::getRequestedPage());
00095    }
00096 }
00097 
00098 ?>

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