Minor - set correct setting category, format code, remove unused code

pull/2501/head
jmontoyaa 8 years ago
parent 177a1f090e
commit eabd415fde
  1. 21
      main/inc/global.inc.php
  2. 8
      src/SettingsBundle/Manager/SettingsManager.php

@ -51,13 +51,9 @@ try {
'host_with_path_by_locale'
);
//var_dump($request->getRequestUri());
$request->setBaseUrl($request->getRequestUri());
//var_dump($request->getBaseUrl());
$response = $kernel->handle($request);
//$kernel->boot();
//var_dump($request->getBasePath());
if ($kernel->isInstalled()) {
require_once $kernel->getConfigurationFile();
} else {
@ -70,11 +66,6 @@ try {
}
$append = $kernel->getUrlAppend();
/*$baseUrl = '..';
if (!empty($append)) {
$request->setBaseUrl("/$append/");
}*/
$kernel->setApi($_configuration);
// Ensure that _configuration is in the global scope before loading
@ -85,10 +76,6 @@ try {
// Do not over-use this variable. It is only for this script's local use.
$libraryPath = __DIR__.'/lib/';
// Include the main Chamilo platform library file.
require_once $libraryPath.'api.lib.php';
$container = $kernel->getContainer();
// Connect Chamilo with the Symfony container
@ -105,12 +92,10 @@ try {
$router = $container->get('router');
$requestStack = $container->get('request_stack');
$context = $container->get('router.request_context');
$host = $router->getContext()->getHost();
$context->setBaseUrl($appendValue);
$baseUrl = $router->getContext()->getBaseUrl();
$container->set('router.request_context', $context);
$packages = $container->get('assets.packages');
$version = new Symfony\Component\Asset\VersionStrategy\EmptyVersionStrategy();
@ -186,9 +171,6 @@ try {
// Enables the portability layer and configures PHP for UTF-8
\Patchwork\Utf8\Bootup::initAll();
// Start session after the internationalization library has been initialized.
//ChamiloSession::start($alreadyInstalled);
// access_url == 1 is the default chamilo location
if ($_configuration['access_url'] != 1) {
$url_info = api_get_access_url($_configuration['access_url']);
@ -265,7 +247,6 @@ try {
$_plugins[$key][$row['subkey']] = $row['selected_value'];
}
}
// Error reporting settings.
if (api_get_setting('server_type') == 'test') {
ini_set('display_errors', '1');

@ -156,7 +156,7 @@ class SettingsManager implements SettingsManagerInterface
'show_toolshortcuts' => 'Course',
'allow_group_categories' => 'Course',
'server_type' => 'Platform',
'platformLanguage' => 'language',
'platformLanguage' => 'Language',
'showonline' => 'Platform',
'profile' => 'User',
'default_document_quotum' => 'Course',
@ -253,7 +253,7 @@ class SettingsManager implements SettingsManagerInterface
'students_download_folders' => 'Document',
'users_copy_files' => 'Tools',
'allow_students_to_create_groups_in_social' => 'Tools',
'allow_send_message_to_all_platform_users' => 'Tools',
'allow_send_message_to_all_platform_users' => 'Message',
'message_max_upload_filesize' => 'Tools',
'use_users_timezone' => 'profile', //'use_users_timezone' => 'Timezones',
'timezone_value' => 'platform', //'timezone_value' => 'Timezones',
@ -646,7 +646,7 @@ class SettingsManager implements SettingsManagerInterface
// This code allows the possibility of calling
// api_get_setting('allow_skills_tool') instead of
// the correct way api_get_setting('platform.allow_skills_tool')
// the "correct" way api_get_setting('platform.allow_skills_tool')
$items = $this->getVariablesAndCategories();
if (isset($items[$name])) {
@ -663,8 +663,6 @@ class SettingsManager implements SettingsManagerInterface
}
list($category, $name) = explode('.', $name);
//var_dump($category, $name);
$settings = $this->load($category, $name);
return $settings->get($name);

Loading…
Cancel
Save