예제 #1
0
 /**
  * Method to return the default language
  * @access public 
  * @return default site language
  */
 public function currentLanguage()
 {
     try {
         $this->objConfig = $this->getObject('altconfig', 'config');
         $ab = strtolower($this->objConfig->getdefaultLanguageAbbrev());
         $country = $this->objConfig->getCountry();
         $country = $ab . "_" . $country . ".1252";
         if (isset($_POST['Languages'])) {
             $_SESSION["language"] = $_POST['Languages'];
             $var = $_POST['Languages'];
             @($this->locale =& I18Nv2::createLocale("{$country}"));
             $this->lang->setLang("{$var}");
         } else {
             if (isset($_SESSION["language"])) {
                 $var = strtolower($_SESSION["language"]);
                 $country = $this->objConfig->getCountry();
                 $country = $var . "_" . $country . ".1252";
                 @($this->locale =& I18Nv2::createLocale("{$country}"));
                 $this->lang->setLang("{$var}");
             } else {
                 $var = strtolower($this->objConfig->getdefaultLanguageAbbrev());
                 $this->lang->setLang("{$var}");
             }
         }
         return $var;
     } catch (Exception $e) {
         $this->errorCallback($this->languageText('word_caught_exception') . $e->getMessage());
         exit;
     }
 }
예제 #2
0
 /**
  *  Function provides decorated classes for country and language lists.
  *
  * @return dropdown of countrues
  */
 public function dec_country()
 {
     // set some attributes
     $this->objselect->attributes['select']['name'] = 'country';
     $this->objselect->attributes['select']['onchange'] = 'this.form.submit()';
     // set a selected entry
     $language = strtoupper($this->objConfig->getCountry());
     $this->objselect->selected["{$language}"] = true;
     // print a HTML safe select box
     return $this->objselect->getAllCodes();
 }