diff --git a/src/Controller/Action.php b/src/Controller/Action.php index 2d8f6ad..f60c242 100644 --- a/src/Controller/Action.php +++ b/src/Controller/Action.php @@ -118,13 +118,15 @@ class Controller_Action /*.View_Composite.*/$tpl = new $viewClass($template); + $assets = Path::join(WWW_PATH, "assets", "css"); $tpl->set('icons', $this->iconPath); // Путь к файлам текущей темы $tpl->set('media', $this->themePath); // Путь к файлам текущей темы - $tpl->set('assets', Path::join(WWW_PATH, "assets", "css")); + $tpl->set('assets', $assets); $tpl->set('script', $this->jsPath); // Путь к файлам скриптов $tpl->set('template', $path); // Путь к файлам текущего шаблона $tpl->setAlias(array( + 'assets' => $assets, 'icons' => $this->iconPath, 'script' => $this->jsPath, // Для media и template поиск происходит как для файлов шаблонов diff --git a/src/View/Composite.php b/src/View/Composite.php index 0a21508..812ee48 100644 --- a/src/View/Composite.php +++ b/src/View/Composite.php @@ -38,4 +38,8 @@ class View_Composite extends View_View // postProcess return $this->tal->execute(); } + + function setTranslator($t) { + $this->tal->setTranslator($t); + } } diff --git a/src/View/list.php b/src/View/List.php similarity index 100% rename from src/View/list.php rename to src/View/List.php diff --git a/src/View/Top.php b/src/View/Top.php index 95bbff5..a27df4c 100644 --- a/src/View/Top.php +++ b/src/View/Top.php @@ -27,28 +27,22 @@ class View_Top extends View_Composite { { $debug = ($debug) ? 'debug=1' : ''; $path = parse_url(WWW_PATH, PHP_URL_PATH); - // Группы определять в import через , - $groups = array( ); + + $groups = array(); $use = array(); $result = array(); foreach ($list as $file) { $name = $this->findGroup($groups, $file); if($name) { - $use [$name] = 1; + $use[$name] = 1; } else { - if (strpos($file, 'ckeditor')) { - $result [] = $file; - } else { -// $result [] = WWW_PATH . "/min/?$debug&f=" . parse_url($file, PHP_URL_PATH); - $result [] = $file; - } + $result[] = $file; } } $list = array(); foreach ($use as $name => $value) { -// $list [] = WWW_PATH . "/min/?$debug&f=" . implode(",", $groups[$name]); - $list [] = $groups[$name]; + $list[] = $groups[$name]; } return array_merge($list, $result); @@ -70,7 +64,6 @@ class View_Top extends View_Composite { $alias = $this->doTree('alias'); -// require_once 'minify.php'; // Скрипты и стили $this->set('scriptstring', $this->getScriptRaw()); $this->set('scripts', array_unique($this->groupFiles($this->getScripts(), false))); @@ -117,19 +110,10 @@ class View_Top extends View_Composite { } -/* echo "
";
-		print_r($this->require);
-		print_r(implode("", $startup));
-		echo "
";*/ - - //$this->set('scriptstring', ''); $this->set('startup', implode("", $startup) . $this->getScriptStartup()); - - $this->set('require', implode(",", array_map(function ($x) { return "'$x'";}, array_keys($this->require)))); $this->set('deps', implode(",", array_values($this->require))); - $this->set('title', $this->getTitle()); $this->set('jspath', WWW_PATH); // diff --git a/src/View/View.php b/src/View/View.php index cd51d8b..85d9961 100644 --- a/src/View/View.php +++ b/src/View/View.php @@ -153,6 +153,7 @@ class View_View } function find_file($pathlist, $file) { + foreach($pathlist as $key => $www) { if (file_exists($key . '/' . $file)) { return $www . '/' . $file;