Răsfoiți Sursa

Ticket #4558 - Build-in API support: Different.

AntonLV 1 an în urmă
părinte
comite
3cf6855c19

+ 0 - 1
modules/base/general/classes/BxBaseModGeneralFormsEntryHelper.php

@@ -822,7 +822,6 @@ class BxBaseModGeneralFormsEntryHelper extends BxDolProfileForms
                 if(!empty($aParams['request_params']) && is_array($aParams['request_params']))
                 if(!empty($aParams['request_params']) && is_array($aParams['request_params']))
                     $sRequestUrl = bx_append_url_params($sRequestUrl, $aParams['request_params']);
                     $sRequestUrl = bx_append_url_params($sRequestUrl, $aParams['request_params']);
 
 
-                bx_append_url_params($sUrl, $mixedParams);
                 $aResult = bx_api_get_block('form', $mixedData, [
                 $aResult = bx_api_get_block('form', $mixedData, [
                     'ext' => [
                     'ext' => [
                         'name' => $sModule, 
                         'name' => $sModule, 

+ 1 - 1
modules/boonex/forum/classes/BxForumModule.php

@@ -520,7 +520,7 @@ class BxForumModule extends BxBaseModTextModule
             unset($aParams['ajax_paginate']);
             unset($aParams['ajax_paginate']);
         }
         }
         
         
-        if(isset($aParams['unit_view']) && $aParams['unit_view'] != 'table')
+        if($this->_bIsApi || (isset($aParams['unit_view']) && $aParams['unit_view'] != 'table'))
             return $this->_serviceBrowse('author', array_merge(array('author' => $iProfileId), $aParams), BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
             return $this->_serviceBrowse('author', array_merge(array('author' => $iProfileId), $aParams), BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
 
 
         return $this->_serviceBrowseTable(array(
         return $this->_serviceBrowseTable(array(

+ 1 - 1
template/scripts/BxBaseFormView.php

@@ -665,7 +665,7 @@ BLAH;
         foreach ($this->aInputs as &$aInput) {
         foreach ($this->aInputs as &$aInput) {
     
     
             if (!isset($aInput['visible_for_levels']) || self::isVisible($aInput)) {
             if (!isset($aInput['visible_for_levels']) || self::isVisible($aInput)) {
-                if ('block_header' == $aInput['type'] && !$this->_bShowEmptySections) {
+                if ((isset($aInput['type']) && 'block_header' == $aInput['type']) && !$this->_bShowEmptySections) {
                     // don't show section with no fields or with empty fields
                     // don't show section with no fields or with empty fields
                     if ($sContHeader) {                        
                     if ($sContHeader) {                        
                         if ($sContFields)
                         if ($sContFields)

+ 13 - 4
template/scripts/BxBasePage.php

@@ -554,10 +554,19 @@ class BxBasePage extends BxDolPage
             $a['menu'] = $oMenuSubmenu->getCodeAPI();
             $a['menu'] = $oMenuSubmenu->getCodeAPI();
             if($sModule && $sModule != 'system' && ($oModule = BxDolModule::getInstance($sModule))) {
             if($sModule && $sModule != 'system' && ($oModule = BxDolModule::getInstance($sModule))) {
                 $CNF = &$oModule->_oConfig->CNF;
                 $CNF = &$oModule->_oConfig->CNF;
-                $a['menu']['name'] = $oModule->getName();
-                $a['menu']['title'] = BxDolModule::getTitle($oModule->_oConfig->getUri());
-                $a['menu']['icon'] = $CNF['ICON'];
-                $a['menu']['add_url'] = isset($CNF['URI_ADD_ENTRY']) ? $CNF['URI_ADD_ENTRY'] : str_replace('edit-', 'create-', $CNF['URI_EDIT_ENTRY']);
+
+                $sUrlAdd = '';
+                if(($sKey = 'URI_ADD_ENTRY') && !empty($CNF[$sKey]))
+                    $sUrlAdd = $CNF[$sKey];
+                if(!$sUrlAdd && ($sKey = 'URI_EDIT_ENTRY') && !empty($CNF[$sKey]))
+                    $sUrlAdd = str_replace('edit-', 'create-', $CNF[$sKey]);
+
+                $a['menu'] = array_merge($a['menu'], [
+                    'name' => $oModule->getName(),
+                    'title' => BxDolModule::getTitle($oModule->_oConfig->getUri()),
+                    'icon' => !empty($CNF['ICON']) ? $CNF['ICON'] : '',
+                    'add_url' => $sUrlAdd 
+                ]);
             }
             }
         }
         }