Example #1
0
 public function __construct()
 {
     $this->config = Registry::get('config');
     $this->Frame = Registry::frame('front');
     $this->Router = Registry::router();
     $this->currentPath = implode('/', $this->Router->explodeRoute());
     $this->Frame->bindView('menu', $this->buildMenu());
 }
 public function __construct($ModuleDirectory = null)
 {
     $this->ModuleDirectory = $ModuleDirectory;
     $this->ModuleInstaller = new ModuleInstaller();
     $this->Response = new Response(SCMSNotificationLog::instance());
     $this->config = Registry::get('config');
     $this->Frame = Registry::frame('back');
     $this->Router = Registry::router();
     $this->EmployeeAuthentication = new Authentication();
     $this->HTTPEmployeeAuthentication = new HttpAuthentication();
     $this->Frame->addCss('/public/assets/js/fancybox2/source/jquery.fancybox.css');
     $this->Frame->bindView('menu', $this->buildMenu());
     $this->Frame->bindView('modal-notification', new ViewNotificationsModal());
     $this->Frame->bindView('modal-confirmation', new ViewConfirmationModal());
     $this->Frame->bindView('modal-information', new ViewInformationModal());
 }
Example #3
0
 public function actionIndex()
 {
     $error = Param::get('error', false)->asInteger(false);
     $frame = Registry::frame('back_clear');
     $view = new ViewAuthorization();
     if (!is_null($error)) {
         switch ($error) {
             case 0:
                 $view->errorText = 'Неверный email или пароль.';
                 break;
             default:
                 $view->errorText = 'Произошла неизвестная ошибка.';
         }
     }
     $frame->bindView('modal-notification', new ViewNotificationsModal());
     $frame->bindView('modal-confirmation', new ViewConfirmationModal());
     $frame->bindView('modal-information', new ViewInformationModal());
     $frame->bindView('content', $view);
     $frame->render();
 }
 protected function getActiveFrame(Structure $oStructure)
 {
     return $oStructure->frame != '' ? Registry::frame($oStructure->frame) : $this->Frame;
 }
Example #5
0
}
SCMSNotificationLog::instance()->setProductionMode();
//NotificationLog::instance()->setDevelopMode();
DataSource::setup('mysql', include 'App' . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . 'mysql.php');
DataSource::setCurrent('mysql');
Registry::set('config', include 'App/Config/project.php', true);
Registry::set('credits', include 'credits.php');
// Пользовательская часть
Registry::set('front', new Frame(SFW_APP_ROOT . 'Frames' . DIRECTORY_SEPARATOR), true);
Registry::frame('front')->setFrame('front')->addCss('/public/assets/js/bower_components/bootstrap/dist/css/bootstrap.css')->addCss('/public/assets/css/general.css')->addCss('/public/assets/css/main-menu.css')->addCss('/public/assets/css/carousel-actions.css')->addJs('/public/assets/js/bower_components/requirejs/require.js', ['data-main' => '/public/assets/js/appconfig'])->addMeta(['http-equiv' => 'content-type', 'content' => 'text/html; charset=utf-8'])->addMeta(['name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0'])->setFavicon(Registry::get('config')['favicon']);
// Панель управления
Registry::set('back', new Frame(SFW_APP_ROOT . 'Frames' . DIRECTORY_SEPARATOR), true);
Registry::frame('back')->setFrame('back')->addCss('/public/assets/js/bower_components/bootstrap/dist/css/bootstrap.css')->addJs('/public/assets/js/bower_components/requirejs/require.js', ['data-main' => '/public/assets/js/appconfig'])->addMeta(['http-equiv' => 'content-type', 'content' => 'text/html; charset=utf-8'])->addMeta(['name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0'])->setFavicon(Registry::get('config')['favicon']);
// "Чистая" панель управления
Registry::set('back_clear', new Frame(SFW_APP_ROOT . 'Frames' . DIRECTORY_SEPARATOR), true);
Registry::frame('back_clear')->setFrame('back_clear')->addCss('/public/assets/js/bower_components/bootstrap/dist/css/bootstrap.css')->addJs('/public/assets/js/bower_components/requirejs/require.js', ['data-main' => '/public/assets/js/appconfig'])->addMeta(['http-equiv' => 'content-type', 'content' => 'text/html; charset=utf-8'])->addMeta(['name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0'])->setFavicon(Registry::get('config')['favicon']);
// Роутинг
$configFileName = 'App' . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . 'route.php';
if (file_exists($configFileName)) {
    Registry::set('router', new Router(), true);
    $router = Registry::router();
    $router->setConfig(include $configFileName);
    $router->setRoute($_SERVER['REQUEST_URI']);
    try {
        $router->route();
    } catch (Exception $e) {
        SCMSNotificationLog::instance()->DBLogger->error($e->getMessage());
        $response = new Response(SCMSNotificationLog::instance());
        SCMSNotificationLog::instance()->pushAny(SCMSNotificationLog::TYPE_MESSAGE, $e->getMessage(), $e->getCode());
        $response->send();
    }