getRequest(); $resp = $app->getResponse(); // TODO: move this into a library so $_, $g_ui_locale_id and $g_ui_locale gets set up automatically $va_ui_locales = $req->config->getList('ui_locales'); if ($vs_lang = $req->getParameter('lang', pString)) { if (in_array($vs_lang, $va_ui_locales)) { $req->session->setVar('lang', $vs_lang); } } if (!($g_ui_locale = $req->session->getVar('lang'))) { $g_ui_locale = $va_ui_locales[0]; } if (!in_array($g_ui_locale, $va_ui_locales)) { $g_ui_locale = $va_ui_locales[0]; } $t_locale = new ca_locales(); $g_ui_locale_id = $t_locale->localeCodeToID($g_ui_locale); // get current UI locale as locale_id (available as global) $_ = array(); if (file_exists($vs_theme_specific_locale_path = $req->getThemeDirectoryPath().'/locale/'.$g_ui_locale.'/messages.mo')) { $_[] = new Zend_Translate('gettext', $vs_theme_specific_locale_path, $g_ui_locale); } $_[] = new Zend_Translate('gettext', __CA_APP_DIR__.'/locale/'.$g_ui_locale.'/messages.mo', $g_ui_locale); // // PageFormat plug-in generates header/footer shell around page content // if (!$req->isAjax() && !$req->isDownload()) { require_once(__CA_LIB_DIR__.'/ca/PageFormat.php'); $app->registerPlugin(new PageFormat()); } else { require_once(__CA_LIB_DIR__.'/ca/AjaxFooter.php'); $app->registerPlugin(new AjaxFooter()); } // // ContentCaching plug-in caches output of selected pages for performance // require_once(__CA_LIB_DIR__.'/ca/ContentCaching.php'); $app->registerPlugin(new ContentCaching()); // Prevent caching $resp->addHeader("Cache-Control", "no-cache, must-revalidate"); $resp->addHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT"); // // Dispatch the request // $app->dispatch(true); // // Send output to client // $resp->sendResponse(); // Note url of this page as "last page" if (($req->getController() != 'LoginReg') && (!$req->isAjax())) { $req->session->setVar('pawtucket2_last_page', $req->getFullUrlPath()); } $req->close(); ?>