Мелкие правки
This commit is contained in:
parent
a75f450edd
commit
3a77f74177
5 changed files with 13 additions and 22 deletions
|
|
@ -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 поиск происходит как для файлов шаблонов
|
||||
|
|
|
|||
|
|
@ -38,4 +38,8 @@ class View_Composite extends View_View
|
|||
// postProcess
|
||||
return $this->tal->execute();
|
||||
}
|
||||
|
||||
function setTranslator($t) {
|
||||
$this->tal->setTranslator($t);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 "<pre>";
|
||||
print_r($this->require);
|
||||
print_r(implode("", $startup));
|
||||
echo "</pre>";*/
|
||||
|
||||
//$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);
|
||||
//
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue