Minor - Fixed language variable name in assignments

remotes/angel/1.11.x
Yannick Warnier 8 years ago
parent aae7d25e79
commit 7d38be5584
  1. 39
      app/Migrations/Schema/V111/Version20160712150000.php
  2. 9
      main/inc/lib/display.lib.php
  3. 6
      main/install/data.sql

@ -0,0 +1,39 @@
<?php
/* For licensing terms, see /license.txt */
namespace Application\Migrations\Schema\V111;
use Application\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Type;
/**
* Class Version20160712150000
* Add option to use SVG icons instead of their PNG version
* @package Application\Migrations\Schema\V111
*/
class Version20160712150000 extends AbstractMigrationChamilo
{
/**
* @param Schema $schema
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Schema\SchemaException
*/
public function up(Schema $schema)
{
$this->addSql("INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('icons_mode_svg', NULL, 'radio', 'Tuning', 'false', 'IconsModeSVGTitle','IconsModeSVGComment','',NULL, 1)");
$this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('icons_mode_svg','true','Yes') ");
$this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('icons_mode_svg','false','No') ");
}
/**
* @param Schema $schema
* @throws \Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Schema\SchemaException
*/
public function down(Schema $schema)
{
$this->addSql("DELETE FROM settings_current WHERE variable = 'icons_mode_svg'");
$this->addSql("DELETE FROM settings_options WHERE variable = 'icons_mode_svg'");
}
}

@ -777,10 +777,9 @@ class Display
// it checks if there is an SVG version. If so, it uses it. // it checks if there is an SVG version. If so, it uses it.
// When moving this to production, the return_icon() calls should // When moving this to production, the return_icon() calls should
// ask for the SVG version directly // ask for the SVG version directly
$testServer = api_get_setting('server_type'); $svgIcons = api_get_setting('icons_mode_svg');
if ($testServer == 'test' && $return_only_path == false) { if ($svgIcons == 'true' && $return_only_path == false) {
// if you want to uncomment this add a setting $svgImage = substr($image, 0, -3) . 'svg';
/*$svgImage = substr($image, 0, -3) . 'svg';
if (is_file($code_path . $theme . 'svg/' . $svgImage)) { if (is_file($code_path . $theme . 'svg/' . $svgImage)) {
$icon = $w_code_path . $theme . 'svg/' . $svgImage; $icon = $w_code_path . $theme . 'svg/' . $svgImage;
} elseif (is_file($code_path . 'img/icons/svg/' . $svgImage)) { } elseif (is_file($code_path . 'img/icons/svg/' . $svgImage)) {
@ -792,7 +791,7 @@ class Display
} }
if (empty($additional_attributes['width'])) { if (empty($additional_attributes['width'])) {
$additional_attributes['width'] = $size; $additional_attributes['width'] = $size;
}*/ }
} }
$icon = api_get_cdn_path($icon); $icon = api_get_cdn_path($icon);

@ -1889,3 +1889,9 @@ INSERT INTO access_url_rel_course_category (access_url_id, course_category_id) V
UPDATE settings_current SET selected_value = '1.11.0.5' WHERE variable = 'chamilo_database_version'; UPDATE settings_current SET selected_value = '1.11.0.5' WHERE variable = 'chamilo_database_version';
INSERT INTO extra_field (extra_field_type, field_type, variable, display_text, visible, changeable, created_at) VALUES (8, 10, 'tags', 'Tags', 1, 1, NOW()); INSERT INTO extra_field (extra_field_type, field_type, variable, display_text, visible, changeable, created_at) VALUES (8, 10, 'tags', 'Tags', 1, 1, NOW());
UPDATE settings_current SET selected_value = '1.11.0.6' WHERE variable = 'chamilo_database_version';
INSERT INTO settings_current (variable, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('icons_mode_svg', NULL, 'radio', 'Tuning', 'false', 'IconsModeSVGTitle', 'IconsModeSVGComment', '', NULL, 1);
INSERT INTO settings_options (variable, value, display_text) VALUES ('icons_mode_svg', 'true', 'Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('icons_mode_svg', 'false', 'No');

Loading…
Cancel
Save