Правки namespace
This commit is contained in:
parent
ee06f1febb
commit
524b27936a
39 changed files with 141 additions and 120 deletions
|
|
@ -10,6 +10,8 @@ use ctiso\Shortcut,
|
|||
ctiso\HttpRequest,
|
||||
ctiso\Functions,
|
||||
ctiso\Settings,
|
||||
ctiso\View\Composite,
|
||||
ctiso\View\View,
|
||||
ctiso\Controller\State;
|
||||
|
||||
/**
|
||||
|
|
@ -82,18 +84,15 @@ class Action
|
|||
return Path::join($basePath, "modules", $name);
|
||||
}
|
||||
|
||||
public function addSuggest(View $view, $name)
|
||||
{
|
||||
public function addSuggest(View $view, $name) {
|
||||
$suggest = array();
|
||||
$file = Path::join($this->modulePath, 'help', $name . '.suggest');
|
||||
if (file_exists($file)) {
|
||||
include($file);
|
||||
$view->suggestions = $suggest;
|
||||
$view->suggestions = include($file);
|
||||
}
|
||||
}
|
||||
|
||||
function findIcon($icon, $size)
|
||||
{
|
||||
function findIcon($icon, $size) {
|
||||
$webPath = $this->settings['web'];
|
||||
return Path::join($webPath, 'icons', $size . 'x' . $size, $icon . '.png');
|
||||
}
|
||||
|
|
@ -122,7 +121,7 @@ class Action
|
|||
if(file_exists($template)) { break; }
|
||||
}
|
||||
|
||||
/*.View_Composite.*/$tpl = new $viewClass($template);
|
||||
/*.Composite.*/$tpl = new $viewClass($template);
|
||||
|
||||
$stylePath = Path::join($webPath, "assets", "css");
|
||||
$iconsPath = Path::join($webPath, 'icons');
|
||||
|
|
@ -170,7 +169,7 @@ class Action
|
|||
$action = "actionIndex";
|
||||
}
|
||||
$view = $this->forward($action, $request);
|
||||
if ($view instanceof View_View) {
|
||||
if ($view instanceof View) {
|
||||
$view->active_module = get_class($this);
|
||||
$view->module_action = $action;
|
||||
}
|
||||
|
|
@ -208,7 +207,7 @@ class Action
|
|||
*/
|
||||
public function nUrl($name, array $param = array())
|
||||
{
|
||||
/*.Filter_ActionAccess.*/$access = $this->access;
|
||||
/*.ActionAccess.*/$access = $this->access;
|
||||
|
||||
if ($access == null || $access->checkAction($name)) {
|
||||
$param = array_merge(array(
|
||||
|
|
@ -295,12 +294,12 @@ class Action
|
|||
/**
|
||||
* Добавление widget к отображению
|
||||
*/
|
||||
public function addChild(/*Widgets_Widget*/ $section, $node)
|
||||
public function addChild($section, $node)
|
||||
{
|
||||
$this->childNodes[$section] = $node;
|
||||
}
|
||||
|
||||
public function setValue(/*Widgets_Widget*/ $name, $value)
|
||||
public function setValue($name, $value)
|
||||
{
|
||||
$this->ctrlValues[$name] = $value;
|
||||
}
|
||||
|
|
@ -308,7 +307,7 @@ class Action
|
|||
/**
|
||||
* Добавление дочернего отображения к текущему отображению
|
||||
*/
|
||||
public function addView(/*CompositeView*/ $section, $node)
|
||||
public function addView($section, $node)
|
||||
{
|
||||
$this->childViews[$section] = $node;
|
||||
}
|
||||
|
|
@ -322,7 +321,7 @@ class Action
|
|||
if ($this->view instanceof View_View) {
|
||||
$this->view->assignValues($this->ctrlValues);
|
||||
|
||||
/*.Widgets_Widget.*/$node = null;
|
||||
/*.Composite.*/$node = null;
|
||||
foreach ($this->childNodes as $name => $node) {
|
||||
$node->make($this);
|
||||
$this->view->setView($name, $node->view);
|
||||
|
|
@ -335,8 +334,7 @@ class Action
|
|||
return $this->view;
|
||||
}
|
||||
|
||||
function getPageId(HttpRequest $request)
|
||||
{
|
||||
function getPageId(HttpRequest $request) {
|
||||
$pageId = time();
|
||||
$request->session()->set('page', $pageId);
|
||||
return $pageId;
|
||||
|
|
@ -353,19 +351,17 @@ class Action
|
|||
return $result;
|
||||
}
|
||||
|
||||
function _getActionPath()
|
||||
{
|
||||
function _getActionPath() {
|
||||
return new State('index');
|
||||
}
|
||||
|
||||
// Тоже убрать в метод Controller_Model
|
||||
function getActionPath(HttpRequest $request, $action = null)
|
||||
{
|
||||
function getActionPath(HttpRequest $request, $action = null) {
|
||||
$this->_getActionPath()->getPath($this, ($action) ? $action : $request->getAction());
|
||||
}
|
||||
|
||||
function redirect($action) {
|
||||
header('location: ' . $this->fUrl($action));
|
||||
header('location: ' . $action->toString());
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue