public_html/usersettings.php
branchHEAD
changeset 7360 d37545da9eb2
parent 7328 01eed07e51e9
child 7425 7fcb2cf3765b
     1.1 --- a/public_html/usersettings.php	Sat Sep 19 22:42:31 2009 +0200
     1.2 +++ b/public_html/usersettings.php	Sun Oct 04 17:36:41 2009 +0200
     1.3 @@ -484,38 +484,37 @@
     1.4      if ($_CONF['allow_user_themes'] == 1) {
     1.5          $selection = '<select id="theme" name="theme">' . LB;
     1.6  
     1.7 -        if (empty ($_USER['theme'])) {
     1.8 +        if (empty($_USER['theme'])) {
     1.9              $usertheme = $_CONF['theme'];
    1.10          } else {
    1.11              $usertheme = $_USER['theme'];
    1.12          }
    1.13  
    1.14 -        $themeFiles = COM_getThemes ();
    1.15 -        usort ($themeFiles,
    1.16 -               create_function ('$a,$b', 'return strcasecmp($a,$b);'));
    1.17 +        $themeFiles = COM_getThemes();
    1.18 +        usort($themeFiles, 'strcasecmp');
    1.19  
    1.20          foreach ($themeFiles as $theme) {
    1.21              $selection .= '<option value="' . $theme . '"';
    1.22              if ($usertheme == $theme) {
    1.23                  $selection .= ' selected="selected"';
    1.24              }
    1.25 -            $words = explode ('_', $theme);
    1.26 -            $bwords = array ();
    1.27 +            $words = explode('_', $theme);
    1.28 +            $bwords = array();
    1.29              foreach ($words as $th) {
    1.30 -                if ((strtolower ($th{0}) == $th{0}) &&
    1.31 -                    (strtolower ($th{1}) == $th{1})) {
    1.32 -                    $bwords[] = strtoupper ($th{0}) . substr ($th, 1);
    1.33 +                if ((strtolower($th{0}) == $th{0}) &&
    1.34 +                    (strtolower($th{1}) == $th{1})) {
    1.35 +                    $bwords[] = ucfirst($th);
    1.36                  } else {
    1.37                      $bwords[] = $th;
    1.38                  }
    1.39              }
    1.40 -            $selection .= '>' . implode (' ', $bwords) . '</option>' . LB;
    1.41 +            $selection .= '>' . implode(' ', $bwords) . '</option>' . LB;
    1.42          }
    1.43          $selection .= '</select>';
    1.44 -        $preferences->set_var ('theme_selector', $selection);
    1.45 -        $preferences->parse ('theme_selection', 'theme', true);
    1.46 +        $preferences->set_var('theme_selector', $selection);
    1.47 +        $preferences->parse('theme_selection', 'theme', true);
    1.48      } else {
    1.49 -        $preferences->set_var ('theme_selection', '');
    1.50 +        $preferences->set_var('theme_selection', '');
    1.51      }
    1.52  
    1.53      require_once ('Date/TimeZone.php');