diff --git a/zin/core/directive.func.php b/zin/core/directive.func.php index 3f7bfb3f7e..dbe5356f0d 100644 --- a/zin/core/directive.func.php +++ b/zin/core/directive.func.php @@ -9,12 +9,11 @@ * @link https://www.zentao.net */ -namespace zin\core; +namespace zin; require_once dirname(__DIR__) . DS . 'utils' . DS . 'flat.func.php'; use stdClass; -use function \zin\utils\flat; /** * Create directive object @@ -82,12 +81,12 @@ function setId($id) function html(/* string ...$lines */) { - return directive('html', implode("\n", flat(func_get_args()))); + return directive('html', implode("\n", \zin\utils\flat(func_get_args()))); } function text(/* string ...$lines */) { - return directive('text', implode("\n", flat(func_get_args()))); + return directive('text', implode("\n", \zin\utils\flat(func_get_args()))); } function block($name, $value = NULL) diff --git a/zin/core/h.class.php b/zin/core/h.class.php index 5586699d7c..dcec47a5f8 100644 --- a/zin/core/h.class.php +++ b/zin/core/h.class.php @@ -9,14 +9,12 @@ * @link https://www.zentao.net */ -namespace zin\core; +namespace zin; require_once dirname(__DIR__) . DS . 'utils' . DS . 'flat.func.php'; require_once 'wg.class.php'; require_once 'directive.func.php'; -use function \zin\utils\flat; - class h extends wg { protected static $defineProps = 'tagName, selfClose?:bool=false, customProps?:string|array'; @@ -151,7 +149,7 @@ class h extends wg protected static function convertStrToRawHtml($children) { - $children = flat($children); + $children = \zin\utils\flat($children); foreach($children as $key => $child) { if(is_string($child)) $children[$key] = html($child); diff --git a/zin/core/h.func.php b/zin/core/h.func.php index 3a99ebfc2d..53648e17ed 100644 --- a/zin/core/h.func.php +++ b/zin/core/h.func.php @@ -9,7 +9,7 @@ * @link https://www.zentao.net */ -namespace zin\core; +namespace zin; require_once 'h.class.php'; diff --git a/zin/core/props.class.php b/zin/core/props.class.php index 84b82e76c9..46d3efec71 100755 --- a/zin/core/props.class.php +++ b/zin/core/props.class.php @@ -9,7 +9,7 @@ * @link https://www.zentao.net */ -namespace zin\utils; +namespace zin; require_once dirname(__DIR__) . DS . 'utils' . DS . 'dataset.class.php'; require_once dirname(__DIR__) . DS . 'utils' . DS . 'classlist.class.php'; @@ -18,7 +18,7 @@ require_once dirname(__DIR__) . DS . 'utils' . DS . 'style.class.php'; /** * Manage properties for html element and widgets */ -class props extends dataset +class props extends \zin\utils\dataset { /** * Style property @@ -44,8 +44,8 @@ class props extends dataset */ public function __construct($props = NULL) { - $this->style = new style(); - $this->class = new classlist(); + $this->style = new \zin\utils\style(); + $this->class = new \zin\utils\classlist(); parent::__construct($props); } diff --git a/zin/core/wg.class.php b/zin/core/wg.class.php index f872fc5641..8755894951 100644 --- a/zin/core/wg.class.php +++ b/zin/core/wg.class.php @@ -9,14 +9,12 @@ * @link https://www.zentao.net */ -namespace zin\core; +namespace zin; require_once 'props.class.php'; require_once 'wg.func.php'; require_once 'directive.func.php'; -use zin\utils\props; - class wg { /** diff --git a/zin/core/wg.func.php b/zin/core/wg.func.php index 1349365eb6..20271ed7e7 100644 --- a/zin/core/wg.func.php +++ b/zin/core/wg.func.php @@ -1,5 +1,5 @@ getBasePath() . 'zin' . DS . 'wg' . DS . $name . DS . "v$wgVer.php"; - $className = "\\zin\\wg\\$name"; + $className = "\\zin\\$name"; return class_exists($className) ? (new $className($args)) : $className($args); } diff --git a/zin/wg/btn/v1.php b/zin/wg/btn/v1.php index 42f1dc91e7..b0f2991305 100755 --- a/zin/wg/btn/v1.php +++ b/zin/wg/btn/v1.php @@ -1,15 +1,11 @@