Skip to content

Commit e9a5f32

Browse files
Merge pull request #5759 from christianbeeznest/GH-5316-2
Internal: Add variable settings to .env.dist and plugin.yaml import - refs #5316
2 parents 34d7e66 + 663df02 commit e9a5f32

File tree

8 files changed

+27
-24
lines changed

8 files changed

+27
-24
lines changed

.env.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ SOFTWARE_NAME='{{SOFTWARE_NAME}}'
6969
SOFTWARE_URL='{{SOFTWARE_URL}}'
7070
DENY_DELETE_USERS='{{DENY_DELETE_USERS}}'
7171
HOSTING_TOTAL_SIZE_LIMIT='{{HOSTING_TOTAL_SIZE_LIMIT}}'
72+
THEME_FALLBACK='{{THEME_FALLBACK}}'
73+
PACKAGER='{{PACKAGER}}'
74+
DEFAULT_TEMPLATE='{{DEFAULT_TEMPLATE}}'
75+
ADMIN_CHAMILO_ANNOUNCEMENTS_DISABLE='{{ADMIN_CHAMILO_ANNOUNCEMENTS_DISABLE}}'

config/plugin.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
parameters:
2+
plugin_settings:
3+
urls:
4+
1:
5+
plugin_name: 'bbb'
6+
tool_enable: 'true'
7+
host: 'https://www.example.com'
8+
salt: 'abc123'

config/services.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ cocur_slugify:
115115
lowercase: true
116116

117117
imports:
118-
- {resource: ../src/CoreBundle/Resources/config/services.yml}
119-
- {resource: ../src/LtiBundle/Resources/config/services.yml}
118+
- { resource: ../src/CoreBundle/Resources/config/services.yml }
119+
- { resource: ../src/LtiBundle/Resources/config/services.yml }
120120
- { resource: ./authentication.yaml }
121-
- {resource: ./hosting_limits.yml}
121+
- { resource: ./hosting_limits.yml }
122+
- { resource: ./plugin.yaml }

public/main/inc/ajax/admin.ajax.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,7 @@ function check_system_version()
178178

179179
// The number of sessions
180180
$number_of_sessions = SessionManager::count_sessions(api_get_current_access_url_id());
181-
$packager = api_get_setting('platform.packager');
182-
if (empty($packager)) {
183-
$packager = 'chamilo';
184-
}
181+
$packager = api_get_env_variable('PACKAGER', 'chamilo');
185182

186183
$uniqueId = '';
187184
$entityManager = Database::getManager();

public/main/inc/lib/template.lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function __construct(
136136
//$this->set_footer($show_footer);
137137
//$this->set_header($show_header);
138138

139-
$defaultStyle = api_get_setting('display.default_template');
139+
$defaultStyle = api_get_env_variable('DEFAULT_TEMPLATE', 'default');
140140
if (!empty($defaultStyle)) {
141141
$this->templateFolder = $defaultStyle;
142142
}
@@ -386,7 +386,7 @@ public static function findTemplateFilePath($name)
386386
return "overrides/$name";
387387
}
388388

389-
$defaultFolder = api_get_configuration_value('default_template');
389+
$defaultFolder = api_get_env_variable('DEFAULT_TEMPLATE', 'default');
390390

391391
// If a template folder has been manually defined, search for the right
392392
// file, and if not found, go for the same file in the default template

public/main/install/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,10 @@
484484
'{{SOFTWARE_URL}}' => $institutionUrlForm,
485485
'{{DENY_DELETE_USERS}}' => '0',
486486
'{{HOSTING_TOTAL_SIZE_LIMIT}}' => '0',
487+
'{{THEME_FALLBACK}}' => 'chamilo',
488+
'{{PACKAGER}}' => 'chamilo',
489+
'{{DEFAULT_TEMPLATE}}' => 'default',
490+
'{{ADMIN_CHAMILO_ANNOUNCEMENTS_DISABLE}}' => '0',
487491
];
488492
error_log('Update env file');
489493
updateEnvFile($distFile, $envFile, $params);

public/main/install/install.lib.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,6 +1346,10 @@ function updateEnvFile($distFile, $envFile, $params)
13461346
'SOFTWARE_URL',
13471347
'DENY_DELETE_USERS',
13481348
'HOSTING_TOTAL_SIZE_LIMIT',
1349+
'THEME_FALLBACK',
1350+
'PACKAGER',
1351+
'DEFAULT_TEMPLATE',
1352+
'ADMIN_CHAMILO_ANNOUNCEMENTS_DISABLE',
13491353
];
13501354

13511355
foreach ($requirements as $requirement) {

src/CoreBundle/DataFixtures/SettingsCurrentFixtures.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,11 +1641,6 @@ public static function getNewConfigurationSettings(): array
16411641
],
16421642
],
16431643
'admin' => [
1644-
[
1645-
'name' => 'admin_chamilo_announcements_disable',
1646-
'title' => 'Disable editor announcements',
1647-
'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.",
1648-
],
16491644
[
16501645
'name' => 'drh_allow_access_to_all_students',
16511646
'title' => 'HRM can access all students from reporting pages',
@@ -1871,11 +1866,6 @@ public static function getNewConfigurationSettings(): array
18711866
'title' => 'Bug report link',
18721867
'comment' => 'Provide link to a bug reporting platform if not using the internal ticket manager.',
18731868
],
1874-
[
1875-
'name' => 'default_template',
1876-
'title' => 'Layout template',
1877-
'comment' => 'Provide the name of the template folder from main/template/ to change the appearance and structure of this portal.',
1878-
],
18791869
[
18801870
'name' => 'disable_copy_paste',
18811871
'title' => 'Disable copy-pasting',
@@ -1962,11 +1952,6 @@ public static function getNewConfigurationSettings(): array
19621952
],
19631953
],
19641954
'platform' => [
1965-
[
1966-
'name' => 'default_template',
1967-
'title' => 'Layout template',
1968-
'comment' => 'Provide the name of the template folder from main/template/ to change the appearance and structure of this portal.',
1969-
],
19701955
[
19711956
'name' => 'allow_double_validation_in_registration',
19721957
'title' => 'Double validation for registration process',

0 commit comments

Comments
 (0)