# 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>NutriDB Nutrition Database: food and recipe nutrition calculator HEADERS; # add the generated XAJAX javascript to the headers $commonHeaders .= str_replace("&", "&", $xajax->getJavascript($config->_jsUri)); switch ( $config->_thisScript ) { case "view_food": $myHeaders = << $commonHeaders HEADERS; break; case "view_meal": $myHeaders = << $commonHeaders HEADERS; break; case "view_diary": $myHeaders = << $commonHeaders HEADERS; break; case "register": $myHeaders = << $commonHeaders HEADERS; break; case "edit_account": $myHeaders = << $commonHeaders HEADERS; break; default: $myHeaders = $commonHeaders; } ?>