/**
  * Function to sort select items by label
  *
  * @param array $config: parameter array by t3lib_tceforms::procItems
  * @param t3lib_tceforms $pObj: parent object of class t3lib_tceforms
  * @return void
  *
  */
 public function sortItemsByLabel($config, $pObj)
 {
     // Get current language and find proper charset
     $currentLanguage = tx_cpsdevlib_extmgm::getLanguage('en');
     $this->charset = $this->csConvObj->get_locale_charset($currentLanguage);
     // Try to save current locale
     $oldLocale = setlocale(LC_ALL, 0);
     if ($oldLocale) {
         setlocale(LC_ALL, $this->localeArray[$currentLanguage]);
     }
     usort($config['items'], array('tx_cpsdevlib_itemsprocfuncs', 'sortArray'));
     // Reset locale
     if ($oldLocale) {
         setlocale(LC_ALL, $oldLocale);
     }
 }
 /**
  * Setting locale for frontend rendering
  *
  * @return	void
  */
 function settingLocale()
 {
     // Setting locale
     if ($this->config['config']['locale_all']) {
         # Change by Rene Fritz, 22/10 2002
         # there's a problem that PHP parses float values in scripts wrong if the locale LC_NUMERIC is set to something with a comma as decimal point
         # this does not work in php 4.2.3
         #setlocale('LC_ALL',$this->config['config']['locale_all']);
         #setlocale('LC_NUMERIC','en_US');
         # so we set all except LC_NUMERIC
         $locale = setlocale(LC_COLLATE, $this->config['config']['locale_all']);
         if ($locale) {
             setlocale(LC_CTYPE, $this->config['config']['locale_all']);
             setlocale(LC_MONETARY, $this->config['config']['locale_all']);
             setlocale(LC_TIME, $this->config['config']['locale_all']);
             $this->localeCharset = $this->csConvObj->get_locale_charset($this->config['config']['locale_all']);
         } else {
             $GLOBALS['TT']->setTSlogMessage('Locale "' . htmlspecialchars($this->config['config']['locale_all']) . '" not found.', 3);
         }
     }
 }