Пример #1
0
 /**
  * @inheritdoc
  */
 public function upConfig()
 {
     // Adding the USER component
     ModelConfig::addConfig(NULL, 'components', 'user', 'class', 'amnah\\yii2\\user\\components\\User', FALSE);
     ModelConfig::addConfig(NULL, 'components', 'user', 'identityClass', 'amnah\\yii2\\user\\models\\User', FALSE);
     ModelConfig::addConfig(NULL, 'components', 'user', 'enableAutoLogin', TRUE, FALSE);
     ModelConfig::addConfig(NULL, 'components', 'user', 'enableSession', TRUE, FALSE);
     // Adding Amnah-User module settings
     ModelConfig::addConfig(NULL, 'modules', 'user', 'class', 'amnah\\yii2\\user\\Module', FALSE);
     ModelConfig::addConfig(NULL, 'modules', 'user', 'requireEmail', TRUE, FALSE);
     ModelConfig::addConfig(NULL, 'modules', 'user', 'requireUsername', TRUE, FALSE);
     ModelConfig::addConfig(NULL, 'modules', 'user', 'loginUsername', FALSE, FALSE);
     // Adding bootstrap calling to this module
     ModelConfig::addConfig(NULL, NULL, NULL, 'bootstrap', array('user'), FALSE);
     // Setting translations for user app
     ModelConfig::addConfig(NULL, 'components', 'i18n', 'translations', ['user' => ['class' => 'yii\\i18n\\PhpMessageSource', 'basePath' => '@vendor/amnah/yii2-user/messages']], FALSE);
     ModelConfig::addConfig(NULL, 'components', 'i18n', 'translations', ['atuin-user' => ['class' => 'yii\\i18n\\PhpMessageSource', 'basePath' => '@vendor/atuin/atuin-user/messages']], FALSE);
     // Adding view redirections to use Atuin views instead of the original ones
     ModelConfig::addConfig(NULL, 'components', 'view', 'theme', ['pathMap' => ['@vendor/amnah/yii2-user/views' => '@vendor/atuin/atuin-user/views']], FALSE);
     // Adding layout for backend zone
     ModelConfig::addConfig('app-backend', 'modules', 'user', 'layout', '@vendor/atuin/engine/views/layouts/backend_layout', FALSE);
     $baseUrl = str_replace('/frontend/web', '', \Yii::$app->getRequest()->getBaseUrl());
     $baseUrl = str_replace('/backend/web', '', $baseUrl);
     $baseUrl = str_replace('/admin', '', $baseUrl);
     // Adding alias for login url
     ModelConfig::addConfig(NULL, 'aliases', NULL, '@atuin/loginUrl', $baseUrl . '/admin/login', FALSE);
 }
Пример #2
0
 /**
  * @inheritdoc
  */
 public function upConfig()
 {
     ModelConfig::addConfig('app-frontend', 'modules', 'routes', 'routes_dir', dirname(\Yii::$app->getVendorPath()) . '/atuin/routes/frontend', FALSE);
     ModelConfig::addConfig('app-backend', 'modules', 'routes', 'routes_dir', dirname(\Yii::$app->getVendorPath()) . '/atuin/routes/backend', FALSE);
     ModelConfig::addConfig(NULL, 'modules', 'routes', 'activate_database_routes', 1, FALSE);
     ModelConfig::addConfig(NULL, 'modules', 'routes', 'class', 'cyneek\\yii2\\routes\\Module', FALSE);
     ModelConfig::addConfig(NULL, 'components', 'route', 'class', 'cyneek\\yii2\\routes\\components\\route', FALSE);
     // adding bootstrap calls
     ModelConfig::addConfig(NULL, NULL, NULL, 'bootstrap', array('routes'), FALSE);
 }
Пример #3
0
 /**
  * @inheritdoc
  */
 public function upConfig()
 {
     // Setting translations for engine
     ModelConfig::addConfig(NULL, 'components', 'i18n', 'translations', ['admin' => ['class' => 'yii\\i18n\\PhpMessageSource', 'basePath' => '@vendor/atuin/engine/messages'], 'atuin-installation' => ['class' => 'yii\\i18n\\PhpMessageSource', 'basePath' => '@vendor/atuin/engine/messages'], 'menu' => ['class' => 'yii\\i18n\\PhpMessageSource', 'basePath' => '@vendor/atuin/engine/messages']], FALSE);
     // Adding basic theme suport
     ModelConfig::addConfig(NULL, 'components', 'view', 'theme', ['pathMap' => ['@vendor/atuin/engine/views' => '@vendor/atuin/engine/themes/basic', '@vendor/atuin/engine' => '@vendor/atuin/engine/themes/basic']], FALSE);
     // Adds HomeUrl and RequestUrl for backend and frontend
     $base_directory = '/' . basename(dirname(\Yii::$app->getVendorPath()));
     ModelConfig::addConfig('app-backend', 'components', 'request', 'baseUrl', $base_directory . '/admin', FALSE);
     ModelConfig::addConfig('app-backend', NULL, NULL, 'homeUrl', $base_directory . '/admin', FALSE);
     ModelConfig::addConfig('app-frontend', 'components', 'request', 'baseUrl', $base_directory, FALSE);
     ModelConfig::addConfig('app-frontend', NULL, NULL, 'homeUrl', $base_directory, FALSE);
     // Adding Kartik GridView as basic grid
     ModelConfig::addConfig(NULL, 'modules', 'gridview', 'class', '\\kartik\\grid\\Module', FALSE);
     // Adding basic app market url
     ModelConfig::addConfig('app-backend', 'modules', 'apps', 'appMarketUrls', ['http://webhost.zoltan.es/appMarket.json'], TRUE);
 }
Пример #4
0
 /**
  * Adds the basic module data configuration
  *
  * @param App $app_record
  */
 protected function normalizeModuleConfig($app_record)
 {
     $appConnectionsModel = new ModelAppConnections();
     Filters::registerAction([Config::className(), Config::EVENT_AFTER_INSERT], [$appConnectionsModel, 'insertConnectionFromFilter'], $app_record);
     // Adds the class to the module config
     ModelConfig::addConfig(NULL, 'modules', $app_record->app_id, 'class', $app_record->className, FALSE);
     // Adds the alias to the module config
     ModelConfig::addConfig(NULL, 'aliases', NULL, $app_record->alias, $app_record->directory, FALSE);
     Filters::unRegisterAction([Config::className(), Config::EVENT_AFTER_INSERT]);
 }
Пример #5
0
 public function titleInstallation()
 {
     ModelConfig::addConfig(NULL, 'params', NULL, 'title', $this->title, FALSE);
     ConfigFilesManager::generateConfigFiles();
 }