Selaa lähdekoodia

#4148 - Build-in API support (urls)

roman.lesnikov@gmail.com 3 vuotta sitten
vanhempi
sitoutus
35828637b3

+ 1 - 1
inc/classes/BxDolProfile.php

@@ -145,7 +145,7 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
             'id' => $oProfile->id(),
             'display_type' =>  $sDisplayType,
             'display_name' => $oProfile->getDisplayName(),
-            'url' => $oProfile->getUrl(),
+            'url' => bx_relative_url($oProfile->getUrl()),
             'url_avatar' => $oProfile->getAvatar(),
         ];
     }

+ 5 - 0
inc/utils.inc.php

@@ -2318,6 +2318,11 @@ function is_private_ip ($sIp)
     return filter_var($sIp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== $sIp;
 }
 
+function bx_relative_url($sUrl, $sPrefix = BX_DOL_URL_ROOT)
+{
+    return '/' . bx_ltrim_str($sUrl, $sPrefix);
+}
+
 function bx_absolute_url($sUrl, $sPrefix = BX_DOL_URL_ROOT)
 {
     if (!preg_match('/^https?:\/\//', $sUrl))

+ 1 - 1
modules/base/general/classes/BxBaseModGeneralSearchResult.php

@@ -230,7 +230,7 @@ class BxBaseModGeneralSearchResult extends BxTemplSearchResult
 
     function decodeDataUrl ($oContentInfo, $r)
     {
-        return '/' . bx_ltrim_str($oContentInfo->getContentLink($r['id']), BX_DOL_URL_ROOT);
+        return bx_relative_url($oContentInfo->getContentLink($r['id']));
     }
 
     function decodeDataSummaryPlain ($oContentInfo, $r)

+ 2 - 1
template/scripts/BxBaseCmtsServices.php

@@ -480,7 +480,8 @@ class BxBaseCmtsServices extends BxDol
             $aForm['inputs']['cmt_text']['numLines'] = 1;
             $aForm['inputs']['cmt_text']['autoheight'] = true;
             $aForm['inputs']['cmt_submit']['icon'] = 'contact';
-            $aForm['inputs']['cmt_submit']['rounded'] = true;
+            $aForm['inputs']['cmt_submit']['variant'] = 'text';
+            $aForm['inputs']['cmt_submit']['icon_only'] = true;
             
             // add view (form + new comment)
             if($oForm['form']->isSubmittedAndValid()){