Internal: Add variable settings to .env.dist and plugin.yaml import - refs #5316

pull/5759/head
christianbeeznst 1 year ago
parent 34d7e66fb3
commit 663df02389
  1. 4
      .env.dist
  2. 8
      config/plugin.yaml
  3. 7
      config/services.yaml
  4. 5
      public/main/inc/ajax/admin.ajax.php
  5. 4
      public/main/inc/lib/template.lib.php
  6. 4
      public/main/install/index.php
  7. 4
      public/main/install/install.lib.php
  8. 15
      src/CoreBundle/DataFixtures/SettingsCurrentFixtures.php

@ -69,3 +69,7 @@ SOFTWARE_NAME='{{SOFTWARE_NAME}}'
SOFTWARE_URL='{{SOFTWARE_URL}}' SOFTWARE_URL='{{SOFTWARE_URL}}'
DENY_DELETE_USERS='{{DENY_DELETE_USERS}}' DENY_DELETE_USERS='{{DENY_DELETE_USERS}}'
HOSTING_TOTAL_SIZE_LIMIT='{{HOSTING_TOTAL_SIZE_LIMIT}}' HOSTING_TOTAL_SIZE_LIMIT='{{HOSTING_TOTAL_SIZE_LIMIT}}'
THEME_FALLBACK='{{THEME_FALLBACK}}'
PACKAGER='{{PACKAGER}}'
DEFAULT_TEMPLATE='{{DEFAULT_TEMPLATE}}'
ADMIN_CHAMILO_ANNOUNCEMENTS_DISABLE='{{ADMIN_CHAMILO_ANNOUNCEMENTS_DISABLE}}'

@ -0,0 +1,8 @@
parameters:
plugin_settings:
urls:
1:
plugin_name: 'bbb'
tool_enable: 'true'
host: 'https://www.example.com'
salt: 'abc123'

@ -115,7 +115,8 @@ cocur_slugify:
lowercase: true lowercase: true
imports: imports:
- {resource: ../src/CoreBundle/Resources/config/services.yml} - { resource: ../src/CoreBundle/Resources/config/services.yml }
- {resource: ../src/LtiBundle/Resources/config/services.yml} - { resource: ../src/LtiBundle/Resources/config/services.yml }
- { resource: ./authentication.yaml } - { resource: ./authentication.yaml }
- {resource: ./hosting_limits.yml} - { resource: ./hosting_limits.yml }
- { resource: ./plugin.yaml }

@ -178,10 +178,7 @@ function check_system_version()
// The number of sessions // The number of sessions
$number_of_sessions = SessionManager::count_sessions(api_get_current_access_url_id()); $number_of_sessions = SessionManager::count_sessions(api_get_current_access_url_id());
$packager = api_get_setting('platform.packager'); $packager = api_get_env_variable('PACKAGER', 'chamilo');
if (empty($packager)) {
$packager = 'chamilo';
}
$uniqueId = ''; $uniqueId = '';
$entityManager = Database::getManager(); $entityManager = Database::getManager();

@ -136,7 +136,7 @@ class Template
//$this->set_footer($show_footer); //$this->set_footer($show_footer);
//$this->set_header($show_header); //$this->set_header($show_header);
$defaultStyle = api_get_setting('display.default_template'); $defaultStyle = api_get_env_variable('DEFAULT_TEMPLATE', 'default');
if (!empty($defaultStyle)) { if (!empty($defaultStyle)) {
$this->templateFolder = $defaultStyle; $this->templateFolder = $defaultStyle;
} }
@ -386,7 +386,7 @@ class Template
return "overrides/$name"; return "overrides/$name";
} }
$defaultFolder = api_get_configuration_value('default_template'); $defaultFolder = api_get_env_variable('DEFAULT_TEMPLATE', 'default');
// If a template folder has been manually defined, search for the right // If a template folder has been manually defined, search for the right
// file, and if not found, go for the same file in the default template // file, and if not found, go for the same file in the default template

@ -484,6 +484,10 @@ if (isset($_POST['step2'])) {
'{{SOFTWARE_URL}}' => $institutionUrlForm, '{{SOFTWARE_URL}}' => $institutionUrlForm,
'{{DENY_DELETE_USERS}}' => '0', '{{DENY_DELETE_USERS}}' => '0',
'{{HOSTING_TOTAL_SIZE_LIMIT}}' => '0', '{{HOSTING_TOTAL_SIZE_LIMIT}}' => '0',
'{{THEME_FALLBACK}}' => 'chamilo',
'{{PACKAGER}}' => 'chamilo',
'{{DEFAULT_TEMPLATE}}' => 'default',
'{{ADMIN_CHAMILO_ANNOUNCEMENTS_DISABLE}}' => '0',
]; ];
error_log('Update env file'); error_log('Update env file');
updateEnvFile($distFile, $envFile, $params); updateEnvFile($distFile, $envFile, $params);

@ -1346,6 +1346,10 @@ function updateEnvFile($distFile, $envFile, $params)
'SOFTWARE_URL', 'SOFTWARE_URL',
'DENY_DELETE_USERS', 'DENY_DELETE_USERS',
'HOSTING_TOTAL_SIZE_LIMIT', 'HOSTING_TOTAL_SIZE_LIMIT',
'THEME_FALLBACK',
'PACKAGER',
'DEFAULT_TEMPLATE',
'ADMIN_CHAMILO_ANNOUNCEMENTS_DISABLE',
]; ];
foreach ($requirements as $requirement) { foreach ($requirements as $requirement) {

@ -1641,11 +1641,6 @@ class SettingsCurrentFixtures extends Fixture implements FixtureGroupInterface
], ],
], ],
'admin' => [ 'admin' => [
[
'name' => 'admin_chamilo_announcements_disable',
'title' => 'Disable editor announcements',
'comment' => "Choose 'Yes' to stop announcements from the software editor to appear on the administrative homepage (only admins see it). This will also remove security update announcements.",
],
[ [
'name' => 'drh_allow_access_to_all_students', 'name' => 'drh_allow_access_to_all_students',
'title' => 'HRM can access all students from reporting pages', 'title' => 'HRM can access all students from reporting pages',
@ -1871,11 +1866,6 @@ class SettingsCurrentFixtures extends Fixture implements FixtureGroupInterface
'title' => 'Bug report link', 'title' => 'Bug report link',
'comment' => 'Provide link to a bug reporting platform if not using the internal ticket manager.', 'comment' => 'Provide link to a bug reporting platform if not using the internal ticket manager.',
], ],
[
'name' => 'default_template',
'title' => 'Layout template',
'comment' => 'Provide the name of the template folder from main/template/ to change the appearance and structure of this portal.',
],
[ [
'name' => 'disable_copy_paste', 'name' => 'disable_copy_paste',
'title' => 'Disable copy-pasting', 'title' => 'Disable copy-pasting',
@ -1962,11 +1952,6 @@ class SettingsCurrentFixtures extends Fixture implements FixtureGroupInterface
], ],
], ],
'platform' => [ 'platform' => [
[
'name' => 'default_template',
'title' => 'Layout template',
'comment' => 'Provide the name of the template folder from main/template/ to change the appearance and structure of this portal.',
],
[ [
'name' => 'allow_double_validation_in_registration', 'name' => 'allow_double_validation_in_registration',
'title' => 'Double validation for registration process', 'title' => 'Double validation for registration process',

Loading…
Cancel
Save