JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
* run.php: minor changes.
authorJosh Grams <josh@qualdan.com>
Sat, 22 Aug 2009 16:20:09 +0000 (12:20 -0400)
committerJosh Grams <josh@qualdan.com>
Sat, 22 Aug 2009 16:20:09 +0000 (12:20 -0400)
run.php

diff --git a/run.php b/run.php
index 3d0b1d4..c67c27e 100644 (file)
--- a/run.php
+++ b/run.php
@@ -78,6 +78,8 @@ function run_php($dest = false) {
                }
        }
 
+       $GLOBALS['basename'] = $basename;
+
        $html_file = "$basename.html";
        $php_file = "$basename.php";
 
@@ -88,12 +90,14 @@ function run_php($dest = false) {
        # 1) false to indicate that there's no cms content for this basename
        # 2) a string to request a soft/full redirect just like foo_main()
        # 3) a hash of key/value pairs to be added to the template
-       if(function_exists('cms_get')) {
-               $cms_content = cms_get($basename);
+       if(function_exists('cms_display')) {
+               $cms_content = cms_display($basename);
                if(is_string($cms_content)) {
                        run_php($cms_content);
                        return;
                }
+       } else {
+               $cms_content = false;
        }
 
        if($php_exists) {
@@ -113,10 +117,11 @@ function run_php($dest = false) {
                        return;
                } else {
                        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><title>404</title></head><body><h1>404 File Not Found</h1></body></html>';
+                       exit();
                }
        }
 
-       $data = &$GLOBALS['wfpl_tem_data'];
+       $data =& $GLOBALS['wfpl_tem_data'];
        $data['basename'] = $basename;
        if(function_exists('display_messages')) {
                display_messages();