Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,7 @@ SOFTWARE_NAME='{{SOFTWARE_NAME}}'
SOFTWARE_URL='{{SOFTWARE_URL}}'
DENY_DELETE_USERS='{{DENY_DELETE_USERS}}'
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}}'
8 changes: 8 additions & 0 deletions config/plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
parameters:
plugin_settings:
urls:
1:
plugin_name: 'bbb'
tool_enable: 'true'
host: 'https://www.example.com'
salt: 'abc123'
7 changes: 4 additions & 3 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ cocur_slugify:
lowercase: true

imports:
- {resource: ../src/CoreBundle/Resources/config/services.yml}
- {resource: ../src/LtiBundle/Resources/config/services.yml}
- { resource: ../src/CoreBundle/Resources/config/services.yml }
- { resource: ../src/LtiBundle/Resources/config/services.yml }
- { resource: ./authentication.yaml }
- {resource: ./hosting_limits.yml}
- { resource: ./hosting_limits.yml }
- { resource: ./plugin.yaml }
5 changes: 1 addition & 4 deletions public/main/inc/ajax/admin.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,7 @@ function check_system_version()

// The number of sessions
$number_of_sessions = SessionManager::count_sessions(api_get_current_access_url_id());
$packager = api_get_setting('platform.packager');
if (empty($packager)) {
$packager = 'chamilo';
}
$packager = api_get_env_variable('PACKAGER', 'chamilo');

$uniqueId = '';
$entityManager = Database::getManager();
Expand Down
4 changes: 2 additions & 2 deletions public/main/inc/lib/template.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function __construct(
//$this->set_footer($show_footer);
//$this->set_header($show_header);

$defaultStyle = api_get_setting('display.default_template');
$defaultStyle = api_get_env_variable('DEFAULT_TEMPLATE', 'default');
if (!empty($defaultStyle)) {
$this->templateFolder = $defaultStyle;
}
Expand Down Expand Up @@ -386,7 +386,7 @@ public static function findTemplateFilePath($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
// file, and if not found, go for the same file in the default template
Expand Down
4 changes: 4 additions & 0 deletions public/main/install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@
'{{SOFTWARE_URL}}' => $institutionUrlForm,
'{{DENY_DELETE_USERS}}' => '0',
'{{HOSTING_TOTAL_SIZE_LIMIT}}' => '0',
'{{THEME_FALLBACK}}' => 'chamilo',
'{{PACKAGER}}' => 'chamilo',
'{{DEFAULT_TEMPLATE}}' => 'default',
'{{ADMIN_CHAMILO_ANNOUNCEMENTS_DISABLE}}' => '0',
];
error_log('Update env file');
updateEnvFile($distFile, $envFile, $params);
Expand Down
4 changes: 4 additions & 0 deletions public/main/install/install.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1346,6 +1346,10 @@ function updateEnvFile($distFile, $envFile, $params)
'SOFTWARE_URL',
'DENY_DELETE_USERS',
'HOSTING_TOTAL_SIZE_LIMIT',
'THEME_FALLBACK',
'PACKAGER',
'DEFAULT_TEMPLATE',
'ADMIN_CHAMILO_ANNOUNCEMENTS_DISABLE',
];

foreach ($requirements as $requirement) {
Expand Down
15 changes: 0 additions & 15 deletions src/CoreBundle/DataFixtures/SettingsCurrentFixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -1641,11 +1641,6 @@ public static function getNewConfigurationSettings(): array
],
],
'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',
'title' => 'HRM can access all students from reporting pages',
Expand Down Expand Up @@ -1871,11 +1866,6 @@ public static function getNewConfigurationSettings(): array
'title' => 'Bug report link',
'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',
'title' => 'Disable copy-pasting',
Expand Down Expand Up @@ -1962,11 +1952,6 @@ public static function getNewConfigurationSettings(): array
],
],
'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',
'title' => 'Double validation for registration process',
Expand Down
Loading