[geeklog-cvs] geeklog-1.3/public_html usersettings.php,1.60,1.61
geeklog-cvs-admin at lists.geeklog.net
geeklog-cvs-admin at lists.geeklog.net
Sun Jun 8 11:22:52 EDT 2003
Update of /usr/cvs/geeklog/geeklog-1.3/public_html
In directory internal.geeklog.net:/tmp/cvs-serv14995
Modified Files:
usersettings.php
Log Message:
Worked on the Languages and Theme Names beautifiying a bit (and sorted them).
Index: usersettings.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/usersettings.php,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** usersettings.php 23 May 2003 11:43:27 -0000 1.60
--- usersettings.php 8 Jun 2003 15:22:50 -0000 1.61
***************
*** 270,274 ****
// display preferences block
if ($_CONF['allow_user_language'] == 1) {
- $selection = '<select name="language">' . LB;
if (empty($_USER['language'])) {
--- 270,273 ----
***************
*** 279,283 ****
// Get available languages
! $language_options = '';
$fd = opendir ($_CONF['path_language']);
while (($file = @readdir ($fd)) !== false) {
--- 278,282 ----
// Get available languages
! $language = array ();
$fd = opendir ($_CONF['path_language']);
while (($file = @readdir ($fd)) !== false) {
***************
*** 285,306 ****
clearstatcache ();
$file = str_replace ('.php', '', $file);
- $language_options .= '<option value="' . $file . '"';
- if ($userlang == $file) {
- $language_options .= ' selected="SELECTED"';
- }
$uscore = strpos ($file, '_');
! if ($uscore !== false) {
! $lngname = substr ($file, 0, $uscore);
! $lngadd = substr ($file, $uscore + 1);
! $lngname = strtoupper ($lngname{0}) . substr ($lngname, 1);
! $lngadd = strtoupper ($lngadd{0}) . substr ($lngadd, 1);
! $file = $lngname . ' (' . $lngadd . ')';
} else {
! $file = strtoupper ($file{0}) . substr ($file, 1);
}
! $language_options .= '>' . $file . '</option>' . LB;
}
}
! $selection .= $language_options;
$selection .= '</select>';
$preferences->set_var ('language_selector', $selection);
--- 284,307 ----
clearstatcache ();
$file = str_replace ('.php', '', $file);
$uscore = strpos ($file, '_');
! if ($uscore === false) {
! $lngname = ucfirst ($file);
} else {
! $lngname = ucfirst (substr ($file, 0, $uscore));
! $lngadd = ucfirst (substr ($file, $uscore + 1));
! $lngname .= ' (' . $lngadd . ')';
}
! $language[$file] = $lngname;
}
}
! asort ($language);
! $selection = '<select name="language">' . LB;
! foreach ($language as $langFile => $langName) {
! $selection .= '<option value="' . $langFile . '"';
! if ($userlang == $langFile) {
! $selection .= ' selected="selected"';
! }
! $selection .= '>' . $langName . '</option>' . LB;
! }
$selection .= '</select>';
$preferences->set_var ('language_selector', $selection);
***************
*** 319,336 ****
}
! $themes = COM_getThemes ();
! for ($i = 1; $i <= count ($themes); $i++) {
! $selection .= '<option value="' . current ($themes) . '"';
! if ($usertheme == current ($themes)) {
! $selection .= ' selected="SELECTED"';
! }
! // some theme name beautifying ...
! $th = str_replace ('_', ' ', current ($themes));
! if ((strtolower ($th{0}) == $th{0}) &&
! (strtolower ($th{1}) == $th{1})) {
! $th = strtoupper ($th{0}) . substr ($th, 1);
}
! $selection .= '>' . $th . '</option>' . LB;
! next ($themes);
}
$selection .= '</select>';
--- 320,337 ----
}
! $themeFiles = COM_getThemes ();
! // first, some theme name beautifying ...
! $themes = array ();
! foreach ($themeFiles as $themeFile) {
! $themeName = str_replace ('_', ' ', $themeFile);
! $themes[$themeFile] = ucwords ($themeName);
! }
! asort ($themes);
! foreach ($themes as $themeFile => $themeName) {
! $selection .= '<option value="' . $themeFile . '"';
! if ($usertheme == $themeFile) {
! $selection .= ' selected="selected"';
}
! $selection .= '>' . $themeName . '</option>' . LB;
}
$selection .= '</select>';
More information about the geeklog-cvs
mailing list