Minor code cleanup HEAD
authorDirk Haun <dirk@haun-online.de>
Sun Oct 04 17:36:41 2009 +0200 (5 months ago)
branchHEAD
changeset 7360d37545da9eb2
parent 7359b71518e57545
child 7361cb9ad1e4b759
Minor code cleanup
public_html/admin/configuration.php
public_html/usersettings.php
     1.1 --- a/public_html/admin/configuration.php	Sun Oct 04 13:51:37 2009 +0200
     1.2 +++ b/public_html/admin/configuration.php	Sun Oct 04 17:36:41 2009 +0200
     1.3 @@ -63,16 +63,15 @@
     1.4      $themes = array();
     1.5  
     1.6      $themeFiles = COM_getThemes(true);
     1.7 -    usort($themeFiles,
     1.8 -          create_function('$a,$b', 'return strcasecmp($a,$b);'));
     1.9 +    usort($themeFiles, 'strcasecmp');
    1.10  
    1.11      foreach ($themeFiles as $theme) {
    1.12 -        $words = explode ('_', $theme);
    1.13 -        $bwords = array ();
    1.14 +        $words = explode('_', $theme);
    1.15 +        $bwords = array();
    1.16          foreach ($words as $th) {
    1.17 -            if ((strtolower ($th{0}) == $th{0}) &&
    1.18 -                (strtolower ($th{1}) == $th{1})) {
    1.19 -                $bwords[] = strtoupper ($th{0}) . substr ($th, 1);
    1.20 +            if ((strtolower($th{0}) == $th{0}) &&
    1.21 +                (strtolower($th{1}) == $th{1})) {
    1.22 +                $bwords[] = ucfirst($th);
    1.23              } else {
    1.24                  $bwords[] = $th;
    1.25              }
     2.1 --- a/public_html/usersettings.php	Sun Oct 04 13:51:37 2009 +0200
     2.2 +++ b/public_html/usersettings.php	Sun Oct 04 17:36:41 2009 +0200
     2.3 @@ -484,38 +484,37 @@
     2.4      if ($_CONF['allow_user_themes'] == 1) {
     2.5          $selection = '<select id="theme" name="theme">' . LB;
     2.6  
     2.7 -        if (empty ($_USER['theme'])) {
     2.8 +        if (empty($_USER['theme'])) {
     2.9              $usertheme = $_CONF['theme'];
    2.10          } else {
    2.11              $usertheme = $_USER['theme'];
    2.12          }
    2.13  
    2.14 -        $themeFiles = COM_getThemes ();
    2.15 -        usort ($themeFiles,
    2.16 -               create_function ('$a,$b', 'return strcasecmp($a,$b);'));
    2.17 +        $themeFiles = COM_getThemes();
    2.18 +        usort($themeFiles, 'strcasecmp');
    2.19  
    2.20          foreach ($themeFiles as $theme) {
    2.21              $selection .= '<option value="' . $theme . '"';
    2.22              if ($usertheme == $theme) {
    2.23                  $selection .= ' selected="selected"';
    2.24              }
    2.25 -            $words = explode ('_', $theme);
    2.26 -            $bwords = array ();
    2.27 +            $words = explode('_', $theme);
    2.28 +            $bwords = array();
    2.29              foreach ($words as $th) {
    2.30 -                if ((strtolower ($th{0}) == $th{0}) &&
    2.31 -                    (strtolower ($th{1}) == $th{1})) {
    2.32 -                    $bwords[] = strtoupper ($th{0}) . substr ($th, 1);
    2.33 +                if ((strtolower($th{0}) == $th{0}) &&
    2.34 +                    (strtolower($th{1}) == $th{1})) {
    2.35 +                    $bwords[] = ucfirst($th);
    2.36                  } else {
    2.37                      $bwords[] = $th;
    2.38                  }
    2.39              }
    2.40 -            $selection .= '>' . implode (' ', $bwords) . '</option>' . LB;
    2.41 +            $selection .= '>' . implode(' ', $bwords) . '</option>' . LB;
    2.42          }
    2.43          $selection .= '</select>';
    2.44 -        $preferences->set_var ('theme_selector', $selection);
    2.45 -        $preferences->parse ('theme_selection', 'theme', true);
    2.46 +        $preferences->set_var('theme_selector', $selection);
    2.47 +        $preferences->parse('theme_selection', 'theme', true);
    2.48      } else {
    2.49 -        $preferences->set_var ('theme_selection', '');
    2.50 +        $preferences->set_var('theme_selection', '');
    2.51      }
    2.52  
    2.53      require_once ('Date/TimeZone.php');