Skip to content

Commit 992626f

Browse files
Merge pull request #7167 from christianbeeznest/fixes-updates198
Settings: Remove deprecated 'icons_mode_svg' setting from settings.
2 parents 4f222e5 + 1f92ffa commit 992626f

File tree

5 files changed

+35
-19
lines changed

5 files changed

+35
-19
lines changed

public/main/inc/lib/display.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ public static function return_icon(
714714
// it checks if there is an SVG version. If so, it uses it.
715715
// When moving this to production, the return_icon() calls should
716716
// ask for the SVG version directly
717-
$svgIcons = api_get_setting('icons_mode_svg');
717+
$svgIcons = 'true';
718718
if ('true' == $svgIcons && false == $return_only_path) {
719719
$svgImage = substr($image, 0, -3).'svg';
720720
if (is_file($code_path.$theme.'svg/'.$svgImage)) {

src/CoreBundle/DataFixtures/SettingsCurrentFixtures.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -687,11 +687,6 @@ public static function getExistingSettings(): array
687687
'title' => 'Hide logout button',
688688
'comment' => 'Hide the logout button. This is usually only interesting when using an external login/logout method, for example when using Single Sign On of some sort.',
689689
],
690-
[
691-
'name' => 'icons_mode_svg',
692-
'title' => 'SVG icons mode',
693-
'comment' => 'By enabling this option, all icons that have an SVG version will prefer the SVG format to PNG. This will give a much better icons quality but some icons might still have some rendering size issue, and some browsers might not support it.',
694-
],
695690
],
696691
'language' => [
697692
[

src/CoreBundle/Helpers/ChamiloHelper.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,13 @@ public static function getPlatformLogoPath(
113113
}
114114
$themeDir = Template::getThemeDir($theme);
115115
$customLogoPath = $themeDir.\sprintf('images/header-logo-custom%s.png', $accessUrlId);
116-
117-
$svgIcons = api_get_setting('icons_mode_svg');
118-
if ('true' === $svgIcons) {
119-
$customLogoPathSVG = substr($customLogoPath, 0, -3).'svg';
120-
if (file_exists(api_get_path(SYS_PUBLIC_PATH).\sprintf('css/%s', $customLogoPathSVG))) {
121-
if ($getSysPath) {
122-
return api_get_path(SYS_PUBLIC_PATH).\sprintf('css/%s', $customLogoPathSVG);
123-
}
124-
125-
return api_get_path(WEB_CSS_PATH).$customLogoPathSVG;
116+
$customLogoPathSVG = substr($customLogoPath, 0, -3).'svg';
117+
if (file_exists(api_get_path(SYS_PUBLIC_PATH).\sprintf('css/%s', $customLogoPathSVG))) {
118+
if ($getSysPath) {
119+
return api_get_path(SYS_PUBLIC_PATH).\sprintf('css/%s', $customLogoPathSVG);
126120
}
121+
122+
return api_get_path(WEB_CSS_PATH).$customLogoPathSVG;
127123
}
128124
if (file_exists(api_get_path(SYS_PUBLIC_PATH).\sprintf('css/%s', $customLogoPath))) {
129125
if ($getSysPath) {
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/* For licensing terms, see /license.txt */
6+
7+
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
8+
9+
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
10+
use Doctrine\DBAL\Schema\Schema;
11+
12+
final class Version20251213184300 extends AbstractMigrationChamilo
13+
{
14+
public function getDescription(): string
15+
{
16+
return "Remove deprecated 'icons_mode_svg' setting from settings.";
17+
}
18+
19+
public function up(Schema $schema): void
20+
{
21+
$this->addSql("DELETE FROM settings WHERE variable = 'icons_mode_svg'");
22+
}
23+
24+
public function down(Schema $schema): void
25+
{
26+
// Intentionally left empty: the setting is removed from code/schema.
27+
}
28+
}

src/CoreBundle/Settings/DisplaySettingsSchema.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ public function buildSettings(AbstractSettingsBuilder $builder): void
5353
'show_hot_courses' => 'true',
5454
'hide_home_top_when_connected' => 'false',
5555
'hide_logout_button' => 'false',
56-
'icons_mode_svg' => 'false',
5756
'hide_social_media_links' => 'false',
58-
5957
'gravatar_enabled' => 'false',
6058
'gravatar_type' => 'mm',
6159
'order_user_list_by_official_code' => 'false',
@@ -124,7 +122,6 @@ public function buildForm(FormBuilderInterface $builder): void
124122
->add('show_hot_courses', YesNoType::class)
125123
->add('hide_home_top_when_connected', YesNoType::class)
126124
->add('hide_logout_button', YesNoType::class)
127-
->add('icons_mode_svg', YesNoType::class)
128125
->add('hide_social_media_links', YesNoType::class)
129126
->add('gravatar_enabled', YesNoType::class)
130127
->add(

0 commit comments

Comments
 (0)