diff --git a/modules/backend/classes/ControllerBehavior.php b/modules/backend/classes/ControllerBehavior.php index 9727add37..8d137bccc 100644 --- a/modules/backend/classes/ControllerBehavior.php +++ b/modules/backend/classes/ControllerBehavior.php @@ -14,10 +14,10 @@ use System\Traits\ViewMaker; */ class ControllerBehavior extends ExtensionBase { + use \Backend\Traits\WidgetMaker; use \System\Traits\AssetMaker; use \System\Traits\ConfigMaker; - use \Backend\Traits\WidgetMaker; - use \Backend\Traits\ViewMaker { + use \System\Traits\ViewMaker { ViewMaker::makeFileContents as localMakeFileContents; } diff --git a/modules/cms/classes/CombineAssets.php b/modules/cms/classes/CombineAssets.php index c994cc474..952b1e049 100644 --- a/modules/cms/classes/CombineAssets.php +++ b/modules/cms/classes/CombineAssets.php @@ -23,8 +23,6 @@ use Assetic\Cache\FilesystemCache; */ class CombineAssets { - use \System\Traits\PathMaker; - /** * @var Self Instance for multi cycle execution. */ @@ -376,7 +374,7 @@ class CombineAssets $filesSalt = null; foreach ($assets as $asset) { $filters = $this->getFilters(File::extension($asset)); - $path = $this->makePath($asset) ?: $this->path . $asset; + $path = File::symbolizePath($asset) ?: $this->path . $asset; $files[] = new FileAsset($path, $filters, public_path()); $filesSalt .= $this->path . $asset; } diff --git a/modules/system/traits/PathMaker.php b/modules/system/traits/PathMaker.php deleted file mode 100644 index 8e9b49aea..000000000 --- a/modules/system/traits/PathMaker.php +++ /dev/null @@ -1,56 +0,0 @@ - PATH_PLUGINS, - '~' => PATH_BASE, - // '/' => PATH_BASE, // @deprecated - '@' => PATH_BASE, // @deprecated - ]; - - /** - * Converts a path. - * @param string $path - * @return string - */ - public function makePath($path, $default = false) - { - if (!$firstChar = $this->isPathSymbol($path)) - return $default; - - $_path = substr($path, 1); - return $this->pathSymbols[$firstChar] . $_path; - } - - /** - * Returns true if the path uses a symbol. - * @param string $path - * @return boolean - */ - public function isPathSymbol($path) - { - $firstChar = substr($path, 0, 1); - if (isset($this->pathSymbols[$firstChar])) - return $firstChar; - - return false; - } - -} \ No newline at end of file diff --git a/modules/system/traits/ViewMaker.php b/modules/system/traits/ViewMaker.php index 012d0c8ed..5e587c441 100644 --- a/modules/system/traits/ViewMaker.php +++ b/modules/system/traits/ViewMaker.php @@ -16,8 +16,6 @@ use System\Classes\SystemException; trait ViewMaker { - use \System\Traits\PathMaker; - /** * @var array A list of variables to pass to the page. */ @@ -52,7 +50,7 @@ trait ViewMaker */ public function makePartial($partial, $params = [], $throwException = true) { - if (!$this->isPathSymbol($partial) && realpath($partial) === false) + if (!File::isPathSymbol($partial) && realpath($partial) === false) $partial = '_' . strtolower($partial) . '.htm'; $partialPath = $this->getViewPath($partial); @@ -153,7 +151,7 @@ trait ViewMaker if (!$viewPath) $viewPath = $this->viewPath; - $fileName = $this->makePath($fileName, $fileName); + $fileName = File::symbolizePath($fileName, $fileName); if (substr($fileName, 0, 1) == '/' || realpath($fileName) !== false) return $fileName;