Error();
$this->navigation = new Navigation();
// determine rootindex
if ( file_exists(forge_get_config('custom_path') . '/index_std.php') ) {
$this->rootindex = forge_get_config('custom_path') . '/index_std.php';
} else {
$this->rootindex = $GLOBALS['gfwww'].'index_std.php';
}
// determine theme{dir,url}
$this->themedir = forge_get_config('themes_root') . '/' . forge_get_config('default_theme') . '/';
if (!file_exists ($this->themedir)) {
html_error_top(_("Can't find theme directory!"));
return;
}
$this->themeurl = util_make_url('themes/' . forge_get_config('default_theme') . '/');
// determine {css,img,js}{url,dir}
if (file_exists ($this->themedir . 'images/')) {
$this->imgdir = $this->themedir . 'images/';
$this->imgbaseurl = $this->themeurl . 'images/';
} else {
$this->imgdir = $this->themedir;
$this->imgbaseurl = $this->themeurl;
}
if (file_exists ($this->themedir . 'js/')) {
$this->jsdir = $this->themedir . 'js/';
$this->jsbaseurl = $this->themeurl . 'js/';
} else {
$this->jsdir = $this->themedir;
$this->jsbaseurl = $this->themeurl;
}
$this->addStylesheet('/themes/css/fusionforge.css');
}
function addJavascript($js) {
if (isset($this->js_min[$js])) {
$js = $this->js_min[$js];
}
if (!isset($this->js[$js])) {
$this->js[$js] = true;
$filename = $GLOBALS['fusionforge_basedir'].'/www'.$js;
if (file_exists($filename)) {
$js .= '?'.date ("U", filemtime($filename));
} else {
$filename = str_replace('/scripts/', $GLOBALS['fusionforge_basedir'].'/lib/vendor/', $js);
if (file_exists($filename)) {
$js .= '?'.date ("U", filemtime($filename));
}
}
$this->javascripts[] = $js;
}
}
function addStylesheet($css, $media='') {
if (isset($this->css_min[$css])) {
$css = $this->css_min[$css];
}
if (!isset($this->css[$css])) {
$this->css[$css] = true;
$filename = $GLOBALS['fusionforge_basedir'].'/www'.$css;
if (file_exists($filename)) {
$css .= '?'.date ("U", filemtime($filename));
} else {
$filename = str_replace('/scripts/', $GLOBALS['fusionforge_basedir'].'/lib/vendor/', $css);
if (file_exists($filename)) {
$css .= '?'.date ("U", filemtime($filename));
}
}
$this->stylesheets[] = array('css' => $css, 'media' => $media);
}
}
function getJavascripts() {
$code = '';
foreach ($this->javascripts as $js) {
$code .= ' '."\n";
}
return $code;
}
function getStylesheets() {
$code = '';
foreach ($this->stylesheets as $c) {
if ($c['media']) {
$code .= ' '."\n";
} else {
$code .= ' '."\n";
}
}
return $code;
}
/**
* header() - generates the complete header of page by calling
* headerStart() and bodyHeader().
*/
function header($params) {
$this->headerStart($params); ?>
bodyHeader($params);
}
/**
* headerStart() - generates the header code for all themes up to the
* closing .
* Override any of the methods headerHTMLDeclaration(), headerTitle(),
* headerFavIcon(), headerRSS(), headerSearch(), headerCSS(), or
* headerJS() to adapt your theme.
*
* @param array Header parameters array
*/
function headerStart($params) {
$this->headerHTMLDeclaration();
?>
headerTitle($params);
$this->headerFavIcon();
$this->headerRSS();
$this->headerSearch();
$this->headerCSS();
$this->headerJS();
?>
.
*
*/
function headerHTMLDeclaration() {
print ''."\n";
if (isset($this->doctype) && $this->doctype=='strict') {
echo ''."\n";
} else {
echo ''."\n";
}
echo ''."\n";
}
/**
* headerTitle() - creates the header
*
* @param array Header parameters array
*/
function headerTitle($params) {
echo $this->navigation->getTitle($params);
}
/**
* headerFavIcon() - creates the favicon headers.
*
*/
function headerFavIcon() {
echo $this->navigation->getFavIcon();
}
/**
* headerRSS() - creates the RSS headers.
*
*/
function headerRSS() {
echo $this->navigation->getRSS();
}
/**
* headerSearch() - creates the search header.
*
*/
function headerSearch() {
echo ''."\n";
}
/**
* Create the CSS headers for all cssfiles in $cssfiles and
* calls the plugin cssfile hook.
*/
function headerCSS() {
plugin_hook ('cssfile',$this);
echo $this->getStylesheets();
}
/**
* headerJS() - creates the JS headers and calls the plugin javascript hook
* @todo generalize this
*/
function headerJS() {
echo '
';
plugin_hook ("javascript_file",false);
echo $this->getJavascripts();
}
function bodyHeader($params){
?>