diff options
author | Wave <wave72@users.noreply.github.com> | 2015-12-20 10:20:36 +0100 |
---|---|---|
committer | Wave <wave72@users.noreply.github.com> | 2015-12-20 10:20:36 +0100 |
commit | 2aad4c2cf9c17a7532089aadfcc5feff6505ec74 (patch) | |
tree | 2082c8dc7ba090f610874b6e33b0f1092a2ff00c /include/comanche.php | |
parent | 474a1267d73c1dcf00678dd15ed4e0e37496473d (diff) | |
parent | e2692a4baaf031bd0d9c0893c3762637b1f6b201 (diff) | |
download | volse-hubzilla-2aad4c2cf9c17a7532089aadfcc5feff6505ec74.tar.gz volse-hubzilla-2aad4c2cf9c17a7532089aadfcc5feff6505ec74.tar.bz2 volse-hubzilla-2aad4c2cf9c17a7532089aadfcc5feff6505ec74.zip |
Merge pull request #4 from redmatrix/master
Merge master into dev branch
Diffstat (limited to 'include/comanche.php')
-rw-r--r-- | include/comanche.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/comanche.php b/include/comanche.php index 9585a6578..1537226ca 100644 --- a/include/comanche.php +++ b/include/comanche.php @@ -282,15 +282,21 @@ function comanche_widget($name, $text) { } } - if(file_exists('widget/' . trim($name) . '.php')) - require_once('widget/' . trim($name) . '.php'); + $func = 'widget_' . trim($name); + + if(! function_exists($func)) { + if(file_exists('widget/' . trim($name) . '.php')) + require_once('widget/' . trim($name) . '.php'); + elseif(folder_exists('widget/'. trim($name)) + && (file_exists('widget/' . trim($name) . '/' . trim($name) . '.php'))) + require_once('widget/' . trim($name) . '/' . trim($name) . '.php'); + } else { - $theme_widget = 'widget_' . trim($name) . '.php'; - if(theme_include($theme_widget)) + $theme_widget = $func . '.php'; + if((! function_exists($func)) && theme_include($theme_widget)) require_once(theme_include($theme_widget)); } - $func = 'widget_' . trim($name); if (function_exists($func)) return $func($vars); } |