Синхронизировал частично с CMS2

This commit is contained in:
origami11 2017-02-09 17:14:11 +03:00
parent 6b412f5d6f
commit f2938b1353
30 changed files with 1447 additions and 1099 deletions

View file

@ -1,30 +1,24 @@
<?php
require_once 'core/controller/controller.php';
require_once 'core/controller/installer.php';
/**
* Первичный контроллер контроллер страниц
* @package core
*/
class Controller_Front extends Controller
class Controller_Front extends Controller_Action
{
protected $shortcut; // Ярлык к модулю
protected $_param; // Параметр по которому выбирается модуль
protected $default; // Значение параметра по умолчанию
protected $installer;
public function __construct(Settings $_registry, $_shortcut)
{
require_once 'core/database_pdo.php';
parent::__construct();
$registry = $_registry;
$this->_registry = $_registry;
$this->_shortcut = $_shortcut;
$this->db = Database::getConnection($registry->readKey(array('system', 'dsn')));
$this->installer = new Installer($_registry);
}
@ -36,8 +30,6 @@ class Controller_Front extends Controller
*/
public function loadModule($name, Collection $request)
{
$this->installer->setUp($this->db, array($this, 'installPath'));
$this->installer->doUpdates($name); // ModuleLoader (1)
$moduleFile = Shortcut::getUrl($this->shortcut, $name); // ModuleLoader (2)
$module = $this->loadClass($moduleFile);
@ -59,10 +51,10 @@ class Controller_Front extends Controller
$module->db = $this->db;
// Не для всех приложений нужно вести лог действий
// Ведение лога
$logger = $this->loadClass(FRAMEWORK_PATH . '/core/filter/actionlogger.php', $module);
$logger = $this->loadClass(FRAMEWORK_PATH . '/src/filter/actionlogger.php', $module);
$logger->before = $this->loadSettings(Shortcut::getUrl('logger', $name));
// Управление доступом
$module->access = $this->loadClass(FRAMEWORK_PATH . '/core/filter/actionaccess.php', $logger);
$module->access = $this->loadClass(FRAMEWORK_PATH . '/src/filter/actionaccess.php', $logger);
$module->access->access = $this->loadSettings(Shortcut::getUrl('access', $name));
$module->setUp();