Author: jablko
Date: Wed Sep 16 13:32:16 2009
New Revision: 3346
Log:
Cosmetic change, move format_language() from action to template
Modified:
trunk/apps/qubit/modules/i18n/actions/changeLanguageListComponent.class.php
trunk/apps/qubit/modules/i18n/templates/_changeLanguageList.php
Modified:
trunk/apps/qubit/modules/i18n/actions/changeLanguageListComponent.class.php
==============================================================================
--- trunk/apps/qubit/modules/i18n/actions/changeLanguageListComponent.class.php
Wed Sep 16 12:30:11 2009 (r3345)
+++ trunk/apps/qubit/modules/i18n/actions/changeLanguageListComponent.class.php
Wed Sep 16 13:32:16 2009 (r3346)
@@ -21,31 +21,5 @@
{
public function execute($request)
{
- // loop through application settings and extract enabled i18n languages
- $enabledI18nLanguages = array();
- foreach (sfConfig::getAll() as $setting => $value)
- {
- if (0 === strpos($setting, 'app_i18n_languages'))
- {
- $enabledI18nLanguages[$value] = format_language($value, $value);
- }
- }
-
- /*
- // don't include the current locale language in list
- foreach ($enabledI18nLanguages as $key => $language)
- {
- if ($key == $this->getUser()->getCulture())
- {
- unset($enabledI18nLanguages[$key]);
- break;
- }
- }
- */
-
- // sort languages by alpha code to look pretty
- ksort($enabledI18nLanguages);
-
- $this->enabledI18nLanguages = $enabledI18nLanguages;
}
}
Modified: trunk/apps/qubit/modules/i18n/templates/_changeLanguageList.php
==============================================================================
--- trunk/apps/qubit/modules/i18n/templates/_changeLanguageList.php Wed Sep
16 12:30:11 2009 (r3345)
+++ trunk/apps/qubit/modules/i18n/templates/_changeLanguageList.php Wed Sep
16 13:32:16 2009 (r3346)
@@ -1,5 +1,7 @@
<ul class="language-list">
- <?php foreach ($enabledI18nLanguages as $key => $language): ?>
- <li<?php if ($key == $sf_user->getCulture()): ?> class="active"<?php
endif; ?>><?php echo link_to($language, array('sf_culture' => $key) +
$sf_request->getParameterHolder()->getAll()) ?></li>
+ <?php foreach (sfConfig::getAll() as $name => $value): ?>
+ <?php if ('app_i18n_languages' == substr($name, 0, 18)): ?>
+ <li<?php if ($sf_user->getCulture() == $value): ?> class="active"<?php
endif; ?>><?php echo link_to(format_language($value, $value),
array('sf_culture' => $value) + $sf_request->getParameterHolder()->getAll())
?></li>
+ <?php endif; ?>
<?php endforeach; ?>
</ul>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---