diff --git a/zin/core/render.func.php b/zin/core/render.func.php new file mode 100644 index 0000000000..0e841d09ca --- /dev/null +++ b/zin/core/render.func.php @@ -0,0 +1,40 @@ + + * @package zin + * @version $Id + * @link https://www.zentao.net + */ + +namespace zin; + +$globalRenderList = array(); + +$isGlobalMode = true; + +function enableGlobalRender() +{ + global $isGlobalMode; + $isGlobalMode = true; +} + +function disableGlobalRender() +{ + global $isGlobalMode; + $isGlobalMode = false; +} + +function render($wgName) +{ + global $globalRenderList; + + if(function_exists($wgName)) + { + return call_user_func_array($wgName, $globalRenderList); + } + + return class_exists($wgName) ? (new $wgName($globalRenderList)) : $wgName($globalRenderList); +} diff --git a/zin/helper.php b/zin/helper.php index b6fb460ce2..c02f3035ff 100755 --- a/zin/helper.php +++ b/zin/helper.php @@ -49,10 +49,5 @@ function createWg($name, $args) $wgName = "\\zin\\$name"; - if(function_exists($wgName)) - { - return call_user_func_array($wgName, $args); - } - return class_exists($wgName) ? (new $wgName($args)) : $wgName($args); } diff --git a/zin/zui/skin.class.php b/zin/zui/skin.class.php new file mode 100644 index 0000000000..e69de29bb2 diff --git a/zin/zui/toggle.class.php b/zin/zui/toggle.class.php new file mode 100644 index 0000000000..e69de29bb2