mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 16:32:20 +00:00
- Added support for language in session in function getUserLanguage from helper hlp_language_helper
- If the language is loaded from database then it is checked that the language is enabled
This commit is contained in:
@@ -207,28 +207,12 @@ class Person_model extends DB_Model
|
||||
*/
|
||||
public function getLanguage($uid)
|
||||
{
|
||||
$language = DEFAULT_LANGUAGE;
|
||||
|
||||
$this->addSelect('public.tbl_person.sprache');
|
||||
$this->addJoin('public.tbl_benutzer', 'person_id');
|
||||
$this->addJoin('public.tbl_sprache', 'sprache');
|
||||
$this->addOrder('public.tbl_person.updateamum', 'DESC');
|
||||
$this->addOrder('public.tbl_person.insertvon', 'DESC');
|
||||
|
||||
$persons = $this->loadWhere(array('uid' => $uid));
|
||||
|
||||
if (hasData($persons))
|
||||
{
|
||||
for ($i = 0; $i < count($persons->retval); $i++)
|
||||
{
|
||||
$person = $persons->retval[$i];
|
||||
|
||||
if (!isEmptyString($person->sprache))
|
||||
{
|
||||
$language = $person->sprache;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $language;
|
||||
return $this->loadWhere(array('uid' => $uid, 'content' => true));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user