[geeklog-cvs] geeklog: Minor code cleanup
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sun Oct 4 13:57:05 EDT 2009
changeset 7360:d37545da9eb2
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/d37545da9eb2
user: Dirk Haun <dirk at haun-online.de>
date: Sun Oct 04 17:36:41 2009 +0200
description:
Minor code cleanup
diffstat:
public_html/admin/configuration.php | 13 ++++++-------
public_html/usersettings.php | 25 ++++++++++++-------------
2 files changed, 18 insertions(+), 20 deletions(-)
diffs (80 lines):
diff -r b71518e57545 -r d37545da9eb2 public_html/admin/configuration.php
--- a/public_html/admin/configuration.php Sun Oct 04 13:51:37 2009 +0200
+++ b/public_html/admin/configuration.php Sun Oct 04 17:36:41 2009 +0200
@@ -63,16 +63,15 @@
$themes = array();
$themeFiles = COM_getThemes(true);
- usort($themeFiles,
- create_function('$a,$b', 'return strcasecmp($a,$b);'));
+ usort($themeFiles, 'strcasecmp');
foreach ($themeFiles as $theme) {
- $words = explode ('_', $theme);
- $bwords = array ();
+ $words = explode('_', $theme);
+ $bwords = array();
foreach ($words as $th) {
- if ((strtolower ($th{0}) == $th{0}) &&
- (strtolower ($th{1}) == $th{1})) {
- $bwords[] = strtoupper ($th{0}) . substr ($th, 1);
+ if ((strtolower($th{0}) == $th{0}) &&
+ (strtolower($th{1}) == $th{1})) {
+ $bwords[] = ucfirst($th);
} else {
$bwords[] = $th;
}
diff -r b71518e57545 -r d37545da9eb2 public_html/usersettings.php
--- a/public_html/usersettings.php Sun Oct 04 13:51:37 2009 +0200
+++ b/public_html/usersettings.php Sun Oct 04 17:36:41 2009 +0200
@@ -484,38 +484,37 @@
if ($_CONF['allow_user_themes'] == 1) {
$selection = '<select id="theme" name="theme">' . LB;
- if (empty ($_USER['theme'])) {
+ if (empty($_USER['theme'])) {
$usertheme = $_CONF['theme'];
} else {
$usertheme = $_USER['theme'];
}
- $themeFiles = COM_getThemes ();
- usort ($themeFiles,
- create_function ('$a,$b', 'return strcasecmp($a,$b);'));
+ $themeFiles = COM_getThemes();
+ usort($themeFiles, 'strcasecmp');
foreach ($themeFiles as $theme) {
$selection .= '<option value="' . $theme . '"';
if ($usertheme == $theme) {
$selection .= ' selected="selected"';
}
- $words = explode ('_', $theme);
- $bwords = array ();
+ $words = explode('_', $theme);
+ $bwords = array();
foreach ($words as $th) {
- if ((strtolower ($th{0}) == $th{0}) &&
- (strtolower ($th{1}) == $th{1})) {
- $bwords[] = strtoupper ($th{0}) . substr ($th, 1);
+ if ((strtolower($th{0}) == $th{0}) &&
+ (strtolower($th{1}) == $th{1})) {
+ $bwords[] = ucfirst($th);
} else {
$bwords[] = $th;
}
}
- $selection .= '>' . implode (' ', $bwords) . '</option>' . LB;
+ $selection .= '>' . implode(' ', $bwords) . '</option>' . LB;
}
$selection .= '</select>';
- $preferences->set_var ('theme_selector', $selection);
- $preferences->parse ('theme_selection', 'theme', true);
+ $preferences->set_var('theme_selector', $selection);
+ $preferences->parse('theme_selection', 'theme', true);
} else {
- $preferences->set_var ('theme_selection', '');
+ $preferences->set_var('theme_selection', '');
}
require_once ('Date/TimeZone.php');
More information about the geeklog-cvs
mailing list