Другая интерпретация реестра
This commit is contained in:
parent
40fad0e75b
commit
aaa9c2e1bf
21 changed files with 156 additions and 92 deletions
|
|
@ -9,6 +9,8 @@ use ctiso\Shortcut,
|
|||
ctiso\HttpRequest,
|
||||
ctiso\Functions,
|
||||
ctiso\Settings,
|
||||
ctiso\Registry,
|
||||
ctiso\Role\User,
|
||||
ctiso\View\Composite,
|
||||
ctiso\Filter\ActionAccess,
|
||||
ctiso\View\View,
|
||||
|
|
@ -45,8 +47,8 @@ class Action
|
|||
private $helpers = array(); // Помошники для действий
|
||||
public $part = null; // Параметры для ссылки
|
||||
|
||||
public /*.Settings.*/$settings; // Ссылка на настройки
|
||||
public $user; // Обьект пользователя
|
||||
public /*.Registry.*/$config; // Ссылка на настройки
|
||||
public /*.User.*/$user; // Обьект пользователя
|
||||
|
||||
// Для Widgets
|
||||
public $view = null;
|
||||
|
|
@ -62,7 +64,7 @@ class Action
|
|||
}
|
||||
|
||||
public function loadConfig($name) {
|
||||
$basePath = $this->settings['base'];
|
||||
$basePath = $this->config->get('site', 'path');
|
||||
|
||||
$filename = Path::join($basePath, 'modules', $name);
|
||||
$settings = [];
|
||||
|
|
@ -81,7 +83,7 @@ class Action
|
|||
|
||||
public function installPath($name)
|
||||
{
|
||||
$basePath = $this->settings['base'];
|
||||
$basePath = $this->config->get('site', 'path');
|
||||
return Path::join($basePath, "modules", $name);
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +96,7 @@ class Action
|
|||
}
|
||||
|
||||
function findIcon($icon, $size) {
|
||||
$webPath = $this->settings['web'];
|
||||
$webPath = $this->config->get('site', 'web');
|
||||
return Path::join($webPath, 'icons', $size . 'x' . $size, $icon . '.png');
|
||||
}
|
||||
|
||||
|
|
@ -108,8 +110,8 @@ class Action
|
|||
{
|
||||
$file = $name . self::TEMPLATE_EXTENSION;
|
||||
|
||||
$basePath = $this->settings['base'];
|
||||
$webPath = $this->settings['web'];
|
||||
$basePath = $this->config->get('site', 'path');
|
||||
$webPath = $this->config->get('site', 'web');
|
||||
|
||||
$list = array(
|
||||
Path::join($this->modulePath, 'templates', $this->viewPathPrefix) => Path::join($webPath, "modules", $this->name, 'templates', $this->viewPathPrefix),
|
||||
|
|
@ -151,7 +153,7 @@ class Action
|
|||
public function getModel($name)
|
||||
{
|
||||
if (!$this->factory) {
|
||||
$this->factory = new Factory($this->db, $this->settings['registry']);
|
||||
$this->factory = new Factory($this->db, $this->config);
|
||||
}
|
||||
return $this->factory->getModel($name);
|
||||
}
|
||||
|
|
@ -327,7 +329,8 @@ class Action
|
|||
*/
|
||||
public function render()
|
||||
{
|
||||
if ($this->view instanceof View) {
|
||||
$view = $this->view;
|
||||
if ($view instanceof View) {
|
||||
$this->view->assignValues($this->ctrlValues);
|
||||
|
||||
/*.Composite.*/$node = null;
|
||||
|
|
@ -369,8 +372,8 @@ class Action
|
|||
$this->_getActionPath()->getPath($this, ($action) ? $action : $request->getAction());
|
||||
}
|
||||
|
||||
function redirect($action) {
|
||||
header('location: ' . $action->toString());
|
||||
function redirect(/*.string.*/$action) {
|
||||
header('location: ' . $action);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue