allow widget 'packages' as well as individual files
This commit is contained in:
parent
b816a575eb
commit
8d61efa0e8
@ -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)) {
|
||||||
|
if(file_exists('widget/' . trim($name) . '.php'))
|
||||||
require_once('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))
|
||||||
|
Reference in New Issue
Block a user