__construct() public method

Initialize template engine and assign basic template variables.
public __construct ( $request )
$request PKPRequest
Beispiel #1
0
 function __construct()
 {
     parent::__construct();
     $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);
 }