function FBVTemplateManager() { parent::TemplateManager(); $this->caching = 0; // look for templates in the test directory $baseDir = Core::getBaseDir(); $test_template_dir = $baseDir . DIRECTORY_SEPARATOR . PKP_LIB_PATH . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'ui' . DIRECTORY_SEPARATOR . 'fbv'; $this->template_dir[] = $test_template_dir; // $baseUrl has to be reset to properly reference the javascript files and stylesheets $baseUrl = ''; $uriComponents = explode('/', $_SERVER['REQUEST_URI']); for ($i = 0, $count = count($uriComponents); $i < $count; $i++) { if ($uriComponents[$i] == 'tools' && $uriComponents[$i + 1] == 'fbvVisualResults.php') { break; } else { if (empty($uriComponents[$i])) { continue; } else { $baseUrl .= '/' . $uriComponents[$i]; } } } $this->assign('baseUrl', $baseUrl); }