mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Update search for template.php
If the template is pointing to a custom location but the template.php doesn't exist there then use the default/template.php
This commit is contained in:
@@ -59,10 +59,21 @@
|
|||||||
$_SESSION["template_full_path"] = $template_full_path;
|
$_SESSION["template_full_path"] = $template_full_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//get the template_name and template_dir
|
||||||
|
$theme_dir = dirname(__DIR__, 1).'/themes';
|
||||||
|
$template_name = $settings->get('domain', 'template', 'default');
|
||||||
|
if (file_exists($theme_dir.'/'.$template_name.'/template.php')) {
|
||||||
|
$template_dir = $theme_dir.'/'.$template_name;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$template_name = 'default';
|
||||||
|
$template_dir = $theme_dir.'/'.$template_name;
|
||||||
|
}
|
||||||
|
|
||||||
//initialize a template object
|
//initialize a template object
|
||||||
$view = new template();
|
$view = new template();
|
||||||
$view->engine = 'smarty';
|
$view->engine = 'smarty';
|
||||||
$view->template_dir = $_SERVER['DOCUMENT_ROOT'].PROJECT_PATH.'/themes/'.$settings->get('domain', 'template', 'default').'/';
|
$view->template_dir = $template_dir;
|
||||||
$view->cache_dir = sys_get_temp_dir();
|
$view->cache_dir = sys_get_temp_dir();
|
||||||
$view->init();
|
$view->init();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user