AntonLV 10 ani în urmă
părinte
comite
06f4965e09
47 a modificat fișierele cu 283 adăugiri și 350 ștergeri
  1. 13 13
      inc/classes/BxDolCmts.php
  2. 3 3
      inc/classes/BxDolGrid.php
  3. 3 3
      inc/classes/BxDolGridConnections.php
  4. 1 1
      inc/classes/BxDolReport.php
  5. 6 6
      inc/classes/BxDolVote.php
  6. 7 0
      inc/utils.inc.php
  7. 2 2
      modules/base/general/classes/BxBaseModGeneralGridAdministration.php
  8. 0 10
      modules/base/notifications/classes/BxBaseModNotificationsModule.php
  9. 3 3
      modules/base/profile/classes/BxBaseModProfileGridAdministration.php
  10. 4 4
      modules/boonex/accounts/classes/BxAccntGridAdministration.php
  11. 6 6
      modules/boonex/antispam/classes/BxAntispamGridDNSBL.php
  12. 4 4
      modules/boonex/antispam/classes/BxAntispamGridIpTable.php
  13. 6 6
      modules/boonex/developer/classes/BxDevFormsDisplays.php
  14. 8 8
      modules/boonex/developer/classes/BxDevFormsForms.php
  15. 8 8
      modules/boonex/developer/classes/BxDevFormsPreLists.php
  16. 6 6
      modules/boonex/developer/classes/BxDevFormsPreValues.php
  17. 5 5
      modules/boonex/developer/classes/BxDevNavigationItems.php
  18. 7 7
      modules/boonex/developer/classes/BxDevNavigationMenus.php
  19. 6 6
      modules/boonex/developer/classes/BxDevNavigationSets.php
  20. 2 2
      modules/boonex/developer/classes/BxDevPolyglotManage.php
  21. 9 9
      modules/boonex/invites/classes/BxInvGridRequests.php
  22. 4 14
      modules/boonex/invites/classes/BxInvModule.php
  23. 9 9
      modules/boonex/membership_pricing/template/scripts/BxBaseStudioPermissionsPrices.php
  24. 1 1
      modules/boonex/notifications/classes/BxNtfsModule.php
  25. 2 2
      modules/boonex/oauth2/classes/BxOAuthGrid.php
  26. 9 9
      modules/boonex/sites/classes/BxSitesGridBrowse.php
  27. 11 11
      modules/boonex/sites/classes/BxSitesGridOverview.php
  28. 20 20
      modules/boonex/timeline/classes/BxTimelineModule.php
  29. 4 4
      samples/BxGridMy.php
  30. 4 4
      studio/template/scripts/BxBaseStudioFormsDisplays.php
  31. 14 14
      studio/template/scripts/BxBaseStudioFormsFields.php
  32. 4 4
      studio/template/scripts/BxBaseStudioFormsForms.php
  33. 7 7
      studio/template/scripts/BxBaseStudioFormsPreLists.php
  34. 9 9
      studio/template/scripts/BxBaseStudioFormsPreValues.php
  35. 3 3
      studio/template/scripts/BxBaseStudioNavigationImport.php
  36. 18 18
      studio/template/scripts/BxBaseStudioNavigationItems.php
  37. 7 7
      studio/template/scripts/BxBaseStudioNavigationMenus.php
  38. 10 10
      studio/template/scripts/BxBaseStudioNavigationSets.php
  39. 5 5
      studio/template/scripts/BxBaseStudioPermissionsActions.php
  40. 16 16
      studio/template/scripts/BxBaseStudioPermissionsLevels.php
  41. 4 4
      studio/template/scripts/BxBaseStudioPolyglotEtemplates.php
  42. 7 7
      studio/template/scripts/BxBaseStudioPolyglotKeys.php
  43. 0 10
      template/scripts/BxBaseCmts.php
  44. 6 20
      template/scripts/BxBaseGrid.php
  45. 0 10
      template/scripts/BxBasePrivacy.php
  46. 0 10
      template/scripts/BxBaseReport.php
  47. 0 10
      template/scripts/BxBaseVote.php

+ 13 - 13
inc/classes/BxDolCmts.php

@@ -695,12 +695,12 @@ class BxDolCmts extends BxDol implements iBxDolReplaceable
     public function actionGetFormEdit ()
     {
         if (!$this->isEnabled()){
-            $this->_echoResultJson(array());
+            echoJson(array());
             return;
         }
 
         $iCmtId = bx_process_input(bx_get('Cmt'), BX_DATA_INT);
-        $this->_echoResultJson($this->getFormEdit($iCmtId));
+        echoJson($this->getFormEdit($iCmtId));
     }
 
     public function actionGetCmt ()
@@ -713,7 +713,7 @@ class BxDolCmts extends BxDol implements iBxDolReplaceable
         $sCmtDisplay = isset($_REQUEST['CmtDisplay']) ? bx_process_input($_REQUEST['CmtDisplay'], BX_DATA_TEXT) : '';
 
         $aCmt = $this->getCommentRow($iCmtId);
-        $this->_echoResultJson(array(
+        echoJson(array(
             'parent_id' => $aCmt['cmt_parent_id'],
             'vparent_id' => $aCmt['cmt_vparent_id'],
             'content' => $this->getComment($aCmt, array('type' => $sCmtBrowse), array('type' => $sCmtDisplay, 'dynamic_mode' => true))
@@ -735,7 +735,7 @@ class BxDolCmts extends BxDol implements iBxDolReplaceable
     public function actionSubmitPostForm()
     {
         if(!$this->isEnabled() || !$this->isPostReplyAllowed()) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             return;
         }
 
@@ -743,13 +743,13 @@ class BxDolCmts extends BxDol implements iBxDolReplaceable
         if(bx_get('cmt_parent_id') !== false)
             $iCmtParentId = bx_process_input(bx_get('cmt_parent_id'), BX_DATA_INT);
 
-        $this->_echoResultJson($this->getFormPost($iCmtParentId));
+        echoJson($this->getFormPost($iCmtParentId));
     }
 
     public function actionSubmitEditForm()
     {
         if (!$this->isEnabled()) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             return;
         };
 
@@ -757,13 +757,13 @@ class BxDolCmts extends BxDol implements iBxDolReplaceable
         if(bx_get('cmt_id') !== false)
             $iCmtId = bx_process_input(bx_get('cmt_id'), BX_DATA_INT);
 
-        $this->_echoResultJson($this->getFormEdit($iCmtId));
+        echoJson($this->getFormEdit($iCmtId));
     }
 
     public function actionRemove()
     {
         if (!$this->isEnabled()) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             return;
         };
 
@@ -773,18 +773,18 @@ class BxDolCmts extends BxDol implements iBxDolReplaceable
 
         $aCmt = $this->_oQuery->getCommentSimple ($this->getId(), $iCmtId);
         if(!$aCmt) {
-            $this->_echoResultJson(array('msg' => _t('_No such comment')));
+            echoJson(array('msg' => _t('_No such comment')));
             return;
         }
 
         if ($aCmt['cmt_replies'] > 0) {
-            $this->_echoResultJson(array('msg' => _t('_Can not delete comments with replies')));
+            echoJson(array('msg' => _t('_Can not delete comments with replies')));
             return;
         }
 
         $iCmtAuthorId = $this->_getAuthorId();
         if(!$this->isRemoveAllowed($aCmt)) {
-            $this->_echoResultJson(array('msg' => $aCmt['cmt_author_id'] == $iCmtAuthorId ? strip_tags($this->msgErrRemoveAllowed()) : _t('_Access denied')));
+            echoJson(array('msg' => $aCmt['cmt_author_id'] == $iCmtAuthorId ? strip_tags($this->msgErrRemoveAllowed()) : _t('_Access denied')));
             return;
         }
 
@@ -810,11 +810,11 @@ class BxDolCmts extends BxDol implements iBxDolReplaceable
             $oZ = new BxDolAlerts('comment', 'deleted', $aCmt['cmt_id'], $iCmtAuthorId, array('object_system' => $this->_sSystem, 'object_id' => $iCmtObjectId));
         	$oZ->alert();
 
-            $this->_echoResultJson(array('id' => $iCmtId));
+            echoJson(array('id' => $iCmtId));
             return;
         }
 
-        $this->_echoResultJson(array('msg' => _t('_cmt_err_cannot_perform_action')));
+        echoJson(array('msg' => _t('_cmt_err_cannot_perform_action')));
     }
 
     public function actionResumeLiveUpdate()

+ 3 - 3
inc/classes/BxDolGrid.php

@@ -205,7 +205,7 @@
  *     $iAffected = 0;
  *     $aIds = bx_get('ids');
  *     if (!$aIds || !is_array($aIds)) {
- *         $this->_echoResultJson(array());
+ *         echoJson(array());
  *         exit;
  *     }
  *
@@ -217,7 +217,7 @@
  *         $iAffected++;
  *     }
  *
- *     $this->_echoResultJson(array(
+ *     echoJson(array(
  *         'msg' => $iAffected > 0 ? sprintf("%d profiles successfully activated", $iAffected) : "Profile(s) activation failed",
  *         'grid' => $this->getCode(false),
  *         'blink' => $aIdsAffected,
@@ -235,7 +235,7 @@
  *
  * The action can be used as 'single' or 'bulk', in the case of 'single' action 'ids' array always has one element.
  *
- * As the result, action must outputs JSON array, which is done by _echoResultJson function.
+ * As the result, action must outputs JSON array, which is done by echoJson function.
  * The defined indexes in the array determines behavior after action is performed, the following behaviors are supported:
  *
  * - msg: display javascript alert message.

+ 3 - 3
inc/classes/BxDolGridConnections.php

@@ -55,7 +55,7 @@ class BxDolGridConnections extends BxTemplGrid
             $iId = (int)array_pop($aIds);
 
         if (!$iId) {
-            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            echoJson(array('msg' => _t('_sys_txt_error_occured')));
             exit;
         }
 
@@ -63,9 +63,9 @@ class BxDolGridConnections extends BxTemplGrid
 
         $a = $oConn->actionAdd($iId);
         if (isset($a['err']) && $a['err'])
-            $this->_echoResultJson(array('msg' => $a['msg']), true);
+            echoJson(array('msg' => $a['msg']));
         else
-            $this->_echoResultJson(array('grid' => $this->getCode(false), 'blink' => $iId), true);
+            echoJson(array('grid' => $this->getCode(false), 'blink' => $iId));
     }
 
     /**

+ 1 - 1
inc/classes/BxDolReport.php

@@ -174,7 +174,7 @@ class BxDolReport extends BxDolObject
      */
     public function actionReport()
     {
-        return $this->_echoResultJson($this->_getReport());
+        return echoJson($this->_getReport());
     }
 
 	public function actionGetReportedBy()

+ 6 - 6
inc/classes/BxDolVote.php

@@ -205,7 +205,7 @@ class BxDolVote extends BxDolObject
     public function actionVote()
     {
         if(!$this->isEnabled()) {
-            $this->_echoResultJson(array('code' => 1));
+            echoJson(array('code' => 1));
             return;
         }
 
@@ -221,18 +221,18 @@ class BxDolVote extends BxDolObject
         $bPerformUndo = $bVoted && $bUndo ? true : false;
 
         if(!$bPerformUndo && !$this->isAllowedVote(true)) {
-            $this->_echoResultJson(array('code' => 2, 'msg' => $this->msgErrAllowedVote()));
+            echoJson(array('code' => 2, 'msg' => $this->msgErrAllowedVote()));
             return;
         }
 
         if((!$bLikeMode && !$this->_oQuery->isPostTimeoutEnded($iObjectId, $iAuthorIp)) || ($bLikeMode && $bVoted && !$bUndo)) {
-            $this->_echoResultJson(array('code' => 3, 'msg' => _t('_vote_err_duplicate_vote')));
+            echoJson(array('code' => 3, 'msg' => _t('_vote_err_duplicate_vote')));
             return;
         }
 
         $iValue = bx_get('value');
         if($iValue === false) {
-            $this->_echoResultJson(array('code' => 4));
+            echoJson(array('code' => 4));
             return;
         }
 
@@ -248,7 +248,7 @@ class BxDolVote extends BxDolObject
 
 		$iId = $this->_oQuery->putVote($iObjectId, $iAuthorId, $iAuthorIp, $iValue, $bPerformUndo);
         if($iId === false) {
-            $this->_echoResultJson(array('code' => 5));
+            echoJson(array('code' => 5));
             return;
         }
 
@@ -261,7 +261,7 @@ class BxDolVote extends BxDolObject
         $oZ->alert();
 
         $aVote = $this->_oQuery->getVote($iObjectId);
-        $this->_echoResultJson(array(
+        echoJson(array(
             'code' => 0,
             'rate' => $aVote['rate'],
             'count' => $aVote['count'],

+ 7 - 0
inc/utils.inc.php

@@ -440,6 +440,13 @@ function echoDbgLog($mWhat, $sDesc = '', $sFileName = 'debug.log')
     fclose($rFile);
 }
 
+function echoJson($a)
+{
+	header('Content-type: text/html; charset=utf-8');
+
+	echo json_encode($a);
+}
+
 function clear_xss($val)
 {
     if ($GLOBALS['logged']['admin'])

+ 2 - 2
modules/base/general/classes/BxBaseModGeneralGridAdministration.php

@@ -40,7 +40,7 @@ class BxBaseModGeneralGridAdministration extends BxTemplGrid
         $iAffected = 0;
         $aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -62,7 +62,7 @@ class BxBaseModGeneralGridAdministration extends BxTemplGrid
             $iAffected++;
         }
 
-        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t($CNF['T']['grid_action_err_delete'])));
+        echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t($CNF['T']['grid_action_err_delete'])));
     }
 
     protected function _getActionDelete($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())

+ 0 - 10
modules/base/notifications/classes/BxBaseModNotificationsModule.php

@@ -140,16 +140,6 @@ class BxBaseModNotificationsModule extends BxDolModule
 				break;
 		}
     }
-
-    protected function _echoResultJson($a, $isAutoWrapForFormFileSubmit = false)
-    {
-        header('Content-type: text/html; charset=utf-8');
-
-        $s = json_encode($a);
-        if ($isAutoWrapForFormFileSubmit && !empty($_FILES))
-            $s = '<textarea>' . $s . '</textarea>';
-        echo $s;
-    }
 }
 
 /** @} */

+ 3 - 3
modules/base/profile/classes/BxBaseModProfileGridAdministration.php

@@ -41,7 +41,7 @@ class BxBaseModProfileGridAdministration extends BxBaseModGeneralGridAdministrat
 
     	$aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds) || !$oMenu) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             return;
         }
 
@@ -55,7 +55,7 @@ class BxBaseModProfileGridAdministration extends BxBaseModGeneralGridAdministrat
         }
 
         if(empty($aIdsResult)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             return;
         }
 
@@ -68,7 +68,7 @@ class BxBaseModProfileGridAdministration extends BxBaseModGeneralGridAdministrat
 
 		$sContent = BxTemplFunctions::getInstance()->transBox($this->_oModule->_oConfig->getName() . 'set_acl_level_popup', $sContent);
 
-    	$this->_echoResultJson(array('popup' => $sContent), true);
+    	echoJson(array('popup' => $sContent));
     }
 
 	public function performActionDeleteWithContent()

+ 4 - 4
modules/boonex/accounts/classes/BxAccntGridAdministration.php

@@ -34,7 +34,7 @@ class BxAccntGridAdministration extends BxBaseModProfileGridAdministration
 
     	$aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             return;
         }
 
@@ -48,7 +48,7 @@ class BxAccntGridAdministration extends BxBaseModProfileGridAdministration
         		$iAffected++;
 			}
 
-		$this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t($CNF['T']['grid_action_err_perform'])));
+		echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t($CNF['T']['grid_action_err_perform'])));
     }
 
     public function resetQueryParams()
@@ -66,7 +66,7 @@ class BxAccntGridAdministration extends BxBaseModProfileGridAdministration
 
     	$aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             return;
         }
 
@@ -78,7 +78,7 @@ class BxAccntGridAdministration extends BxBaseModProfileGridAdministration
         		$iAffected++;
         	}
 
-        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t($CNF['T']['grid_action_err_perform'])));
+        echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t($CNF['T']['grid_action_err_perform'])));
     }
 
     protected function _enable($mixedId, $isChecked)

+ 6 - 6
modules/boonex/antispam/classes/BxAntispamGridDNSBL.php

@@ -40,7 +40,7 @@ class BxAntispamGridDNSBL extends BxTemplGrid
             _t('_bx_antispam_help_dnsbl')
         );
 
-        $this->_echoResultJson(array('popup' => array('html' => $s)), true);
+        echoJson(array('popup' => array('html' => $s)));
     }
 
     /**
@@ -52,7 +52,7 @@ class BxAntispamGridDNSBL extends BxTemplGrid
         $sGrid = $oModule->serviceBlockLog();
 
         if (!$sGrid) {
-            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            echoJson(array('msg' => _t('_sys_txt_error_occured')));
             exit;
         }
 
@@ -62,7 +62,7 @@ class BxAntispamGridDNSBL extends BxTemplGrid
             $sGrid . '<button class="bx-btn" style="float:none;" onclick ="$(\'.bx-popup-applied:visible\').dolPopupHide();">' . _t('_sys_close') . '</button>'
         );
 
-        $this->_echoResultJson(array('popup' => array('html' => $s)), true);
+        echoJson(array('popup' => array('html' => $s)));
 
     }
 
@@ -173,7 +173,7 @@ class BxAntispamGridDNSBL extends BxTemplGrid
 
         $s = BxTemplFunctions::getInstance()->popupBox($oForm->getId() . '_form', _t('_bx_antispam_popup_dnsbl_recheck'), $s);
 
-        $this->_echoResultJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))), true);
+        echoJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))));
     }
 
     /**
@@ -252,7 +252,7 @@ class BxAntispamGridDNSBL extends BxTemplGrid
             else
                 $aRes = array('msg' => _t('_sys_txt_error_occured')); // if record adding failed, display error message
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
 
         } else { // if form is not submitted or some fields are invalid, display popup with form
 
@@ -272,7 +272,7 @@ class BxAntispamGridDNSBL extends BxTemplGrid
                     });
                 </script>');
 
-            $this->_echoResultJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))));
 
         }
     }

+ 4 - 4
modules/boonex/antispam/classes/BxAntispamGridIpTable.php

@@ -52,7 +52,7 @@ class BxAntispamGridIpTable extends BxTemplGrid
             $iId = (int)bx_get('ID');
 
         if (!$iId) {
-            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            echoJson(array('msg' => _t('_sys_txt_error_occured')));
             exit;
         }
 
@@ -63,7 +63,7 @@ class BxAntispamGridIpTable extends BxTemplGrid
     {
         $oForm = BxDolForm::getObjectInstance('bx_antispam_ip_table_form', $sDisplay); // get form instance for specified form object and display
         if (!$oForm) {
-            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            echoJson(array('msg' => _t('_sys_txt_error_occured')));
             exit;
         }
 
@@ -101,7 +101,7 @@ class BxAntispamGridIpTable extends BxTemplGrid
             else
                 $aRes = array('msg' => _t('_sys_txt_error_occured')); // if record adding failed, display error message
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
 
         } else { // if form is not submitted or some fields are invalid, display popup with form
 
@@ -121,7 +121,7 @@ class BxAntispamGridIpTable extends BxTemplGrid
                     });
                 </script>');
 
-            $this->_echoResultJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))));
 
         }
     }

+ 6 - 6
modules/boonex/developer/classes/BxDevFormsDisplays.php

@@ -53,7 +53,7 @@ class BxDevFormsDisplays extends BxTemplStudioFormsDisplays
             else
                 $aRes = array('msg' => _t('_bx_dev_frm_err_displays_create'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-display-create-popup', _t('_bx_dev_frm_txt_displays_create_popup'), $this->_oTemplate->parseHtmlByName('form_add_display.html', array(
                 'form_id' => $oForm->aFormAttrs['id'],
@@ -62,7 +62,7 @@ class BxDevFormsDisplays extends BxTemplStudioFormsDisplays
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -76,7 +76,7 @@ class BxDevFormsDisplays extends BxTemplStudioFormsDisplays
         if(!$aIds || !is_array($aIds)) {
             $iId = (int)bx_get('id');
             if(!$iId) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
@@ -88,7 +88,7 @@ class BxDevFormsDisplays extends BxTemplStudioFormsDisplays
         $aDisplay = array();
         $iDisplay = $this->oDb->getDisplays(array('type' => 'by_id', 'value' => $iId), $aDisplay);
         if($iDisplay != 1 || empty($aDisplay)){
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -104,7 +104,7 @@ class BxDevFormsDisplays extends BxTemplStudioFormsDisplays
             else
                 $aRes = array('msg' => _t('_bx_dev_frm_err_displays_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-display-edit-popup', _t('_bx_dev_frm_txt_displays_edit_popup', _t($aDisplay['title'])), $this->_oTemplate->parseHtmlByName('form_add_display.html', array(
                 'form_id' => $oForm->aFormAttrs['id'],
@@ -113,7 +113,7 @@ class BxDevFormsDisplays extends BxTemplStudioFormsDisplays
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 

+ 8 - 8
modules/boonex/developer/classes/BxDevFormsForms.php

@@ -43,7 +43,7 @@ class BxDevFormsForms extends BxTemplStudioFormsForms
             else
                 $aRes = array('msg' => _t('_bx_dev_frm_err_forms_create'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-form-create-popup', _t('_bx_dev_frm_txt_forms_create_popup'), $this->oModule->_oTemplate->parseHtmlByName('form_add_form.html', array(
                 'form_id' => $oForm->aFormAttrs['id'],
@@ -52,7 +52,7 @@ class BxDevFormsForms extends BxTemplStudioFormsForms
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -66,7 +66,7 @@ class BxDevFormsForms extends BxTemplStudioFormsForms
         if(!$aIds || !is_array($aIds)) {
             $iId = (int)bx_get('id');
             if(!$iId) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
@@ -78,7 +78,7 @@ class BxDevFormsForms extends BxTemplStudioFormsForms
         $aForm = array();
         $this->oDb->getForms(array('type' => 'by_id', 'value' => $iId), $aForm, false);
         if(empty($aForm) || !is_array($aForm)){
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -105,7 +105,7 @@ class BxDevFormsForms extends BxTemplStudioFormsForms
             else
                 $aRes = array('msg' => _t('_bx_dev_frm_err_forms_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-form-edit-popup', _t('_bx_dev_frm_txt_forms_edit_popup', _t($aForm['title'])), $this->oModule->_oTemplate->parseHtmlByName('form_add_form.html', array(
                 'form_id' => $oForm->aFormAttrs['id'],
@@ -114,7 +114,7 @@ class BxDevFormsForms extends BxTemplStudioFormsForms
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -124,7 +124,7 @@ class BxDevFormsForms extends BxTemplStudioFormsForms
 
         $aForm = $this->_getItem('getForms');
         if($aForm === false) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -177,7 +177,7 @@ class BxDevFormsForms extends BxTemplStudioFormsForms
             'content' => $oForm->getCode()
         )));
 
-        $this->_echoResultJson(array('popup' => $sContent), true);
+        echoJson(array('popup' => $sContent));
     }
 }
 /** @} */

+ 8 - 8
modules/boonex/developer/classes/BxDevFormsPreLists.php

@@ -41,7 +41,7 @@ class BxDevFormsPreLists extends BxTemplStudioFormsPreLists
             else
                 $aRes = array('msg' => _t('_bx_dev_frm_err_prelists_create'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-prelist-create-popup', _t('_bx_dev_frm_txt_prelists_create_popup'), $this->oModule->_oTemplate->parseHtmlByName('form_add_list.html', array(
                 'form_id' => $oForm->aFormAttrs['id'],
@@ -50,7 +50,7 @@ class BxDevFormsPreLists extends BxTemplStudioFormsPreLists
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -62,7 +62,7 @@ class BxDevFormsPreLists extends BxTemplStudioFormsPreLists
 
         $aList = $this->_getItem('getLists');
         if($aList === false) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -78,7 +78,7 @@ class BxDevFormsPreLists extends BxTemplStudioFormsPreLists
             else
                 $aRes = array('msg' => _t('_bx_dev_frm_err_prelists_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-prelist-edit-popup', _t('_bx_dev_frm_txt_prelists_edit_popup', _t($aList['title'])), $this->oModule->_oTemplate->parseHtmlByName('form_add_list.html', array(
                 'form_id' => $oForm->aFormAttrs['id'],
@@ -87,7 +87,7 @@ class BxDevFormsPreLists extends BxTemplStudioFormsPreLists
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -99,7 +99,7 @@ class BxDevFormsPreLists extends BxTemplStudioFormsPreLists
         if(!$aIds || !is_array($aIds)) {
             $iId = (int)bx_get('id');
             if(!$iId) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
@@ -111,7 +111,7 @@ class BxDevFormsPreLists extends BxTemplStudioFormsPreLists
         $aList = array();
         $this->oDb->getLists(array('type' => 'by_id', 'value' => $iId), $aList, false);
         if(!is_array($aList) || empty($aList)){
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -154,7 +154,7 @@ class BxDevFormsPreLists extends BxTemplStudioFormsPreLists
             'content' => $oForm->getCode()
         )));
 
-        $this->_echoResultJson(array('popup' => $sContent), true);
+        echoJson(array('popup' => $sContent));
     }
 
     protected function _canDelete($aList)

+ 6 - 6
modules/boonex/developer/classes/BxDevFormsPreValues.php

@@ -52,7 +52,7 @@ class BxDevFormsPreValues extends BxTemplStudioFormsPreValues
             else
                 $aRes = array('msg' => _t('_bx_dev_frm_err_prevalues_create'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-prevalue-create-popup', _t('_bx_dev_frm_txt_prevalues_create_popup'), $this->oModule->_oTemplate->parseHtmlByName('form_add_value.html', array(
                 'form_id' => $oForm->aFormAttrs['id'],
@@ -61,7 +61,7 @@ class BxDevFormsPreValues extends BxTemplStudioFormsPreValues
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -73,7 +73,7 @@ class BxDevFormsPreValues extends BxTemplStudioFormsPreValues
 
         $aValue = $this->_getItem('getValues');
         if($aValue === false) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -90,7 +90,7 @@ class BxDevFormsPreValues extends BxTemplStudioFormsPreValues
             } else
                 $aRes = array('msg' => _t('_bx_dev_frm_err_prevalues_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-prevalue-edit-popup', _t('_bx_dev_frm_txt_prevalues_edit_popup', _t($aValue['lkey'])), $this->oModule->_oTemplate->parseHtmlByName('form_add_value.html', array(
                 'form_id' => $oForm->aFormAttrs['id'],
@@ -99,7 +99,7 @@ class BxDevFormsPreValues extends BxTemplStudioFormsPreValues
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -126,7 +126,7 @@ class BxDevFormsPreValues extends BxTemplStudioFormsPreValues
             $mixedValue = $oForm->getCleanValue('Value');
             if(!$this->canUseForSet($mixedValue)) {
                 if($this->oDb->isListUsedInSet($this->sList)) {
-                    $this->_echoResultJson(array('msg' => _t('_bx_dev_frm_err_prevalues_create_forbidden', BX_DOL_STUDIO_FIELD_PRE_VALUE_INT_MAX)), true);
+                    echoJson(array('msg' => _t('_bx_dev_frm_err_prevalues_create_forbidden', BX_DOL_STUDIO_FIELD_PRE_VALUE_INT_MAX)));
                     return false;
                 }
 

+ 5 - 5
modules/boonex/developer/classes/BxDevNavigationItems.php

@@ -51,7 +51,7 @@ class BxDevNavigationItems extends BxTemplStudioNavigationItems
             else
                 $aRes = array('msg' => _t('_bx_dev_nav_err_items_create'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-item-create-popup', _t('_bx_dev_nav_txt_items_create_popup'), $this->_oTemplate->parseHtmlByName('nav_add_item.html', array(
                 'form_id' => $oForm->aFormAttrs['id'],
@@ -60,7 +60,7 @@ class BxDevNavigationItems extends BxTemplStudioNavigationItems
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -72,7 +72,7 @@ class BxDevNavigationItems extends BxTemplStudioNavigationItems
 
         $aItem = $this->_getItem('getItems');
         if($aItem === false) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -88,7 +88,7 @@ class BxDevNavigationItems extends BxTemplStudioNavigationItems
             else
                 $aRes = array('msg' => _t('_bx_dev_nav_err_items_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-item-edit-popup', _t('_bx_dev_nav_txt_items_edit_popup', _t($aItem['title_system'])), $this->oModule->_oTemplate->parseHtmlByName('nav_add_item.html', array(
                 'form_id' => $oForm->aFormAttrs['id'],
@@ -97,7 +97,7 @@ class BxDevNavigationItems extends BxTemplStudioNavigationItems
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 

+ 7 - 7
modules/boonex/developer/classes/BxDevNavigationMenus.php

@@ -43,7 +43,7 @@ class BxDevNavigationMenus extends BxTemplStudioNavigationMenus
             else
                 $aRes = array('msg' => _t('_bx_dev_nav_err_menus_create'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-menu-create-popup', _t('_bx_dev_nav_txt_menus_create_popup'), $this->oModule->_oTemplate->parseHtmlByName('nav_add_menu.html', array(
                 'form_id' => $oForm->aFormAttrs['id'],
@@ -52,7 +52,7 @@ class BxDevNavigationMenus extends BxTemplStudioNavigationMenus
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -64,7 +64,7 @@ class BxDevNavigationMenus extends BxTemplStudioNavigationMenus
 
         $aMenu = $this->_getItem('getMenus');
         if($aMenu === false) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -80,7 +80,7 @@ class BxDevNavigationMenus extends BxTemplStudioNavigationMenus
             else
                 $aRes = array('msg' => _t('_bx_dev_nav_err_menus_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-menu-edit-popup', _t('_bx_dev_nav_txt_menus_edit_popup', _t($aMenu['title'])), $this->oModule->_oTemplate->parseHtmlByName('nav_add_menu.html', array(
                 'form_id' => $oForm->aFormAttrs['id'],
@@ -89,7 +89,7 @@ class BxDevNavigationMenus extends BxTemplStudioNavigationMenus
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -99,7 +99,7 @@ class BxDevNavigationMenus extends BxTemplStudioNavigationMenus
 
         $aMenu = $this->_getItem('getMenus');
         if($aMenu === false) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -147,7 +147,7 @@ class BxDevNavigationMenus extends BxTemplStudioNavigationMenus
             'content' => $oForm->getCode()
         )));
 
-        $this->_echoResultJson(array('popup' => $sContent), true);
+        echoJson(array('popup' => $sContent));
     }
 
     private function fillInSelects(&$aInputs)

+ 6 - 6
modules/boonex/developer/classes/BxDevNavigationSets.php

@@ -41,7 +41,7 @@ class BxDevNavigationSets extends BxTemplStudioNavigationSets
             else
                 $aRes = array('msg' => _t('_bx_dev_nav_err_sets_create'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-set-create-popup', _t('_bx_dev_nav_txt_sets_create_popup'), $this->_oTemplate->parseHtmlByName('nav_add_set.html', array(
                 'form_id' => $oForm->aFormAttrs['id'],
@@ -50,7 +50,7 @@ class BxDevNavigationSets extends BxTemplStudioNavigationSets
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -64,7 +64,7 @@ class BxDevNavigationSets extends BxTemplStudioNavigationSets
         if(!$aIds || !is_array($aIds)) {
             $sId = bx_get('set_name');
             if(!$sId) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
@@ -76,7 +76,7 @@ class BxDevNavigationSets extends BxTemplStudioNavigationSets
         $aSet = array();
         $this->oDb->getSets(array('type' => 'by_name', 'value' => $sId), $aSet, false);
         if(empty($aSet) || !is_array($aSet)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -92,7 +92,7 @@ class BxDevNavigationSets extends BxTemplStudioNavigationSets
             else
                 $aRes = array('msg' => _t('_bx_dev_nav_err_sets_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-set-edit-popup', _t('_bx_dev_nav_txt_sets_edit_popup', _t($aSet['title'])), $this->_oTemplate->parseHtmlByName('nav_add_set.html', array(
                 'form_id' => $oForm->aFormAttrs['id'],
@@ -101,7 +101,7 @@ class BxDevNavigationSets extends BxTemplStudioNavigationSets
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 

+ 2 - 2
modules/boonex/developer/classes/BxDevPolyglotManage.php

@@ -44,14 +44,14 @@ class BxDevPolyglotManage extends BxTemplStudioGrid
     {
         $aResult = array('msg' => _t(BxDolStudioLanguagesUtils::getInstance()->compileLanguage() ? '_adm_pgt_scs_recompiled' : '_adm_pgt_err_cannot_recompile_lang'));
 
-        $this->_echoResultJson($aResult, true);
+        echoJson($aResult);
     }
 
     public function performActionRestore()
     {
         $aResult = array('msg' => _t(BxDolStudioLanguagesUtils::getInstance()->restoreLanguage() ? '_adm_pgt_scs_restored' : '_adm_pgt_err_cannot_restore_lang'));
 
-        $this->_echoResultJson($aResult, true);
+        echoJson($aResult);
     }
 
     protected function _getCellDefault($mixedValue, $sKey, $aField, $aRow)

+ 9 - 9
modules/boonex/invites/classes/BxInvGridRequests.php

@@ -25,19 +25,19 @@ class BxInvGridRequests extends BxTemplGrid
     {
     	$aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
         $aRequest = $this->_oModule->_oDb->getRequests(array('type' => 'by_id', 'value' => (int)array_shift($aIds)));
 		if(empty($aRequest) || !is_array($aRequest)){
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
 		$sContent = BxTemplFunctions::getInstance()->transBox('bx-invites-info-popup', $this->_oModule->_oTemplate->getBlockRequestText($aRequest));
 
-		$this->_echoResultJson(array('popup' => array('html' => $sContent)), true);
+		echoJson(array('popup' => array('html' => $sContent)));
     }
 	public function performActionInvite($aParams = array())
     {
@@ -45,14 +45,14 @@ class BxInvGridRequests extends BxTemplGrid
 
     	$mixedAllowed = $this->_oModule->isAllowedInvite($iProfileId);
     	if($mixedAllowed !== true) {
-	    	$this->_echoResultJson(array('msg' => $mixedAllowed));
+	    	echoJson(array('msg' => $mixedAllowed));
 			exit;
     	}
 
         $iAffected = 0;
         $aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -78,7 +78,7 @@ class BxInvGridRequests extends BxTemplGrid
             $iAffected++;
         }
 
-        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected, 'msg' => _t('_bx_invites_msg_invitation_sent', $iAffected)) : array('msg' => _t('_bx_invites_err_invite')));
+        echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected, 'msg' => _t('_bx_invites_msg_invitation_sent', $iAffected)) : array('msg' => _t('_bx_invites_err_invite')));
     }
 	public function performActionDelete($aParams = array())
     {
@@ -86,14 +86,14 @@ class BxInvGridRequests extends BxTemplGrid
 
     	$mixedAllowed = $this->_oModule->isAllowedDeleteRequest($iProfileId);
     	if($mixedAllowed !== true) {
-	    	$this->_echoResultJson(array('msg' => $mixedAllowed));
+	    	echoJson(array('msg' => $mixedAllowed));
 			exit;
     	}
 
         $iAffected = 0;
         $aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -110,7 +110,7 @@ class BxInvGridRequests extends BxTemplGrid
             $iAffected++;
         }
 
-        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_bx_invites_err_delete_request')));
+        echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_bx_invites_err_delete_request')));
     }
 
 	protected function _getCellNip($mixedValue, $sKey, $aField, $aRow)

+ 4 - 14
modules/boonex/invites/classes/BxInvModule.php

@@ -36,17 +36,17 @@ class BxInvModule extends BxDolModule
 
         $mixedAllowed = $this->isAllowedInvite($iProfileId);
         if($mixedAllowed !== true)
-        	return $this->_echoResultJson(array('message' => $mixedAllowed));
+        	return echoJson(array('message' => $mixedAllowed));
 
 	    if(!isAdmin($iAccountId)) {
 			$iInvited = (int)$this->_oDb->getInvites(array('type' => 'count_by_account', 'value' => $iAccountId));
 			if(($this->_oConfig->getCountPerUser() - $iInvited) <= 0)
-				return $this->_echoResultJson(array('message' => _t('_bx_invites_err_limit_reached')));
+				return echoJson(array('message' => _t('_bx_invites_err_limit_reached')));
 		}
 
     	$oKeys = BxDolKey::getInstance();
     	if(!$oKeys)
-    		return  $this->_echoResultJson(array('message' => _t('_bx_invites_err_not_available')));  		
+    		return  echoJson(array('message' => _t('_bx_invites_err_not_available')));  		
 
     	$sKey = $oKeys->getNewKey(false, $this->_oConfig->getKeyLifetime());
 
@@ -59,7 +59,7 @@ class BxInvModule extends BxDolModule
 			'date' => time()
 		));
 
-        $this->_echoResultJson(array('popup' => $this->_oTemplate->getLinkPopup(
+        echoJson(array('popup' => $this->_oTemplate->getLinkPopup(
         	$this->getJoinLink($sKey)
         )));
     }
@@ -358,16 +358,6 @@ class BxInvModule extends BxDolModule
 		$sJoinUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account');
 		return bx_append_url_params($sJoinUrl, array($sKeyCode => $sKey));
 	}
-
-	protected function _echoResultJson($a, $isAutoWrapForFormFileSubmit = false)
-    {
-        header('Content-type: text/html; charset=utf-8');
-
-        $s = json_encode($a);
-        if ($isAutoWrapForFormFileSubmit && !empty($_FILES))
-            $s = '<textarea>' . $s . '</textarea>';
-        echo $s;
-    }
 }
 
 /** @} */

+ 9 - 9
modules/boonex/membership_pricing/template/scripts/BxBaseStudioPermissionsPrices.php

@@ -105,7 +105,7 @@ class BxBaseStudioPermissionsPrices extends BxDolStudioPermissionsPrices
             $aPrice = array();
             $iPrice = $this->oDb->getPrices(array('type' => 'by_level_id_duration', 'level_id' => $oForm->getCleanValue('IDLevel'), 'days' => $oForm->getCleanValue('Days')), $aPrice);
             if($iPrice != 0) {
-                $this->_echoResultJson(array('msg' => _t('_adm_prm_err_price_duplicate')), true);
+                echoJson(array('msg' => _t('_adm_prm_err_price_duplicate')));
                 return;
             }
 
@@ -116,7 +116,7 @@ class BxBaseStudioPermissionsPrices extends BxDolStudioPermissionsPrices
             } else
                 $aRes = array('msg' => _t('_adm_prm_err_price_create'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             bx_import('BxTemplStudioFunctions');
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-prm-price-add-popup', _t('_adm_prm_txt_price_add_popup'), $this->_oTemplate->parseHtmlByName('prm_add_price.html', array(
@@ -126,7 +126,7 @@ class BxBaseStudioPermissionsPrices extends BxDolStudioPermissionsPrices
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -138,7 +138,7 @@ class BxBaseStudioPermissionsPrices extends BxDolStudioPermissionsPrices
         if(!$aIds || !is_array($aIds)) {
             $iId = (int)bx_get('id');
             if(!$iId) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
@@ -150,7 +150,7 @@ class BxBaseStudioPermissionsPrices extends BxDolStudioPermissionsPrices
         $aPrice = array();
         $iPrice = $this->oDb->getPrices(array('type' => 'by_id', 'value' => $iId), $aPrice);
         if($iPrice != 1 || empty($aPrice)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -239,7 +239,7 @@ class BxBaseStudioPermissionsPrices extends BxDolStudioPermissionsPrices
             $aPrice = array();
             $iPrice = $this->oDb->getPrices(array('type' => 'by_level_id_duration', 'level_id' => $oForm->getCleanValue('IDLevel'), 'days' => $oForm->getCleanValue('Days')), $aPrice);
             if($iPrice != 0 && !empty($aPrice) && $aPrice['id'] != $iId) {
-                $this->_echoResultJson(array('msg' => _t('_adm_prm_err_price_duplicate')), true);
+                echoJson(array('msg' => _t('_adm_prm_err_price_duplicate')));
                 return;
             }
 
@@ -248,7 +248,7 @@ class BxBaseStudioPermissionsPrices extends BxDolStudioPermissionsPrices
             else
                 $aRes = array('msg' => _t('_adm_prm_err_price_update'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } else {
             bx_import('BxTemplStudioFunctions');
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-prm-price-edit-popup', _t('_adm_prm_txt_price_edit_popup', $aPrice['days']), $this->_oTemplate->parseHtmlByName('prm_add_price.html', array(
@@ -258,7 +258,7 @@ class BxBaseStudioPermissionsPrices extends BxDolStudioPermissionsPrices
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -266,7 +266,7 @@ class BxBaseStudioPermissionsPrices extends BxDolStudioPermissionsPrices
     {
         $aIds = bx_get('ids');
         if (!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 

+ 1 - 1
modules/boonex/notifications/classes/BxNtfsModule.php

@@ -34,7 +34,7 @@ class BxNtfsModule extends BxBaseModNotificationsModule
         $aParams = $this->_prepareParamsGet();
         $sEvents = $this->_oTemplate->getPosts($aParams);
 
-        $this->_echoResultJson(array('events' => $sEvents));
+        echoJson(array('events' => $sEvents));
     }
 
     /**

+ 2 - 2
modules/boonex/oauth2/classes/BxOAuthGrid.php

@@ -47,7 +47,7 @@ class BxOAuthGrid extends BxTemplGrid
             else
                 $aRes = array('msg' => "Error occured"); // if record adding failed, display error message
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
 
         } else { // if form is not submitted or some fields are invalid, display popup with form
 
@@ -69,7 +69,7 @@ class BxOAuthGrid extends BxTemplGrid
                     });
                 </script>');
 
-            $this->_echoResultJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))));
 
         }
     }

+ 9 - 9
modules/boonex/sites/classes/BxSitesGridBrowse.php

@@ -34,13 +34,13 @@ class BxSitesGridBrowse extends BxTemplGrid
 
         $sMsg = $this->_oModule->isAllowedAdd();
         if($sMsg !== CHECK_ACTION_RESULT_ALLOWED) {
-            $this->_echoResultJson(array('msg' => $sMsg), true);
+            echoJson(array('msg' => $sMsg));
             return;
         }
 
         $oForm = BxDolForm::getObjectInstance('bx_sites', 'bx_sites_site_add');
         if(!$oForm) {
-            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            echoJson(array('msg' => _t('_sys_txt_error_occured')));
             return;
         }
 
@@ -55,13 +55,13 @@ class BxSitesGridBrowse extends BxTemplGrid
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
             return;
         }
 
         $sDomain = $oForm->getCleanValue('domain');
         if($this->_oModule->_oDb->isAccount(array('domain' => $sDomain))) {
-            $this->_echoResultJson(array('msg' => _t('_bx_sites_txt_err_site_exists')), true);
+            echoJson(array('msg' => _t('_bx_sites_txt_err_site_exists')));
             return;
         }
 
@@ -72,7 +72,7 @@ class BxSitesGridBrowse extends BxTemplGrid
         ));
 
         if(!$iAccountId) {
-            $this->_echoResultJson(array('msg' => _t('_bx_sites_txt_err_site_creation')), true);
+            echoJson(array('msg' => _t('_bx_sites_txt_err_site_creation')));
             return;
         }
 
@@ -80,25 +80,25 @@ class BxSitesGridBrowse extends BxTemplGrid
         $oAccount->onAccountCreated($iAccountId);
 
         $sUrl = $this->_oModule->startSubscription($iAccountId);
-        $this->_echoResultJson(array('eval' => 'window.open(\'' . $sUrl . '\', \'_self\');', 'popup_not_hide' => 1), true);
+        echoJson(array('eval' => 'window.open(\'' . $sUrl . '\', \'_self\');', 'popup_not_hide' => 1));
     }
 
     public function performActionView()
     {
         $aIds = bx_get('ids');
         if(empty($aIds) || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             return;
         }
 
         $aAccount = $this->_oModule->_oDb->getAccount(array('type' => 'id', 'value' => $aIds[0]));
         if(empty($aAccount) || !is_array($aAccount)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             return;
         }
 
         $sUrl = $this->_oModule->getDomain($aAccount['domain'], true, true);
-        $this->_echoResultJson(array('eval' => 'window.open(\'' . $sUrl . '\',\'_blank\');'), true);
+        echoJson(array('eval' => 'window.open(\'' . $sUrl . '\',\'_blank\');'));
     }
 
     protected function _addJsCss()

+ 11 - 11
modules/boonex/sites/classes/BxSitesGridOverview.php

@@ -35,7 +35,7 @@ class BxSitesGridOverview extends BxTemplGrid
 
         $oForm = BxDolForm::getObjectInstance('bx_sites', 'bx_sites_site_confirm');
         if(!$oForm) {
-            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            echoJson(array('msg' => _t('_sys_txt_error_occured')));
             return;
         }
 
@@ -59,7 +59,7 @@ class BxSitesGridOverview extends BxTemplGrid
 
         $oForm = BxDolForm::getObjectInstance('bx_sites', 'bx_sites_site_pending');
         if(!$oForm) {
-            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            echoJson(array('msg' => _t('_sys_txt_error_occured')));
             return;
         }
 
@@ -75,7 +75,7 @@ class BxSitesGridOverview extends BxTemplGrid
 
         $oForm = BxDolForm::getObjectInstance('bx_sites', 'bx_sites_site_cancel');
         if(!$oForm) {
-            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            echoJson(array('msg' => _t('_sys_txt_error_occured')));
             return;
         }
 
@@ -89,14 +89,14 @@ class BxSitesGridOverview extends BxTemplGrid
 
         $bResult = $this->_oModule->cancelSubscription($aAccount['pd_profile_id']);
         if(!$bResult) {
-            $this->_echoResultJson(array('msg' => _t('_bx_sites_txt_err_cannot_perform')), true);
+            echoJson(array('msg' => _t('_bx_sites_txt_err_cannot_perform')));
             return;
         }
 
         $oPermalinks = BxDolPermalinks::getInstance();
 
         $sUrl = BX_DOL_URL_ROOT . $oPermalinks->permalink('page.php?i=site-view&id=' . $aAccount['id']);
-        $this->_echoResultJson(array('eval' => 'window.open(\'' . $sUrl . '\',\'_self\');'), true);
+        echoJson(array('eval' => 'window.open(\'' . $sUrl . '\',\'_self\');'));
     }
 
     public function performActionCanceled()
@@ -105,7 +105,7 @@ class BxSitesGridOverview extends BxTemplGrid
 
         $oForm = BxDolForm::getObjectInstance('bx_sites', 'bx_sites_site_reactivate');
         if(!$oForm) {
-            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            echoJson(array('msg' => _t('_sys_txt_error_occured')));
             return;
         }
 
@@ -123,7 +123,7 @@ class BxSitesGridOverview extends BxTemplGrid
 
         $oForm = BxDolForm::getObjectInstance('bx_sites', 'bx_sites_site_suspended');
         if(!$oForm) {
-            $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
+            echoJson(array('msg' => _t('_sys_txt_error_occured')));
             return;
         }
 
@@ -267,7 +267,7 @@ class BxSitesGridOverview extends BxTemplGrid
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
             return;
         }
 
@@ -277,7 +277,7 @@ class BxSitesGridOverview extends BxTemplGrid
         $iAccount = $oForm->getCleanValue('id');
         $aAccount = $this->_oModule->_oDb->getAccount(array('type' => 'id', 'value' => $iAccount));
         if(empty($aAccount) || !is_array($aAccount)) {
-            $this->_echoResultJson(array('msg' => _t('_bx_sites_txt_err_site_is_not_defined')), true);
+            echoJson(array('msg' => _t('_bx_sites_txt_err_site_is_not_defined')));
             return;
         }
 
@@ -288,11 +288,11 @@ class BxSitesGridOverview extends BxTemplGrid
     {
         $sUrl = $this->_oModule->startSubscription($aAccount['id']);
         if(empty($sUrl)) {
-            $this->_echoResultJson(array('msg' => _t('_bx_sites_txt_err_cannot_perform')), true);
+            echoJson(array('msg' => _t('_bx_sites_txt_err_cannot_perform')));
             return;
         }
 
-        $this->_echoResultJson(array('eval' => 'window.open(\'' . $sUrl . '\', \'_self\');', 'popup_not_hide' => 1), true);
+        echoJson(array('eval' => 'window.open(\'' . $sUrl . '\', \'_self\');', 'popup_not_hide' => 1));
     }
 }
 /** @} */

+ 20 - 20
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -55,7 +55,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         $sType = bx_process_input($_POST['type']);
         $sMethod = 'getForm' . ucfirst($sType);
         if(!method_exists($this, $sMethod)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             return;
         }
 
@@ -63,12 +63,12 @@ class BxTimelineModule extends BxBaseModNotificationsModule
 
         $mixedAllowed = $this->isAllowedPost(true);
         if($mixedAllowed !== true) {
-            $this->_echoResultJson(array('msg' => strip_tags($mixedAllowed)));
+            echoJson(array('msg' => strip_tags($mixedAllowed)));
             return;
         }
 
         $aResult = $this->$sMethod();
-        $this->_echoResultJson($aResult);
+        echoJson($aResult);
     }
 
     function actionDelete()
@@ -80,14 +80,14 @@ class BxTimelineModule extends BxBaseModNotificationsModule
 
         $mixedAllowed = $this->isAllowedDelete($aEvent, true);
         if($mixedAllowed !== true) {
-            $this->_echoResultJson(array('code' => 1, 'msg' => strip_tags($mixedAllowed)));
+            echoJson(array('code' => 1, 'msg' => strip_tags($mixedAllowed)));
             return;
         }
 
         if(!$this->deleteEvent($aEvent))
-        	$this->_echoResultJson(array('code' => 2));
+        	echoJson(array('code' => 2));
         else 
-        	$this->_echoResultJson(array('code' => 0, 'id' => $iId));
+        	echoJson(array('code' => 0, 'id' => $iId));
     }
 
     public function actionShare()
@@ -103,19 +103,19 @@ class BxTimelineModule extends BxBaseModNotificationsModule
 
         $aShared = $this->_oDb->getShared($aContent['type'], $aContent['action'], $aContent['object_id']);
         if(empty($aShared) || !is_array($aShared)) {
-            $this->_echoResultJson(array('code' => 1, 'msg' => _t('_bx_timeline_txt_err_cannot_share')));
+            echoJson(array('code' => 1, 'msg' => _t('_bx_timeline_txt_err_cannot_share')));
             return;
         }
 
         $mixedAllowed = $this->isAllowedShare($aShared, true);
         if($mixedAllowed !== true) {
-            $this->_echoResultJson(array('code' => 2, 'msg' => strip_tags($mixedAllowed)));
+            echoJson(array('code' => 2, 'msg' => strip_tags($mixedAllowed)));
             return;
         }
 
         $bShared = $this->_oDb->isShared($aShared['id'], $iOwnerId, $iAuthorId);
 		if($bShared) {
-        	$this->_echoResultJson(array('code' => 3, 'msg' => _t('_bx_timeline_txt_err_already_shared')));
+        	echoJson(array('code' => 3, 'msg' => _t('_bx_timeline_txt_err_already_shared')));
             return;
         }
 
@@ -131,7 +131,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         ));
 
         if(empty($iId)) {
-	        $this->_echoResultJson(array('code' => 4, 'msg' => _t('_bx_timeline_txt_err_cannot_share')));        
+	        echoJson(array('code' => 4, 'msg' => _t('_bx_timeline_txt_err_cannot_share')));        
 	        return;
         }
 
@@ -140,7 +140,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         $aShared = $this->_oDb->getShared($aContent['type'], $aContent['action'], $aContent['object_id']);
 		$sCounter = $this->_oTemplate->getShareCounter($aShared);
 
-		$this->_echoResultJson(array(
+		echoJson(array(
 			'code' => 0, 
 			'msg' => _t('_bx_timeline_txt_msg_success_share'), 
 			'count' => $aShared['shares'], 
@@ -156,7 +156,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         $iEvent = bx_process_input(bx_get('id'), BX_DATA_INT);
         $aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'value' => $iEvent));
 
-        $this->_echoResultJson(array('item' => $this->_oTemplate->getPost($aEvent, array('type' => 'owner', 'owner_id' => $this->_iOwnerId, 'dynamic_mode' => true))));
+        echoJson(array('item' => $this->_oTemplate->getPost($aEvent, array('type' => 'owner', 'owner_id' => $this->_iOwnerId, 'dynamic_mode' => true))));
     }
 
     function actionGetPosts()
@@ -164,7 +164,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         $aParams = $this->_prepareParamsGet();
         list($sItems, $sLoadMore, $sBack) = $this->_oTemplate->getPosts($aParams);
 
-        $this->_echoResultJson(array('items' => $sItems, 'load_more' => $sLoadMore, 'back' => $sBack));
+        echoJson(array('items' => $sItems, 'load_more' => $sLoadMore, 'back' => $sBack));
     }
 
     public function actionGetPostForm($sType)
@@ -173,12 +173,12 @@ class BxTimelineModule extends BxBaseModNotificationsModule
 
         $sMethod = 'getForm' . ucfirst($sType);
         if(!method_exists($this, $sMethod)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             return;
         }
         $aResult = $this->$sMethod();
 
-        $this->_echoResultJson($aResult);
+        echoJson($aResult);
     }
 
     public function actionGetComments()
@@ -189,14 +189,14 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         $iId = bx_process_input(bx_get('id'), BX_DATA_INT);
         $sComments = $this->_oTemplate->getComments($sSystem, $iId);
 
-        $this->_echoResultJson(array('content' => $sComments));
+        echoJson(array('content' => $sComments));
     }
 
     public function actionAddAttachLink()
     {
         $aResult = $this->getFormAttachLink();
 
-        $this->_echoResultJson($aResult);
+        echoJson($aResult);
     }
 
     public function actionDeleteAttachLink()
@@ -204,13 +204,13 @@ class BxTimelineModule extends BxBaseModNotificationsModule
     	$iUserId = $this->getUserId();
         $iLinkId = bx_process_input(bx_get('id'), BX_DATA_INT);
         if(empty($iLinkId)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             return;
         }
 
         $aLink = $this->_oDb->getUnusedLinks($iUserId, $iLinkId);
     	if(empty($aLink) || !is_array($aLink)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             return;
         }
 
@@ -223,7 +223,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         else
             $aResult = array('code' => 1, 'msg' => _t('_bx_timeline_form_post_input_link_err_delete'));
 
-        $this->_echoResultJson($aResult);
+        echoJson($aResult);
     }
 
     public function actionGetAttachLinkForm()

+ 4 - 4
samples/BxGridMy.php

@@ -196,7 +196,7 @@ class BxGridMy extends BxTemplGrid
             else
                 $aRes = array('msg' => "Error occured"); // if record adding failed, display error message
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
 
         } else { // if form is not submitted or some fields are invalid, display popup with form
 
@@ -218,7 +218,7 @@ class BxGridMy extends BxTemplGrid
                     });
                 </script>');
 
-            $this->_echoResultJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))));
 
         }
     }
@@ -231,7 +231,7 @@ class BxGridMy extends BxTemplGrid
         $iAffected = 0;
         $aIds = bx_get('ids');
         if (!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -243,7 +243,7 @@ class BxGridMy extends BxTemplGrid
             $iAffected++;
         }
 
-        $this->_echoResultJson(array_merge(
+        echoJson(array_merge(
                 array(
                     'grid' => $this->getCode(false),
                     'blink' => $aIdsAffected,

+ 4 - 4
studio/template/scripts/BxBaseStudioFormsDisplays.php

@@ -31,7 +31,7 @@ class BxBaseStudioFormsDisplays extends BxDolStudioFormsDisplays
         if(!$aIds || !is_array($aIds)) {
             $iId = (int)bx_get('id');
             if(!$iId) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
@@ -43,7 +43,7 @@ class BxBaseStudioFormsDisplays extends BxDolStudioFormsDisplays
         $aDisplay = array();
         $iDisplay = $this->oDb->getDisplays(array('type' => 'by_id', 'value' => $iId), $aDisplay);
         if($iDisplay != 1 || empty($aDisplay)){
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -119,7 +119,7 @@ class BxBaseStudioFormsDisplays extends BxDolStudioFormsDisplays
             else
                 $aRes = array('msg' => _t('_adm_form_err_displays_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } 
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-form-forms-edit-popup', _t('_adm_form_txt_displays_edit_popup', _t($aDisplay['title'])), $this->_oTemplate->parseHtmlByName('form_add_display.html', array(
@@ -129,7 +129,7 @@ class BxBaseStudioFormsDisplays extends BxDolStudioFormsDisplays
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 

+ 14 - 14
studio/template/scripts/BxBaseStudioFormsFields.php

@@ -41,16 +41,16 @@ class BxBaseStudioFormsFields extends BxDolStudioFormsFields
         $oClass = new $sClass(array('module' => $this->sModule, 'object' => $this->sObject, 'display' => $this->sDisplay));
 
         if(!$oClass->canAdd()) {
-            $this->_echoResultJson(array('msg' => _t('_adm_form_err_field_add_not_allowed')), true);
+            echoJson(array('msg' => _t('_adm_form_err_field_add_not_allowed')));
             exit;
         }
 
         $mixedResult = $oClass->getCode($sAction, $this->_sObject);
         if(is_string($mixedResult))
-            $this->_echoResultJson(array('popup' => array('html' => $mixedResult, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $mixedResult, 'options' => array('closeOnOuterClick' => false))));
         else if(is_int($mixedResult) || is_bool($mixedResult)) {
             $aResult = $mixedResult !== false ? array('grid' => $this->getCode(false), 'blink' => (int)$mixedResult) : array('msg' => _t('_adm_form_err_field_add'));
-            $this->_echoResultJson($aResult, true);
+            echoJson($aResult);
         }
     }
 
@@ -62,7 +62,7 @@ class BxBaseStudioFormsFields extends BxDolStudioFormsFields
         if(!$aIds || !is_array($aIds)) {
             $iId = (int)bx_get('di_id');
             if(!$iId) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
@@ -74,7 +74,7 @@ class BxBaseStudioFormsFields extends BxDolStudioFormsFields
         $aField = array();
         $this->oDb->getInputs(array('type' => 'by_object_id', 'object' => $this->sObject, 'id' => (int)$iId), $aField, false);
         if(empty($aField) || !is_array($aField)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -84,17 +84,17 @@ class BxBaseStudioFormsFields extends BxDolStudioFormsFields
 
         $sClass = $this->sClass . $this->getClassName($aField['type']);
         if(!class_exists($sClass)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
         $oClass = new $sClass(array('module' => $this->sModule, 'object' => $this->sObject, 'display' => $this->sDisplay), $aField);
         $mixedResult = $oClass->getCode($sAction, $this->_sObject);
         if(is_string($mixedResult))
-            $this->_echoResultJson(array('popup' => array('html' => $mixedResult, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $mixedResult, 'options' => array('closeOnOuterClick' => false))));
         else if(is_bool($mixedResult)) {
             $aResult = $mixedResult ? array('grid' => $this->getCode(false), 'blink' => $iId) : array('msg' => _t('_adm_form_err_field_edit'));
-            $this->_echoResultJson($aResult, true);
+            echoJson($aResult);
         }
     }
 
@@ -105,7 +105,7 @@ class BxBaseStudioFormsFields extends BxDolStudioFormsFields
         $iAffected = 0;
         $aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -139,7 +139,7 @@ class BxBaseStudioFormsFields extends BxDolStudioFormsFields
             $iAffected++;
         }
 
-        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_from_err_field_delete')));
+        echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_from_err_field_delete')));
     }
 
     public function performActionShowTo()
@@ -150,7 +150,7 @@ class BxBaseStudioFormsFields extends BxDolStudioFormsFields
         if(!$aIds || !is_array($aIds)) {
             $iId = (int)bx_get('id');
             if(!$iId) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
@@ -162,7 +162,7 @@ class BxBaseStudioFormsFields extends BxDolStudioFormsFields
         $aField = array();
         $this->oDb->getInputs(array('type' => 'by_object_id', 'object' => $this->sObject, 'id' => (int)$iId), $aField, false);
         if(empty($aField) || !is_array($aField)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -255,7 +255,7 @@ class BxBaseStudioFormsFields extends BxDolStudioFormsFields
             else
                 $aRes = array('msg' => _t('_adm_form_err_field_show_to'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } 
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-form-field-show-to-popup', _t('_adm_form_txt_field_show_to_popup', _t($aField['caption_system'])), $this->_oTemplate->parseHtmlByName('form_add_field.html', array(
@@ -265,7 +265,7 @@ class BxBaseStudioFormsFields extends BxDolStudioFormsFields
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => $sContent), true);
+            echoJson(array('popup' => $sContent));
         }
     }
 

+ 4 - 4
studio/template/scripts/BxBaseStudioFormsForms.php

@@ -29,7 +29,7 @@ class BxBaseStudioFormsForms extends BxDolStudioFormsForms
         if(!$aIds || !is_array($aIds)) {
             $iId = (int)bx_get('id');
             if(!$iId) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
@@ -41,7 +41,7 @@ class BxBaseStudioFormsForms extends BxDolStudioFormsForms
         $aFormData = array();
         $iFormData = $this->oDb->getForms(array('type' => 'by_id', 'value' => $iId), $aFormData);
         if($iFormData != 1 || empty($aFormData)){
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -117,7 +117,7 @@ class BxBaseStudioFormsForms extends BxDolStudioFormsForms
             else
                 $aRes = array('msg' => _t('_adm_form_err_forms_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-form-forms-edit-popup', _t('_adm_form_txt_forms_edit_popup', _t($aFormData['title'])), $this->_oTemplate->parseHtmlByName('form_add_form.html', array(
@@ -127,7 +127,7 @@ class BxBaseStudioFormsForms extends BxDolStudioFormsForms
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 

+ 7 - 7
studio/template/scripts/BxBaseStudioFormsPreLists.php

@@ -114,7 +114,7 @@ class BxBaseStudioFormsPreLists extends BxDolStudioFormsPreLists
             else
                 $aRes = array('msg' => _t('_adm_form_err_pre_lists_create'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } 
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-form-pre-list-create-popup', _t('_adm_form_txt_pre_lists_create_popup'), $this->_oTemplate->parseHtmlByName('form_add_list.html', array(
@@ -124,7 +124,7 @@ class BxBaseStudioFormsPreLists extends BxDolStudioFormsPreLists
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -134,7 +134,7 @@ class BxBaseStudioFormsPreLists extends BxDolStudioFormsPreLists
 
         $aList = $this->_getItem('getLists');
         if($aList === false) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -210,7 +210,7 @@ class BxBaseStudioFormsPreLists extends BxDolStudioFormsPreLists
             else
                 $aRes = array('msg' => _t('_adm_form_err_pre_lists_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-form-pre-list-edit-popup', _t('_adm_form_txt_pre_lists_edit_popup', _t($aList['title'])), $this->_oTemplate->parseHtmlByName('form_add_list.html', array(
@@ -220,7 +220,7 @@ class BxBaseStudioFormsPreLists extends BxDolStudioFormsPreLists
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -231,7 +231,7 @@ class BxBaseStudioFormsPreLists extends BxDolStudioFormsPreLists
         $iAffected = 0;
         $aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -254,7 +254,7 @@ class BxBaseStudioFormsPreLists extends BxDolStudioFormsPreLists
             $iAffected++;
         }
 
-        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_from_err_pre_lists_delete')));
+        echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_from_err_pre_lists_delete')));
     }
 
     function getJsObject()

+ 9 - 9
studio/template/scripts/BxBaseStudioFormsPreValues.php

@@ -121,7 +121,7 @@ class BxBaseStudioFormsPreValues extends BxDolStudioFormsPreValues
                 $mixedValue = $oForm->getCleanValue('Value');
                 if(!$this->canUseForSet($mixedValue)) {
                     if($this->oDb->isListUsedInSet($this->sList)) {
-                        $this->_echoResultJson(array('msg' => _t('_adm_form_err_pre_values_create_forbidden', BX_DOL_STUDIO_FIELD_PRE_VALUE_INT_MAX)), true);
+                        echoJson(array('msg' => _t('_adm_form_err_pre_values_create_forbidden', BX_DOL_STUDIO_FIELD_PRE_VALUE_INT_MAX)));
                         return;
                     }
 
@@ -135,7 +135,7 @@ class BxBaseStudioFormsPreValues extends BxDolStudioFormsPreValues
             else
                 $aRes = array('msg' => _t('_adm_form_err_pre_values_create'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-form-pre-value-create-popup', _t('_adm_form_txt_pre_values_create_popup'), $this->_oTemplate->parseHtmlByName('form_add_value.html', array(
@@ -145,7 +145,7 @@ class BxBaseStudioFormsPreValues extends BxDolStudioFormsPreValues
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -155,7 +155,7 @@ class BxBaseStudioFormsPreValues extends BxDolStudioFormsPreValues
 
         $aValue = $this->_getItem('getValues');
         if($aValue === false) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -251,7 +251,7 @@ class BxBaseStudioFormsPreValues extends BxDolStudioFormsPreValues
                 $mixedValue = $aAdd['Value'];
                 if(!$this->canUseForSet($mixedValue)) {
                     if($this->oDb->isListUsedInSet($this->sList)) {
-                        $this->_echoResultJson(array('msg' => _t('_adm_form_err_pre_values_create_forbidden', BX_DOL_STUDIO_FIELD_PRE_VALUE_INT_MAX)), true);
+                        echoJson(array('msg' => _t('_adm_form_err_pre_values_create_forbidden', BX_DOL_STUDIO_FIELD_PRE_VALUE_INT_MAX)));
                         return;
                     }
 
@@ -264,7 +264,7 @@ class BxBaseStudioFormsPreValues extends BxDolStudioFormsPreValues
             else
                 $aRes = array('msg' => _t('_adm_form_err_pre_values_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         } 
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-form-pre-value-edit-popup', _t('_adm_form_txt_pre_values_edit_popup', _t($aValue['lkey'])), $this->_oTemplate->parseHtmlByName('form_add_value.html', array(
@@ -274,7 +274,7 @@ class BxBaseStudioFormsPreValues extends BxDolStudioFormsPreValues
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -285,7 +285,7 @@ class BxBaseStudioFormsPreValues extends BxDolStudioFormsPreValues
         $iAffected = 0;
         $aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -324,7 +324,7 @@ class BxBaseStudioFormsPreValues extends BxDolStudioFormsPreValues
             $iAffected++;
         }
 
-        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_form_err_pre_values_delete')));
+        echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_form_err_pre_values_delete')));
     }
 
     function getJsObject()

+ 3 - 3
studio/template/scripts/BxBaseStudioNavigationImport.php

@@ -24,7 +24,7 @@ class BxBaseStudioNavigationImport extends BxDolStudioNavigationImport
         $iAffected = 0;
         $aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -40,7 +40,7 @@ class BxBaseStudioNavigationImport extends BxDolStudioNavigationImport
                 $oStorage = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES);
 
                 if(($mixedIcon = $oStorage->storeFileFromStorage(array('id' => (int)$aItem['icon']), false, 0)) === false) {
-                    $this->_echoResultJson(array('msg' => _t('_adm_nav_err_items_icon_copy') . $oStorage->getErrorString()), true);
+                    echoJson(array('msg' => _t('_adm_nav_err_items_icon_copy') . $oStorage->getErrorString()));
                     return;
                 }
 
@@ -79,7 +79,7 @@ class BxBaseStudioNavigationImport extends BxDolStudioNavigationImport
                     'eval' => $this->getJsObject() . '.onImport(oData)'
                 );
         }
-        $this->_echoResultJson($aResult);
+        echoJson($aResult);
     }
 
     function getJsObject()

+ 18 - 18
studio/template/scripts/BxBaseStudioNavigationItems.php

@@ -34,7 +34,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
             'grid' => $oGrid->getCode()
         )));
 
-        $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+        echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
     }
 
     public function performActionAdd()
@@ -50,7 +50,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
 
                 $mixedIcon = $oStorage->storeFileFromForm($_FILES['icon_image'], false, 0);
                 if($mixedIcon === false) {
-                    $this->_echoResultJson(array('msg' => _t('_adm_nav_err_items_icon_image') . $oStorage->getErrorString()), true);
+                    echoJson(array('msg' => _t('_adm_nav_err_items_icon_image') . $oStorage->getErrorString()));
                     return;
                 }
 
@@ -89,7 +89,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
             else
                 $aRes = array('msg' => _t('_adm_nav_err_items_create'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-nav-item-create-popup', _t('_adm_nav_txt_items_create_popup'), $this->_oTemplate->parseHtmlByName('nav_add_item.html', array(
@@ -99,7 +99,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -109,7 +109,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
 
         $aItem = $this->_getItem('getItems');
         if($aItem === false) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -126,7 +126,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
             if($bIconImageCur && ($bIconImageNew || $bIconFont)) {
                 $oStorage = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES);
                 if(!$oStorage->deleteFile((int)$aItem['icon'], 0)) {
-                    $this->_echoResultJson(array('msg' => _t('_adm_nav_err_items_icon_image_remove')), true);
+                    echoJson(array('msg' => _t('_adm_nav_err_items_icon_image_remove')));
                     return;
                 }
             }
@@ -136,7 +136,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
                 $oStorage = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES);
                 $sIcon = $oStorage->storeFileFromForm($_FILES['icon_image'], false, 0);
                 if($sIcon === false) {
-                    $this->_echoResultJson(array('msg' => _t('_adm_nav_err_items_icon_image') . $oStorage->getErrorString()), true);
+                    echoJson(array('msg' => _t('_adm_nav_err_items_icon_image') . $oStorage->getErrorString()));
                     return;
                 }
 
@@ -178,7 +178,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
             else
                 $aRes = array('msg' => _t('_adm_nav_err_items_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sTitle = _t($aItem['title']);
@@ -193,7 +193,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
             if($bUpdateGrid)
                 $aRes = array_merge($aRes, array('grid' => $this->getCode(false), 'blink' => $aItem['id']));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
     }
 
@@ -202,7 +202,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
         $iAffected = 0;
         $aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -215,7 +215,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
             $iAffected++;
         }
 
-        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_nav_err_items_delete')));
+        echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_nav_err_items_delete')));
     }
 
     public function performActionShowTo()
@@ -224,7 +224,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
 
         $aItem = $this->_getItem('getItems');
         if($aItem === false) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -317,7 +317,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
             else
                 $aRes = array('msg' => _t('_adm_nav_err_items_show_to'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-nav-item-hide-from-popup', _t('_adm_nav_txt_items_show_to_popup', _t($aItem['title'])), $this->_oTemplate->parseHtmlByName('nav_add_item.html', array(
@@ -327,7 +327,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => $sContent), true);
+            echoJson(array('popup' => $sContent));
         }
     }
 
@@ -337,7 +337,7 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
 
         $aIds = bx_get('ids');
         if(empty($aIds[0])) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -346,18 +346,18 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
         $aItem = array();
         $iItem = $this->oDb->getItems(array('type' => 'by_id', 'value' => $iId), $aItem);
         if($iItem != 1 || empty($aItem)){
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
         if(is_numeric($aItem['icon']) && (int)$aItem['icon'] != 0)
             if(!BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES)->deleteFile((int)$aItem['icon'], 0)) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
         if($this->oDb->updateItem($aItem['id'], array('icon' => '')) !== false)
-            $this->_echoResultJson(array('grid' => $this->getCode(false), 'blink' => $iId, 'preview' => $this->_getIconPreview($aItem['id']), 'eval' => $this->getJsObject() . ".onDeleteIcon(oData)"), true);
+            echoJson(array('grid' => $this->getCode(false), 'blink' => $iId, 'preview' => $this->_getIconPreview($aItem['id']), 'eval' => $this->getJsObject() . ".onDeleteIcon(oData)"));
     }
 
     public function getJsObject()

+ 7 - 7
studio/template/scripts/BxBaseStudioNavigationMenus.php

@@ -61,7 +61,7 @@ class BxBaseStudioNavigationMenus extends BxDolStudioNavigationMenus
             else
                 $aRes = array('msg' => _t('_adm_nav_err_menus_create'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-nav-menu-create-popup', _t('_adm_nav_txt_menus_create_popup'), $this->_oTemplate->parseHtmlByName('nav_add_menu.html', array(
@@ -71,7 +71,7 @@ class BxBaseStudioNavigationMenus extends BxDolStudioNavigationMenus
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -81,7 +81,7 @@ class BxBaseStudioNavigationMenus extends BxDolStudioNavigationMenus
 
         $aMenu = $this->_getItem('getMenus');
         if($aMenu === false) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -112,7 +112,7 @@ class BxBaseStudioNavigationMenus extends BxDolStudioNavigationMenus
             else
                 $aRes = array('msg' => _t('_adm_nav_err_menus_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-nav-menu-edit-popup', _t('_adm_nav_txt_menus_edit_popup', _t($aMenu['title'])), $this->_oTemplate->parseHtmlByName('nav_add_menu.html', array(
@@ -122,7 +122,7 @@ class BxBaseStudioNavigationMenus extends BxDolStudioNavigationMenus
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -131,7 +131,7 @@ class BxBaseStudioNavigationMenus extends BxDolStudioNavigationMenus
         $iAffected = 0;
         $aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -154,7 +154,7 @@ class BxBaseStudioNavigationMenus extends BxDolStudioNavigationMenus
             $iAffected++;
         }
 
-        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_nav_err_menus_delete')));
+        echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_nav_err_menus_delete')));
     }
 
     function getJsObject()

+ 10 - 10
studio/template/scripts/BxBaseStudioNavigationSets.php

@@ -105,7 +105,7 @@ class BxBaseStudioNavigationSets extends BxDolStudioNavigationSets
             else
                 $aRes = array('msg' => _t('_adm_nav_err_sets_create'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-nav-set-create-popup', _t('_adm_nav_txt_sets_create_popup'), $this->_oTemplate->parseHtmlByName('nav_add_set.html', array(
@@ -115,7 +115,7 @@ class BxBaseStudioNavigationSets extends BxDolStudioNavigationSets
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -127,7 +127,7 @@ class BxBaseStudioNavigationSets extends BxDolStudioNavigationSets
         if(!$aIds || !is_array($aIds)) {
             $sId = bx_get('set_name');
             if(!$sId) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
@@ -139,7 +139,7 @@ class BxBaseStudioNavigationSets extends BxDolStudioNavigationSets
         $aSet = array();
         $iSet = $this->oDb->getSets(array('type' => 'by_name', 'value' => $sId), $aSet);
         if($iSet != 1 || empty($aSet)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -215,7 +215,7 @@ class BxBaseStudioNavigationSets extends BxDolStudioNavigationSets
             else
                 $aRes = array('msg' => _t('_adm_nav_err_sets_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-nav-set-edit-popup', _t('_adm_nav_txt_sets_edit_popup', _t($aSet['title'])), $this->_oTemplate->parseHtmlByName('nav_add_set.html', array(
@@ -225,7 +225,7 @@ class BxBaseStudioNavigationSets extends BxDolStudioNavigationSets
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -234,13 +234,13 @@ class BxBaseStudioNavigationSets extends BxDolStudioNavigationSets
         $iAffected = 0;
         $aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
         $oGridItems = BxDolGrid::getObjectInstance('sys_studio_nav_items');
         if(!$oGridItems) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -256,7 +256,7 @@ class BxBaseStudioNavigationSets extends BxDolStudioNavigationSets
             $aMenus = array();
             $this->oDb->getMenus(array('type' => 'by_set_name', 'value' => $sId), $aMenus, false);
             if(is_array($aMenus) && count($aMenus) > 0) {
-                $this->_echoResultJson(array('msg' => _t('_adm_nav_err_sets_delete_used')));
+                echoJson(array('msg' => _t('_adm_nav_err_sets_delete_used')));
                 exit;
             }
 
@@ -275,7 +275,7 @@ class BxBaseStudioNavigationSets extends BxDolStudioNavigationSets
             $iAffected++;
         }
 
-        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_nav_err_sets_delete')));
+        echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_nav_err_sets_delete')));
     }
 
     function getJsObject()

+ 5 - 5
studio/template/scripts/BxBaseStudioPermissionsActions.php

@@ -23,7 +23,7 @@ class BxBaseStudioPermissionsActions extends BxDolStudioPermissionsActions
         $bEnable = (int)bx_get('checked');
 
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -37,7 +37,7 @@ class BxBaseStudioPermissionsActions extends BxDolStudioPermissionsActions
         }
 
         $sAction = $bEnable ? 'enable' : 'disable';
-        echo $this->_echoResultJson(array(
+        echo echoJson(array(
             $sAction => $aResultIds,
         ));
     }
@@ -51,7 +51,7 @@ class BxBaseStudioPermissionsActions extends BxDolStudioPermissionsActions
         if(!$aIds || !is_array($aIds)) {
             $iId = (int)bx_get('IDAction');
             if(!$iId) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
@@ -66,7 +66,7 @@ class BxBaseStudioPermissionsActions extends BxDolStudioPermissionsActions
         $aOption = array();
         $iOption = $this->oDb->getOptions(array('type' => 'by_level_action_ids', 'level_id' => $this->iLevel, 'action_id' => $iId), $aOption);
         if($iOption != 1 || empty($aOption)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -197,7 +197,7 @@ class BxBaseStudioPermissionsActions extends BxDolStudioPermissionsActions
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 

+ 16 - 16
studio/template/scripts/BxBaseStudioPermissionsLevels.php

@@ -33,7 +33,7 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
 
         if($oForm->isSubmittedAndValid()) {
             if(($iId = $this->_getAvailableId()) === false) {
-                $this->_echoResultJson(array('msg' => _t('_adm_prm_err_level_id')), true);
+                echoJson(array('msg' => _t('_adm_prm_err_level_id')));
                 return;
             }
 
@@ -43,7 +43,7 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
 
                 $mixedIcon = $oStorage->storeFileFromForm($_FILES['Icon_image'], false, 0);
                 if($mixedIcon === false) {
-                    $this->_echoResultJson(array('msg' => _t('_adm_prm_err_level_icon_image') . $oStorage->getErrorString()), true);
+                    echoJson(array('msg' => _t('_adm_prm_err_level_icon_image') . $oStorage->getErrorString()));
                     return;
                 }
 
@@ -70,7 +70,7 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
             else
                 $aRes = array('msg' => _t('_adm_prm_err_level_create'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-prm-level-create-popup', _t('_adm_prm_txt_level_create_popup'), $this->_oTemplate->parseHtmlByName('prm_add_level.html', array(
@@ -80,7 +80,7 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -92,7 +92,7 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
         if(!$aIds || !is_array($aIds)) {
             $iId = (int)bx_get('id');
             if(!$iId) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
@@ -104,7 +104,7 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
         $aLevel = array();
         $iLevel = $this->oDb->getLevels(array('type' => 'by_id', 'value' => $iId), $aLevel);
         if($iLevel != 1 || empty($aLevel)){
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -121,7 +121,7 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
             if($bIconImageCur && ($bIconImageNew || $bIconFont)) {
                 $oStorage = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES);
                 if(!$oStorage->deleteFile((int)$aLevel['icon'], 0)) {
-                    $this->_echoResultJson(array('msg' => _t('_adm_prm_err_level_icon_image_remove')), true);
+                    echoJson(array('msg' => _t('_adm_prm_err_level_icon_image_remove')));
                     return;
                 }
             }
@@ -131,7 +131,7 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
                 $oStorage = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES);
                 $sIcon = $oStorage->storeFileFromForm($_FILES['Icon_image'], false, 0);
                 if($sIcon === false) {
-                    $this->_echoResultJson(array('msg' => _t('_adm_prm_err_level_icon_image') . $oStorage->getErrorString()), true);
+                    echoJson(array('msg' => _t('_adm_prm_err_level_icon_image') . $oStorage->getErrorString()));
                     return;
                 }
 
@@ -152,7 +152,7 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
             else
                 $aRes = array('msg' => _t('_adm_prm_err_level_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-prm-level-edit-popup', _t('_adm_prm_txt_level_edit_popup', _t($aLevel['name'])), $this->_oTemplate->parseHtmlByName('prm_add_level.html', array(
@@ -162,7 +162,7 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -171,7 +171,7 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
         $iAffected = 0;
         $aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -184,7 +184,7 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
             $iAffected++;
         }
 
-        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_prm_err_level_delete')));
+        echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_prm_err_level_delete')));
     }
 
     public function performActionDeleteIcon()
@@ -193,7 +193,7 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
 
         $aIds = bx_get('ids');
         if(empty($aIds[0])) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -202,18 +202,18 @@ class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels
         $aLevel = array();
         $iLevel = $this->oDb->getLevels(array('type' => 'by_id', 'value' => $iId), $aLevel);
         if($iLevel != 1 || empty($aLevel)){
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
         if(is_numeric($aLevel['icon']) && (int)$aLevel['icon'] != 0)
             if(!BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES)->deleteFile((int)$aLevel['icon'], 0)) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
         if($this->oDb->updateLevels($aLevel['id'], array('icon' => '')) !== false)
-            $this->_echoResultJson(array('grid' => $this->getCode(false), 'blink' => $iId, 'preview' => $this->_getIconPreview($aLevel['id']), 'eval' => $this->getJsObject() . ".onDeleteIcon(oData)"), true);
+            echoJson(array('grid' => $this->getCode(false), 'blink' => $iId, 'preview' => $this->_getIconPreview($aLevel['id']), 'eval' => $this->getJsObject() . ".onDeleteIcon(oData)"));
     }
 
     public function getJsObject()

+ 4 - 4
studio/template/scripts/BxBaseStudioPolyglotEtemplates.php

@@ -25,7 +25,7 @@ class BxBaseStudioPolyglotEtemplates extends BxDolStudioPolyglotEtemplates
         if(!$aIds || !is_array($aIds)) {
             $iId = (int)bx_get('id');
             if(!$iId) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
@@ -37,7 +37,7 @@ class BxBaseStudioPolyglotEtemplates extends BxDolStudioPolyglotEtemplates
         $aEtemplate = array();
         $this->oDb->getEtemplates(array('type' => 'by_id', 'value' => $iId), $aEtemplate, false);
         if(empty($aEtemplate) || !is_array($aEtemplate)){
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -145,7 +145,7 @@ class BxBaseStudioPolyglotEtemplates extends BxDolStudioPolyglotEtemplates
             else
                 $aRes = array('msg' => _t('_adm_pgt_err_etemplates_edit'));
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-pgt-etemplate-edit-popup', _t('_adm_pgt_txt_etemplates_edit_popup', _t($aEtemplate['name_system'])), $this->_oTemplate->parseHtmlByName('pgt_new_etemplate.html', array(
@@ -155,7 +155,7 @@ class BxBaseStudioPolyglotEtemplates extends BxDolStudioPolyglotEtemplates
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 

+ 7 - 7
studio/template/scripts/BxBaseStudioPolyglotKeys.php

@@ -117,7 +117,7 @@ class BxBaseStudioPolyglotKeys extends BxDolStudioPolyglotKeys
             else
                 $aRes = array('msg' => $mixedResult);
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-lang-new-key-popup', _t('_adm_pgt_txt_nkp_add_popup'), $this->_oTemplate->parseHtmlByName('pgt_new_key.html', array(
@@ -127,7 +127,7 @@ class BxBaseStudioPolyglotKeys extends BxDolStudioPolyglotKeys
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -139,7 +139,7 @@ class BxBaseStudioPolyglotKeys extends BxDolStudioPolyglotKeys
         if(!$aIds || !is_array($aIds)) {
             $iId = (int)bx_get('id');
             if(!$iId) {
-                $this->_echoResultJson(array());
+                echoJson(array());
                 exit;
             }
 
@@ -233,7 +233,7 @@ class BxBaseStudioPolyglotKeys extends BxDolStudioPolyglotKeys
             else
                 $aRes = array('msg' => $mixedResult);
 
-            $this->_echoResultJson($aRes, true);
+            echoJson($aRes);
         }
         else {
             $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-lang-edit-key-popup', _t('_adm_pgt_txt_nkp_edit_popup', $aKey['key']), $this->_oTemplate->parseHtmlByName('pgt_new_key.html', array(
@@ -243,7 +243,7 @@ class BxBaseStudioPolyglotKeys extends BxDolStudioPolyglotKeys
                 'action' => $sAction
             )));
 
-            $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
+            echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
         }
     }
 
@@ -252,7 +252,7 @@ class BxBaseStudioPolyglotKeys extends BxDolStudioPolyglotKeys
         $iAffected = 0;
         $aIds = bx_get('ids');
         if(!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -265,7 +265,7 @@ class BxBaseStudioPolyglotKeys extends BxDolStudioPolyglotKeys
             $iAffected++;
         }
 
-        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_pgt_err_save')));
+        echoJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_pgt_err_save')));
     }
 
     function getJsObject()

+ 0 - 10
template/scripts/BxBaseCmts.php

@@ -799,16 +799,6 @@ class BxBaseCmts extends BxDolCmts
             ),
         );
     }
-    protected function _echoResultJson($a, $isAutoWrapForFormFileSubmit = false)
-    {
-
-        header('Content-type: text/html; charset=utf-8');
-
-        $s = json_encode($a);
-        if ($isAutoWrapForFormFileSubmit && !empty($_FILES))
-            $s = '<textarea>' . $s . '</textarea>'; // http://jquery.malsup.com/form/#file-upload
-        echo $s;
-    }
 }
 
 /** @} */

+ 6 - 20
template/scripts/BxBaseGrid.php

@@ -33,9 +33,7 @@ class BxBaseGrid extends BxDolGrid
     {
         require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
 
-        $this->_echoResultJson(array (
-            'grid' => $this->getCode(false),
-        ));
+        echoJson(array('grid' => $this->getCode(false)));
     }
 
     public function performActionReorder()
@@ -47,7 +45,7 @@ class BxBaseGrid extends BxDolGrid
         foreach ($aOrder as $mixedId)
             $this->_updateOrder($mixedId, ++$iOrder);
 
-        $this->_echoResultJson(array());
+        echoJson(array());
     }
 
     public function performActionDelete()
@@ -57,14 +55,14 @@ class BxBaseGrid extends BxDolGrid
         $iAffected = 0;
         $aIds = bx_get('ids');
         if (!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
         foreach ($aIds as $mixedId)
             $iAffected += $this->_delete($mixedId) ? 1 : 0;
 
-        echo $this->_echoResultJson(array_merge(
+        echo echoJson(array_merge(
             array(
                 'grid' => $this->getCode(false),
             ),
@@ -78,7 +76,7 @@ class BxBaseGrid extends BxDolGrid
 
         $aIds = bx_get('ids');
         if (!$aIds || !is_array($aIds)) {
-            $this->_echoResultJson(array());
+            echoJson(array());
             exit;
         }
 
@@ -88,9 +86,7 @@ class BxBaseGrid extends BxDolGrid
                 $aAffectedIds[] = $mixedId;
 
         $sAction = (int)bx_get('checked') ? 'enable' : 'disable';
-        echo $this->_echoResultJson(array(
-            $sAction => $aAffectedIds,
-        ));
+        echo echoJson(array($sAction => $aAffectedIds));
     }
 
     public function getCode ($isDisplayHeader = true)
@@ -616,16 +612,6 @@ class BxBaseGrid extends BxDolGrid
 
         $this->_oTemplate->addJsTranslation('_sys_grid_confirmation');
     }
-
-    protected function _echoResultJson($a, $isAutoWrapForFormFileSubmit = false)
-    {
-        header('Content-type: text/html; charset=utf-8');
-
-        $s = json_encode($a);
-        if ($isAutoWrapForFormFileSubmit && !empty($_FILES))
-            $s = '<textarea>' . $s . '</textarea>'; // http://jquery.malsup.com/form/#file-upload
-        echo $s;
-    }
 }
 
 /** @} */

+ 0 - 10
template/scripts/BxBasePrivacy.php

@@ -32,16 +32,6 @@ class BxBasePrivacy extends BxDolPrivacy
         $this->_oTemplate->addCss('grid.css');
         */
     }
-
-    protected function _echoResultJson($a, $isAutoWrapForFormFileSubmit = false)
-    {
-        header('Content-type: text/html; charset=utf-8');
-
-        $s = json_encode($a);
-        if ($isAutoWrapForFormFileSubmit && !empty($_FILES))
-            $s = '<textarea>' . $s . '</textarea>';
-        echo $s;
-    }
 }
 
 /** @} */

+ 0 - 10
template/scripts/BxBaseReport.php

@@ -347,16 +347,6 @@ class BxBaseReport extends BxDolReport
             'bx_repeat:list' => $aTmplReports
         ));
     }
-
-    protected function _echoResultJson($a, $isAutoWrapForFormFileSubmit = false)
-    {
-        header('Content-type: text/html; charset=utf-8');
-
-        $s = json_encode($a);
-        if ($isAutoWrapForFormFileSubmit && !empty($_FILES))
-            $s = '<textarea>' . $s . '</textarea>'; // http://jquery.malsup.com/form/#file-upload
-        echo $s;
-    }
 }
 
 /** @} */

+ 0 - 10
template/scripts/BxBaseVote.php

@@ -316,16 +316,6 @@ class BxBaseVote extends BxDolVote
             'bx_repeat:list' => $aTmplUsers
         ));
     }
-
-    protected function _echoResultJson($a, $isAutoWrapForFormFileSubmit = false)
-    {
-        header('Content-type: text/html; charset=utf-8');
-
-        $s = json_encode($a);
-        if ($isAutoWrapForFormFileSubmit && !empty($_FILES))
-            $s = '<textarea>' . $s . '</textarea>'; // http://jquery.malsup.com/form/#file-upload
-        echo $s;
-    }
 }
 
 /** @} */