From d895b852a6e160496ffc760d46d3719a3d62ff86 Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Sun, 3 Feb 2008 23:23:24 +0000 Subject: Initial checkin of nutridb.org and basic subversion directory structure --- meta.php | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 meta.php (limited to 'meta.php') diff --git a/meta.php b/meta.php new file mode 100644 index 0000000..1ed3d40 --- /dev/null +++ b/meta.php @@ -0,0 +1,99 @@ + +# items based on the current script/page. there is a common set of +# headers that will be the same for all pages and these are defined +# in the variable $commonHeaders. for example, some pages will need +# some special javascript, but we may not want to add the overhead +# of loading the javascript into pages that don't require it. this +# can be handled here. we may also be able to add page-specific +# 's. at the stage that this script is included we should +# have access to all the $config variables and the database, as well +# as any user submitted data: $_POST, $_GET, etc. + +# headers common to every page +$commonHeaders = <<<HEADERS + <title>Nutrition Database + + + + + + + + +HEADERS; + +# add the generated XAJAX javascript to the headers +$commonHeaders .= str_replace("&", "&", $xajax->getJavascript($config->_jsUri)); + +switch ( $config->_thisScript ) { + + case "view_food.php": + $myHeaders = << + + + +$commonHeaders + +HEADERS; + break; + + case "view_meal.php": + $myHeaders = << + + + +$commonHeaders + +HEADERS; + break; + + case "view_diary.php": + $myHeaders = << + + + +$commonHeaders + +HEADERS; + break; + + case "register.php": + $myHeaders = << + + + +$commonHeaders + +HEADERS; + break; + + case "edit_account.php": + $myHeaders = << + + + +$commonHeaders + +HEADERS; + break; + + default: + $myHeaders = $commonHeaders; + +} + +?> -- cgit v1.2.3