[*] Installer : replaced radio buttons by a select for the installer language list (too many languages)

This commit is contained in:
Damien Metzger
2013-10-08 17:06:02 +02:00
parent 0db2372724
commit 180a778e51
4 changed files with 18 additions and 17 deletions
+10 -1
View File
@@ -65,6 +65,7 @@ class InstallLanguages
foreach (scandir(_PS_INSTALL_LANGS_PATH_) as $lang)
if ($lang[0] != '.' && is_dir(_PS_INSTALL_LANGS_PATH_.$lang) && $lang != self::DEFAULT_ISO && file_exists(_PS_INSTALL_LANGS_PATH_.$lang.'/install.php'))
$this->languages[$lang] = new InstallLanguage($lang);
uasort($this->languages, 'ps_usort_languages');
}
/**
@@ -76,7 +77,6 @@ class InstallLanguages
{
if (!in_array($iso, $this->getIsoList()))
throw new PrestashopInstallerException('Language '.$iso.' not found');
$this->language = $iso;
}
@@ -202,3 +202,12 @@ class InstallLanguages
return false;
}
}
function ps_usort_languages($a, $b)
{
$aname = $a->getMetaInformation('name');
$bname = $b->getMetaInformation('name');
if ($aname == $bname)
return 0;
return ($aname < $bname) ? -1 : 1;
}
+1 -1
View File
@@ -1,7 +1,7 @@
$(document).ready(function()
{
// Submit change of language
$('#langList li input').click(function()
$('#langList').change(function()
{
var form = $('#mainForm');
form.attr('action', form.attr('action')+'#licenses-agreement');
+1 -1
View File
@@ -443,7 +443,7 @@ ul#footer a:link, ul#footer a:active, ul#footer a:visited {
#formSetMethod {padding-bottom:20px;}
#formSetMethod p {padding-bottom:0;}
ul#langList {list-style-type:none;}
#langList {margin-bottom:20px}
/* ETAPE 2 - required ******************************************************* */
#sheet_system #req_bt_refresh {float:right;}
+6 -14
View File
@@ -19,22 +19,14 @@
<!-- List of languages -->
<?php if (count($this->language->getIsoList()) > 1): ?>
<h2><?php echo $this->l('Continue the installation in:') ?></h2>
<ul id="langList" style="line-height: 20px;">
<h3><?php echo $this->l('Continue the installation in:') ?></h3>
<select id="langList" name="language">
<?php foreach ($this->language->getIsoList() as $iso): ?>
<li>
<label>
<input type="radio" value="<?php echo $iso ?>" <?php echo ($iso == $this->language->getLanguageIso()) ? 'checked="checked"' : '' ?> name="language" style="vertical-align: middle; margin-right: 0;" />
<?php if (file_exists(_PS_INSTALL_LANGS_PATH_.$iso.'/flag.jpg')): ?>
<img src="langs/<?php echo $iso ?>/flag.jpg" alt="<?php echo $iso ?>" style="vertical-align: middle;" />
<?php else: ?>
<img src="theme/img/noflag.jpg" alt="<?php echo $iso ?>" style="vertical-align: middle;" />
<?php endif; ?>
<?php echo $this->language->getLanguage($iso)->getMetaInformation('name') ?>
</label>
</li>
<option value="<?php echo $iso ?>" <?php if ($iso == $this->language->getLanguageIso()) echo 'selected="selected"' ?>>
<?php echo $this->language->getLanguage($iso)->getMetaInformation('name') ?>
</option>
<?php endforeach; ?>
</ul>
</select>
<?php endif; ?>
<p><?php echo $this->l('The language selection above only applies to the Installation Assistant. Once your store is installed, you can choose the language of your store from over %d translations, all for free!', 55); ?> </p>