Project

General

Profile

Feature #7950

New platform settings [master]

Added by Julio Montoya over 3 years ago. Updated over 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Administration
Target version:
Start date:
06/11/2015
Due date:
% Done:

0%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

I'm working into the replacement of the platform settings in favor of the SettingsBundle based in Sylius Setting bundle:

http://docs.sylius.org/en/latest/bundles/SyliusSettingsBundle/summary.html

For every new platform setting a new option should be created in a PHP file,
for example here:

https://github.com/chamilo/chamilo-lms/blob/master/src/Chamilo/CoreBundle/Settings/PlatformSettingsSchema.php


Related issues

Related to Chamilo LMS - Feature #7935: Migration from 1.10.x to 2.0 [master]Needs testing02/11/2015

Actions

History

#1

Updated by Julio Montoya over 3 years ago

  • Category set to Administration
  • Target version set to 2.0
#2

Updated by Julio Montoya over 3 years ago

I did some changes in some settings:

<?php

// Settings to update
$settings = [
    'Institution' => 'institution',
    'SiteName' => 'site_name',
    'InstitutionUrl' => 'institution_url',
    'registration' => 'required_profile_fields',
    'profile' => 'changeable_options',
    'EmailAdministrator' => 'administrator_email',
    'administratorSurname' => 'administrator_surname',
    'administratorName' => 'administrator_name',
    'administratorTelephone' => 'administrator_phone',
    'timezone_value' => 'timezone',
    'stylesheets' => 'theme',    
    'platformLanguage' => 'platform_language',
    'languagePriority1' => 'language_priority_1',
    'languagePriority2' => 'language_priority_2',
    'languagePriority3' => 'language_priority_3',
    'languagePriority4' => 'language_priority_4',
    'gradebook_score_display_coloring' => 'my_display_coloring',
    'document_if_file_exists_option' => 'if_file_exists_option',
    'ProfilingFilterAddingUsers' => 'profiling_filter_adding_users'
];

// Category changes:
// variable => new_category
$variables =  [
    'cookie_warning' =>  'platform'
];

Now we call the settings like this:

Before:

api_get_setting('Institution');

Now:

api_get_setting('platform.institution');

In twig:

   {{ chamilo_settings_get('platform.institution') }}

   {{ chamilo_settings_all('platform') }} # array with all values for that category

In order to edit all values of that "platform" category go here:

web/app_dev.php/settings/platform

In order to add more settings go here:

src/Chamilo/CoreBundle/Settings/PlatformSettingsSchema.php

Also available in: Atom PDF