First step to clean up all files that are not mandatory for outside access * move all header/footer/smarty/set_paths/config files (inc) into includes/ folder * generate basic config.php that JUST loads the config.inc file (search) * config.inc file has sub sections for db access arrays and host configs, so config.inc is more static * Also move edit base and template arrays to the include folder * move the language po files to the 4dev folder as they do not need to sit outside * remove not maintained "files.php" TODO: split out templates and language files into external layout group perhaps drop the whole sub template include path thing as this is actually never really used and more annoying to maintain eg: layout/frontend/default/ -> layout/frontend eg: layout/fronend/default/template -> includes/frontend/template Also check splitting out the NOT define parts of the config.inc file G_TITLE, EDIT_STYLESHEET, EDIT_JAVASCRIPT, STYLESHEET, JAVASCRIPT to default define?
105 lines
3.9 KiB
PHP
105 lines
3.9 KiB
PHP
<?php
|
|
/********************************************************************
|
|
* AUTHOR: Clemens Schwaighofer
|
|
* CREATED: 2005/07/12
|
|
* SHORT DESCRIPTION:
|
|
* default smarty vars, and create output template for smarty
|
|
* HISTORY:
|
|
*********************************************************************/
|
|
|
|
// trigger flags
|
|
$cms->HEADER['USE_PROTOTYPE'] = USE_PROTOTYPE;
|
|
// scriptacolous, can only be used with prototype
|
|
if (USE_PROTOTYPE) {
|
|
$cms->HEADER['USE_SCRIPTACULOUS'] = USE_SCRIPTACULOUS;
|
|
}
|
|
// jquery and prototype should not be used together
|
|
$cms->HEADER['USE_JQUERY'] = USE_JQUERY; // don't use either of those two toger
|
|
|
|
// set basic template path (tmp)
|
|
// paths are set in the 'set_paths.inc' file
|
|
|
|
// check if we have an external file with the template name
|
|
if (file_exists($cms->includes.$cms->INC_TEMPLATE_NAME) && is_file($cms->includes.$cms->INC_TEMPLATE_NAME)) {
|
|
include($cms->includes.$cms->INC_TEMPLATE_NAME);
|
|
}
|
|
// additional per page Javascript include
|
|
$cms->JS_INCLUDE = '';
|
|
if (file_exists($cms->javascript.$cms->JS_TEMPLATE_NAME) && is_file($cms->javascript.$cms->JS_TEMPLATE_NAME)) {
|
|
$cms->JS_INCLUDE = $cms->javascript.$cms->JS_TEMPLATE_NAME;
|
|
}
|
|
// per page css file
|
|
$cms->CSS_INCLUDE = '';
|
|
if (file_exists($cms->css.$cms->CSS_TEMPLATE_NAME) && is_file($cms->css.$cms->CSS_TEMPLATE_NAME)) {
|
|
$cms->CSS_INCLUDE = $cms->css.$cms->CSS_TEMPLATE_NAME;
|
|
}
|
|
// optional CSS file
|
|
$cms->CSS_SPECIAL_INCLUDE = '';
|
|
if (file_exists($cms->css.$cms->CSS_SPECIAL_TEMPLATE_NAME) && is_file($cms->css.$cms->CSS_SPECIAL_TEMPLATE_NAME)) {
|
|
$cms->CSS_SPECIAL_INCLUDE = $cms->css.$cms->CSS_SPECIAL_TEMPLATE_NAME;
|
|
}
|
|
// optional JS file
|
|
$cms->JS_SPECIAL_INCLUDE = '';
|
|
if (file_exists($cms->javascript.$cms->JS_SPECIAL_TEMPLATE_NAME) && is_file($cms->javascript.$cms->JS_SPECIAL_TEMPLATE_NAME)) {
|
|
$cms->JS_SPECIAL_INCLUDE = $cms->javascript.$cms->JS_SPECIAL_TEMPLATE_NAME;
|
|
}
|
|
|
|
// the actual include files for javascript (per page)
|
|
$cms->HEADER['JS_INCLUDE'] = $cms->JS_INCLUDE;
|
|
$cms->HEADER['CSS_INCLUDE'] = $cms->CSS_INCLUDE;
|
|
$cms->HEADER['CSS_SPECIAL_INCLUDE'] = $cms->CSS_SPECIAL_INCLUDE;
|
|
$cms->HEADER['JS_SPECIAL_INCLUDE'] = $cms->JS_SPECIAL_INCLUDE;
|
|
// paths to the files
|
|
$cms->DATA['includes'] = $cms->includes;
|
|
$cms->DATA['js'] = $cms->javascript;
|
|
$cms->DATA['css'] = $cms->css;
|
|
$cms->DATA['pictures'] = $cms->pictures;
|
|
|
|
// default CMS settings
|
|
// define all needed smarty stuff for the general HTML/page building
|
|
$cms->HEADER['CSS'] = CSS;
|
|
$cms->HEADER['JS'] = JS;
|
|
$cms->HEADER['ENCODING'] = $encoding;
|
|
$cms->HEADER['DEFAULT_ENCODING'] = DEFAULT_ENCODING;
|
|
$cms->HEADER['STYLESHEET'] = $EDIT_STYLESHEET;
|
|
$cms->HEADER['JAVASCRIPT'] = $EDIT_JAVASCRIPT;
|
|
// html title
|
|
$cms->HEADER['HTML_TITLE'] = (!isset($L_TITLE) || !$L_TITLE) ? $cms->l->__($G_TITLE) : $cms->l->__($L_TITLE);
|
|
$cms->DATA['table_width'] = $PAGE_WIDTH ? $PAGE_WIDTH : PAGE_WIDTH;
|
|
|
|
// messages = array('msg' =>, 'class' => 'error/warning/...')
|
|
$cms->DATA['messages'] = $cms->messages;
|
|
|
|
// top menu
|
|
$cms->DATA['nav_menu'] = $cms->adbTopMenu();
|
|
// the page name
|
|
$cms->DATA['page_name'] = $cms->page_name;
|
|
// user name
|
|
$cms->DATA['USER_NAME'] = $_SESSION['USER_NAME'];
|
|
// the template part to include into the body
|
|
$cms->DATA['TEMPLATE_NAME'] = $TEMPLATE_NAME;
|
|
$cms->DATA['CONTENT_INCLUDE'] = $CONTENT_INCLUDE;
|
|
// LANG
|
|
$cms->DATA['LANG'] = $lang;
|
|
$cms->DATA['TINYMCE_LANG'] = $lang_short;
|
|
|
|
// debug data, if DEBUG flag is on, this data is print out
|
|
$cms->DEBUG_DATA['debug_error_msg'] = $cms->runningTime();
|
|
$cms->DEBUG_DATA['DEBUG'] = @$DEBUG_TMPL;
|
|
|
|
// create main data array
|
|
$cms->CONTENT_DATA = array_merge($cms->HEADER, $cms->DATA, $cms->DEBUG_DATA);
|
|
// data is 1:1 mapping (all vars, values, etc)
|
|
foreach ($cms->CONTENT_DATA as $key => $value) {
|
|
$smarty->assign($key, $value);
|
|
}
|
|
if (is_dir(BASE.TEMPLATES_C)) {
|
|
$smarty->setCompileDir(BASE.TEMPLATES_C);
|
|
}
|
|
if (is_dir(BASE.CACHE)) {
|
|
$smarty->setCacheDir(BASE.CACHE);
|
|
}
|
|
$smarty->display($MASTER_TEMPLATE_NAME, $TEMPLATE.$lang, $TEMPLATE.$lang);
|
|
|
|
# __END__
|