Пример #1
0
 /**
  * @param $user_id
  * @param $user_data
  */
 protected static function loadUser($user_id, &$user_data)
 {
     if (isset($user_data['user'])) {
         unset($user_data['user']);
     }
     $user_data['user'] = Core_Tools::toArray(Default_UsersModel::get(array('id' => $user_id)));
     // Fix Language
     if (!$user_data['user']['language_code']) {
         foreach (cfg()->language_codes as $code => $name) {
             Default_UsersModel::set(array('language_code' => $code), array('id' => $user_id));
             $user_data['user']['language_code'] = $code;
             break;
         }
     }
 }