allow widget 'packages' as well as individual files

This commit is contained in:
redmatrix 2015-12-18 14:10:06 -08:00
parent b816a575eb
commit 8d61efa0e8

View file

@ -284,8 +284,13 @@ function comanche_widget($name, $text) {
$func = 'widget_' . trim($name); $func = 'widget_' . trim($name);
if((! function_exists($func)) && file_exists('widget/' . trim($name) . '.php')) if(! function_exists($func)) {
require_once('widget/' . trim($name) . '.php'); if(file_exists('widget/' . trim($name) . '.php'))
require_once('widget/' . trim($name) . '.php');
elseif(is_dir('widget/'. trim($name))
&& (file_exists('widget/' . trim($name) . '/' . trim($name) . '.php')))
require_once('widget/' . trim($name) . '/' . trim($name) . '.php');
}
else { else {
$theme_widget = $func . '.php'; $theme_widget = $func . '.php';
if((! function_exists($func)) && theme_include($theme_widget)) if((! function_exists($func)) && theme_include($theme_widget))