Changes to the index file as well.

This commit is contained in:
green-ponies (jgen) 2012-01-12 14:47:24 -05:00
parent 2e0e8475a1
commit ea6f853891

View file

@ -107,22 +107,22 @@ try {
ctx_log_start("Loading themelets");
// load the theme parts
$_theme = $config->get_string("theme", "default");
if(!file_exists("themes/$_theme")) $_theme = "default";
if(file_exists("themes/$_theme/custompage.class.php")) require_once "themes/$_theme/custompage.class.php";
require_once "themes/$_theme/layout.class.php";
require_once "themes/$_theme/themelet.class.php";
if(!file_exists('themes/'.$_theme)) $_theme = "default";
if(file_exists('themes/'.$_theme.'/custompage.class.php')) require_once 'themes/'.$_theme.'/custompage.class.php';
require_once 'themes/'.$_theme.'/layout.class.php';
require_once 'themes/'.$_theme.'/themelet.class.php';
$themelets = glob("ext/*/theme.php");
foreach($themelets as $filename) {
require_once $filename;
}
$custom_themelets = glob("themes/$_theme/*.theme.php");
$custom_themelets = glob('themes/'.$_theme.'/*.theme.php');
if($custom_themelets) {
$m = array();
foreach($custom_themelets as $filename) {
if(preg_match("/themes\/$_theme\/(.*)\.theme\.php/",$filename,$m)
&& in_array("ext/{$m[1]}/theme.php", $themelets)) {
if(preg_match('/themes\/'.$_theme.'\/(.*)\.theme\.php/',$filename,$m)
&& in_array('ext/'.$m[1].'/theme.php', $themelets)) {
require_once $filename;
}
}