Skip to content

Commit

Permalink
Fix visual glitch when no language is found
Browse files Browse the repository at this point in the history
  • Loading branch information
nitriques committed Oct 27, 2014
1 parent 099039a commit fa146d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extension.driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ public function initializeAdmin($context) {
//language redirect cases
if ($codes == '' || $codes == null) $codes = Symphony::Configuration()->get('language_codes', 'language_redirect');
if ($codes == '' || $codes == null) $codes = Symphony::Configuration()->get('languages', 'language_redirect');
$languages = array_map('trim',explode(',', $codes ));
$languages = array_filter(array_map('trim',explode(',', $codes )));

// CSS & JS for all admin
$page->addStylesheetToHead($assets_path . '/language_switcher.css', 'all', $LOAD_NUMBER++);
$script = new XMLElement('script');
$script->setAttributeArray(array('type' => 'text/javascript'));
$script->setValue(sprintf(
"
Symphony.Languages = ['%s'];
Symphony.Languages = %s;
Symphony.Author = {
id : %d,
default_section : %d,
Expand All @@ -53,7 +53,7 @@ public function initializeAdmin($context) {
language : '%s'
};
",
implode("','", $languages),
empty($languages) ? '[]' : "['" . implode("','", $languages) . "']",
$author->get('id'),
$author->get('default_section'),
$author->get('email'),
Expand Down
3 changes: 3 additions & 0 deletions extension.meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
</author>
</authors>
<releases>
<release version="1.2.3" date="TBA" min="2.3.0" max="2.5.x">
* Fix visual glitch when no language is found
</release>
<release version="1.2.2" date="201-11-06" min="2.3.0" max="2.5.x">
* Minor update for 2.5.x
</release>
Expand Down

0 comments on commit fa146d0

Please sign in to comment.