diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-12-18 14:10:06 -0800 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-12-18 14:10:06 -0800 |
commit | 8d61efa0e865203df5eb4fae90b7bbd48597cf03 (patch) | |
tree | a67a59be29f510b9148fc3ed01d42aa5dc692d42 | |
parent | b816a575eba7a2bb2add23d5eba0da05f2050f51 (diff) | |
download | volse-hubzilla-8d61efa0e865203df5eb4fae90b7bbd48597cf03.tar.gz volse-hubzilla-8d61efa0e865203df5eb4fae90b7bbd48597cf03.tar.bz2 volse-hubzilla-8d61efa0e865203df5eb4fae90b7bbd48597cf03.zip |
allow widget 'packages' as well as individual files
-rw-r--r-- | include/comanche.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/comanche.php b/include/comanche.php index ef71886f2..5bffc3dbf 100644 --- a/include/comanche.php +++ b/include/comanche.php @@ -284,8 +284,13 @@ function comanche_widget($name, $text) { $func = 'widget_' . trim($name); - if((! function_exists($func)) && file_exists('widget/' . trim($name) . '.php')) - require_once('widget/' . trim($name) . '.php'); + if(! function_exists($func)) { + 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 { $theme_widget = $func . '.php'; if((! function_exists($func)) && theme_include($theme_widget)) |