Add basic tests of the platal engine.
[platal.git] / classes / plpage.php
index 15c81bf..875981e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -249,7 +249,7 @@ abstract class PlPage extends Smarty
         // PHP is used on command line... do not run the whole page stuff.
         if (php_sapi_name() == 'cli') {
             echo $msg . "\n";
-            exit;
+            exit(-1);
         }
 
         global $platal;
@@ -289,9 +289,13 @@ abstract class PlPage extends Smarty
     // }}}
     // {{{ function addJsLink
 
-    public function addJsLink($filename)
+    public function addJsLink($filename, $static_content = true)
     {
-        $this->append('pl_js', pl_static_content_path("javascript/", $filename));
+        if ($static_content) {
+            $this->append('pl_js', pl_static_content_path("javascript/", $filename));
+        } else {
+            $this->append('pl_js', "javascript/$filename");
+        }
     }
 
     // }}}