From: <var...@us...> - 2014-06-24 15:28:09
|
Revision: 8932 http://sourceforge.net/p/phpwiki/code/8932 Author: vargenau Date: 2014-06-24 15:27:59 +0000 (Tue, 24 Jun 2014) Log Message: ----------- Use natcasesort, factor "fusionforge" theme test Modified Paths: -------------- trunk/lib/WikiTheme.php trunk/lib/plugin/SystemInfo.php trunk/themes/default/templates/userprefs.tmpl Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2014-06-24 14:35:20 UTC (rev 8931) +++ trunk/lib/WikiTheme.php 2014-06-24 15:27:59 UTC (rev 8932) @@ -1922,14 +1922,15 @@ $dir = dir($dir_root); if ($dir) { while ($entry = $dir->read()) { - if (is_dir($dir_root . '/' . $entry) - and file_exists($dir_root . '/' . $entry . '/themeinfo.php') - ) { + // 'fusionforge' cannot be selected as standalone theme + if (($entry != 'fusionforge') and (is_dir($dir_root . '/' . $entry) + and file_exists($dir_root . '/' . $entry . '/themeinfo.php'))) { array_push($available_themes, $entry); } } $dir->close(); } + natcasesort(&$available_themes); return $available_themes; } @@ -1947,6 +1948,7 @@ } $dir->close(); } + natcasesort(&$available_languages); return $available_languages; } Modified: trunk/lib/plugin/SystemInfo.php =================================================================== --- trunk/lib/plugin/SystemInfo.php 2014-06-24 14:35:20 UTC (rev 8931) +++ trunk/lib/plugin/SystemInfo.php 2014-06-24 15:27:59 UTC (rev 8932) @@ -457,7 +457,7 @@ . implode(', ', $available_languages) . ". " . _("Current language") . _(": ") . $GLOBALS['LANG'] . ((DEFAULT_LANGUAGE != $GLOBALS['LANG']) - ? ". " . sprintf(_("Default language: “%s”"), DEFAULT_LANGUAGE) + ? ". " . _("Default language") . _(": ") . DEFAULT_LANGUAGE : ''); } @@ -470,7 +470,7 @@ . implode(', ', $available_themes) . ". " . _("Current theme") . _(": ") . $WikiTheme->_name . ((THEME != $WikiTheme->_name) - ? ". " . sprintf(_("Default theme: “%s”"), THEME) + ? ". " . _("Default theme") . _(": ") . THEME : ''); } Modified: trunk/themes/default/templates/userprefs.tmpl =================================================================== --- trunk/themes/default/templates/userprefs.tmpl 2014-06-24 14:35:20 UTC (rev 8931) +++ trunk/themes/default/templates/userprefs.tmpl 2014-06-24 15:27:59 UTC (rev 8932) @@ -65,20 +65,16 @@ if ($isForm) { $SelectOptions = HTML(); if (!empty($available_themes) and is_array($available_themes)) { - sort(&$available_themes); if (!$pref->get('theme') or $pref->get('theme') == THEME) { $SelectOptions->pushContent(selectedOption("",_("<system theme>"))); } else { $SelectOptions->pushContent(unselectedOption("",_("<system theme>"))); } foreach ($available_themes as $theme) { - // 'fusionforge' cannot be selected as standalone theme - if ($theme != 'fusionforge') { - if ($theme == $pref->get('theme') and $theme != THEME) { - $SelectOptions->pushContent(selectedOption($theme)); - } else { - $SelectOptions->pushContent(unselectedOption($theme)); - } + if ($theme == $pref->get('theme') and $theme != THEME) { + $SelectOptions->pushContent(selectedOption($theme)); + } else { + $SelectOptions->pushContent(unselectedOption($theme)); } } $SelectThemes = HTML::select(array('name' => "pref[theme]",'id' => 'theme'), @@ -88,7 +84,6 @@ $SelectOptions = HTML(); if (!empty($available_languages) and is_array($available_languages)) { - sort(&$available_languages); if (!$pref->get('lang') or $pref->get('lang') == DEFAULT_LANGUAGE) { $SelectOptions->pushContent(selectedOption("",_("<system language>"))); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |