00001 <?php
00002
00016 import('handler.Handler');
00017
00018 class StaticPagesHandler extends Handler {
00019 function index( $args ) {
00020 Request::redirect(null, null, null, 'view', Request::getRequestedOp());
00021 }
00022
00023 function view ($args) {
00024 if (count($args) > 0 ) {
00025 AppLocale::requireComponents(array(LOCALE_COMPONENT_PKP_COMMON, LOCALE_COMPONENT_APPLICATION_COMMON));
00026 $conference =& Request::getConference();
00027 $conferenceId = $conference->getId();
00028 $path = $args[0];
00029
00030 $staticPagesPlugin =& PluginRegistry::getPlugin('generic', 'StaticPagesPlugin');
00031 $templateMgr =& TemplateManager::getManager();
00032
00033 $staticPagesDAO =& DAORegistry::getDAO('StaticPagesDAO');
00034 $staticPage = $staticPagesDAO->getStaticPageByPath($conferenceId, $path);
00035
00036 if ( !$staticPage ) {
00037 Request::redirect(null, null, 'index');
00038 }
00039
00040
00041 $templateMgr->assign('title', $staticPage->getStaticPageTitle());
00042 $templateMgr->assign('content', $staticPage->getStaticPageContent());
00043 $templateMgr->display($staticPagesPlugin->getTemplatePath().'content.tpl');
00044 }
00045 }
00046 }
00047
00048 ?>