Alex Aragón 6 years ago
parent
commit
80f66e5b1d

+ 5 - 1
app/Resources/public/css/themes/rainbow/default.css

@@ -2250,4 +2250,8 @@ blockquote p {
     background-color: #d4e9ff !important;
     color: #0b3e6f;
     border-color: #75a9e0;
-}
+}
+
+.post-attachment {
+    text-align: center;
+}

+ 7 - 5
main/inc/ajax/lang.ajax.php

@@ -32,15 +32,17 @@ switch ($action) {
                 var defaultLanguage = "";
                 var langFromUserFound = false;
                 $(this).find("span").each(function() {
-                    defaultLanguage = $(this).attr("lang");
-                    $(this).before().next("br").remove();                
-                    if (defaultLanguageFromUser == defaultLanguage) {
-                        langFromUserFound = true;
+                    defaultLanguage = $(this).attr("lang");                            
+                    if (defaultLanguage) {
+                        $(this).before().next("br").remove();                
+                        if (defaultLanguageFromUser == defaultLanguage) {
+                            langFromUserFound = true;
+                        }
                     }
                 });
                 
                 // Show default language
-                if (langFromUserFound == false) {
+                if (langFromUserFound == false && defaultLanguage) {
                     $("span:lang("+defaultLanguage+")").show();
                 }                   
             });

+ 48 - 13
main/inc/lib/social.lib.php

@@ -2672,11 +2672,9 @@ class SocialManager extends UserManager
             $listType = [];
             $extraFieldItem = [];
             foreach ($extra_user_data as $key => $data) {
-
                 if (empty($data)) {
                     continue;
                 }
-
                 if (in_array($key, $fieldVisibilityKeys) && $fieldVisibility[$key] === false) {
                     continue;
                 }
@@ -2714,15 +2712,52 @@ class SocialManager extends UserManager
                 }
 
                 if (is_array($data)) {
-                    $extra_information_value .= '<li class="list-group-item">' . ucfirst($extraFieldInfo['display_text']) . ' '
-                        . ' ' . implode(',', $data) . '</li>';
-                    $extraFieldItem = [
-                        'variable' => $extraFieldInfo['variable'],
-                        'label' => ucfirst($extraFieldInfo['display_text']),
-                        'value' => implode(',', $data)
-                    ];
+                    switch ($extraFieldInfo['field_type']) {
+                        case ExtraField::FIELD_TYPE_RADIO:
+                            $objEfOption = new ExtraFieldOption('user');
+                            $value = $data['extra_'.$extraFieldInfo['variable']];
+                            $optionInfo = $objEfOption->get_field_option_by_field_and_option(
+                                $extraFieldInfo['id'],
+                                $value
+                            );
+
+                            if ($optionInfo && isset($optionInfo[0])) {
+                                $optionInfo = $optionInfo[0];
+                                $extraFieldItem = [
+                                    'variable' => $extraFieldInfo['variable'],
+                                    'label' => ucfirst($extraFieldInfo['display_text']),
+                                    'value' => $optionInfo['display_text']
+                                ];
+                            } else {
+                                $extraFieldItem = [
+                                    'variable' => $extraFieldInfo['variable'],
+                                    'label' => ucfirst($extraFieldInfo['display_text']),
+                                    'value' => implode(',', $data)
+                                ];
+                            }
+                            break;
+                        default:
+                            $extra_information_value .=
+                                '<li class="list-group-item">'.ucfirst($extraFieldInfo['display_text']).' '
+                                .' '.implode(',', $data).'</li>';
+                            $extraFieldItem = [
+                                'variable' => $extraFieldInfo['variable'],
+                                'label' => ucfirst($extraFieldInfo['display_text']),
+                                'value' => implode(',', $data)
+                            ];
+                            break;
+                    }
+
                 } else {
                     switch ($extraFieldInfo['field_type']) {
+                        case ExtraField::FIELD_TYPE_RADIO:
+
+                            $objEfOption = new ExtraFieldOption('user');
+                            $optionInfo = $objEfOption->get_field_option_by_field_and_option($extraFieldInfo['id'], $extraFieldInfo['value']);
+                            var_dump($extraFieldInfo, $optionInfo);
+
+
+                            break;
                         case ExtraField::FIELD_TYPE_GEOLOCALIZATION:
                             $data = explode('::', $data);
                             $data = $data[0];
@@ -2759,10 +2794,10 @@ class SocialManager extends UserManager
 
                             $tag_tmp = '';
                             foreach ($user_tags as $tags) {
-                                $tag_tmp.= '<a class="label label_tag"'
-                                    . ' href="' . api_get_path(WEB_PATH) . 'main/social/search.php?q=' . $tags['tag'] . '">'
-                                    . $tags['tag']
-                                    . '</a>';
+                                $tag_tmp .= '<a class="label label_tag"'
+                                    .' href="'.api_get_path(WEB_PATH).'main/social/search.php?q='.$tags['tag'].'">'
+                                    .$tags['tag']
+                                    .'</a>';
                             }
                             if (is_array($user_tags) && count($user_tags) > 0) {
                                 $extra_information_value .= '<li class="list-group-item">' . ucfirst($extraFieldInfo['display_text']) . ': '

+ 2 - 1
main/template/default/social/user_block.tpl

@@ -33,6 +33,7 @@
                         <!-- END TYPE PROFILE -->
                         <!-- LM -->
                         <div class="avatar-lm">
+
                             <h5>LM</h5>
 
                             {% if user.language %}
@@ -85,8 +86,8 @@
                         <li class="item item-name">
                             <h5>{{ user.firstname }} {{ user.lastname }}</h5>
                         </li>
-                        {% if show_full_profile %}
 
+                        {% if show_full_profile %}
                             {% if user.email %}
                             <li class="item">
                                 <a href="{{ _p.web }}main/messages/new_message.php">