Website.php:
//in the class variable declarations add:
var $module_javascript = array();
var $module_css = array();
//Modified display_header() function
function display_header()
{
$head='
';
}
//Add add_header() function to website class:
function add_header($type){
$dir="modules/".$this->module."/".$type;
if(is_dir($dir)){
if($handle = opendir($dir)){
while(false !== ($file=readdir($handle))){
if ($file != "." && $file != ".."){
switch(type){
case "javascript":
array_push($this->module_javascript,$file);
break;
case "css":
array_push($this->module_css,$file);
break;
}
}
}
}
}
}
//at the end of the include_module() function add the following:
add_header("javascript");
add_header("css");
/* Now with any module you want to add custom css or javascript to all you need to do is add the folder "javascript" or "css" and any files you put into them will be linked appropriatly in the header of the html. */