Example #1
0
 protected function getCurrentLanguage()
 {
     $request = $this->getRequest();
     $defaultLang = $request->get("lang");
     if (empty($defaultLang)) {
         $defaultLang = Config\Option::get("main", "admin_lid", 'en');
     }
     if (!empty($defaultLang)) {
         $recordset = LanguageTable::getById($defaultLang);
         if ($record = $recordset->fetch()) {
             return $record;
         }
     }
     $recordset = LanguageTable::getList(array('filter' => array('ACTIVE' => 'Y'), 'order' => array('DEF' => 'DESC', 'SORT' => 'ASC'), 'select' => array('*')));
     if ($record = $recordset->fetch()) {
         return $record;
     }
     throw new SystemException('Language is not found');
 }