Przeglądaj źródła

#4148 - Links with /page

roman.lesnikov@gmail.com 3 lat temu
rodzic
commit
f56e628b47
1 zmienionych plików z 14 dodań i 2 usunięć
  1. 14 2
      template/scripts/BxBaseServicePages.php

+ 14 - 2
template/scripts/BxBaseServicePages.php

@@ -36,13 +36,25 @@ class BxBaseServicePages extends BxDol
      */
     public function serviceGetPageByRequest ($sRequest, $sBlocks = '', $sParams = '')
     {
-        $mixed = BxDolPage::getPageBySeoLink($sRequest);
+        $mixed = null;
+        if (substr_count($sRequest, 'page/')> 0){
+            $_GET['i'] = str_replace('page/', '', $sRequest);
+            $aParams = json_decode($sParams, true);
+            if(!empty($aParams) && is_array($aParams))
+                $_GET = array_merge($_GET, $aParams);
+            
+            $mixed = BxDolPage::getObjectInstanceByURI();
+        }
+        else{
+            $mixed = BxDolPage::getPageBySeoLink($sRequest);
+        }
+       
 
         if (($sUrl = $mixed) && is_string($sUrl)) {
             $aRes = ['redirect' => $sUrl];
         }
         elseif (($oPage = $mixed) && is_object($oPage)) {
-            if(!empty($sParams)) {
+			if(!empty($sParams)) {
                 $aParams = json_decode($sParams, true);
                 if(!empty($aParams) && is_array($aParams))
                     $_GET = array_merge($_GET, $aParams);