fixed a prob with the url matching code
authorpaulr <me@pjr.cc>
Tue, 2 Aug 2011 10:09:58 +0000 (20:09 +1000)
committerpaulr <me@pjr.cc>
Tue, 2 Aug 2011 10:09:58 +0000 (20:09 +1000)
libglcas/urlparser.php
libglcas/web.php
plugins/cron.php

index 89c9bb1..ab7e69c 100644 (file)
@@ -23,10 +23,9 @@ class GLCASUrlParser {
                if(is_array($this->urlClasses)) {
                        foreach($this->urlClasses as $key => $val) {
                                error_log("checking url $url against $key, $val");
-                               if($url == "/") {
+                               if($key == "/") {
                                        $base = $val;
                                        error_log("base set to $val");
-                                       return new $val($this->config);
                                } 
                                
                                // TODO: this is quite messy really, need to think about how i do /'s in urls for url parsers
@@ -41,6 +40,12 @@ class GLCASUrlParser {
                                        }
                                }
                        }
+                       
+                       // check for "bases"
+                       if($url == "/") {
+                               return new $base($this->config);
+                       }
+                       
                }
                error_log("get class returns default");
                return new $default($this->config);
index 7ef4de6..0d812d9 100644 (file)
@@ -75,7 +75,7 @@ function GLCASpageBuilder($bodyClass, $bodyFunction, $bodycontent=null, $title="
                                $mt = preg_match("/.*.js$/", $file);
                                if($mt > 0) {
                                        error_log("loading js $file");
-                                       echo "<script type=\"text/javascript\" src=\"$BASE_URL/css/$file\"></script>";
+                                       echo "<script type=\"text/javascript\" src=\"$BASE_URL/js/$file\"></script>";
                                        //echo "required $basedir/$file\n";
                                }
                        }
index 8168e9a..ca99309 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 global $URL_HANDLERS;
-$URL_HANDLERS["cron"] = "GLCASCron";
+$URL_HANDLERS["cron.*"] = "GLCASCron";
 
 class GLCASCron {
        function __construct($config)