Добрый день!
Столкнулся с проблемой на osStore 1.5.4.1
Шаблон при выводе любого модуля выдает ошибку вида
Notice: Undefined variable: module_position in
Z:\home\localhost\www\malinka\01.ru\catalog\view\theme\Terry\template\module\featured.tpl on line 1Notice: Undefined variable: module_position in Z:\home\localhost\www\malinka\01.ru\catalog\view\theme\Terry\template\module\featured.tpl on line 1
текст файла featured.tpl
<?php if ($module_position == 'content_top' || $module_position == 'content_bottom'): ?>
<?php require 'featured_content.tpl'; ?>
<?php else: ?>
<?php require 'featured_column.tpl'; ?>
<?php endif; ?>
текст файла system/engine/controller.php
<?php
abstract class Controller {
protected $registry;
protected $id;
protected $layout;
protected $template;
protected $children = array();
protected $data = array();
protected $output;
public function __construct($registry) {
$this->registry = $registry;
}
public function __get($key) {
return $this->registry->get($key);
}
public function __set($key, $value) {
$this->registry->set($key, $value);
}
protected function forward($route, $args = array()) {
return new Action($route, $args);
}
protected function redirect($url, $status = 302) {
header('Status: ' . $status);
header('Location: ' . str_replace(array('&', "\n", "\r"), array('&', '', ''), $url));
exit();
}
protected function getChild($child, $args = array()) {
$action = new Action($child, $args);
if (file_exists($action->getFile())) {
require_once($action->getFile());
$class = $action->getClass();
$controller = new $class($this->registry);
if (substr($child, 0, 6) == 'module') {
$controller->data['module_instance'] = $args;
if (is_array($args) && isset($args['position'])) {
// 1.5.1+
$controller->data['module_position'] = $args['position'];
$controller->data['module_layout_id'] = $args['layout_id'];
} else {
// 1.5.0.5
$controller->data['module_position'] = $this->config->get(substr($child, 7) . '_' . $args . '_position');
$controller->data['module_layout_id'] = $this->config->get(substr($child, 7) . '_' . $args . '_layout_id');
}
}
$controller->{$action->getMethod()}($action->getArgs());
return $controller->output;
} else {
trigger_error('Error: Could not load controller ' . $child . '!');
exit();
}
}
protected function render() {
foreach ($this->children as $child) {
$this->data[basename($child)] = $this->getChild($child);
}
if (file_exists(DIR_TEMPLATE . $this->template)) {
extract($this->data);
ob_start();
require(DIR_TEMPLATE . $this->template);
$this->output = ob_get_contents();
ob_end_clean();
return $this->output;
} else {
trigger_error('Error: Could not load template ' . DIR_TEMPLATE . $this->template . '!');
exit();
}
}
}
?>
Может кто подскажет откуда берется ошибка и как поправить?