Procházet zdrojové kódy

Merge branch 'master' of https://github.com/unaio/una

AntonLV před 3 roky
rodič
revize
825dbb3e31

+ 1 - 2
inc/js/editor.quill.js

@@ -444,10 +444,9 @@ function bx_editor_init(oEditor, oParams){
     else{
         oEditor.clipboard.addMatcher (Node.ELEMENT_NODE, function (node, delta) {
 			delta.forEach(e => {
-                console.log(e);
                 if(typeof e.insert == 'string' && e.attributes == null)
                     e.insert = e.insert.replace(/\n/g, '') + "\n";
-                 console.log(e);
+
                 if(e.attributes){
                     e.attributes.color = '';
                     e.attributes.background = '';

+ 4 - 4
template/scripts/BxBaseAccountForms.php

@@ -89,9 +89,6 @@ class BxBaseAccountForms extends BxDolProfileForms
         // perform action
         BxDolAccount::isAllowedCreate ($iProfileId, true);
 
-        if($bIsApi) 
-            return true;
-
         $this->_iProfileId = bx_get_logged_profile_id();
 
         $sRelocateCustom = $oForm->getCleanValue('relocate');
@@ -122,7 +119,7 @@ class BxBaseAccountForms extends BxDolProfileForms
             $a = BxDolService::call($sProfileModule, 'entity_add', array($iProfileId, $aProfileInfo));
 
             // in case of successful profile add redirect to the page after profile creation
-            if (0 == $a['code']) {
+            if (0 == $a['code'] && !$bIsApi) {
                 if($bRelocateCustom)
                     $this->_redirectAndExit($sRelocateCustom, false);
 
@@ -131,6 +128,9 @@ class BxBaseAccountForms extends BxDolProfileForms
             }
             // if creation failed, redirect to create profile form
         }
+        
+        if($bIsApi) 
+            return true;
 
         $sRelocate = !empty($sProfileModule) ? BxDolService::call($sProfileModule, 'profile_create_url', array(false)) : '';
         if(empty($sRelocate))

+ 4 - 0
template/scripts/BxBaseInformer.php

@@ -50,6 +50,10 @@ class BxBaseInformer extends BxDolInformer
 
             $aTmplVarsMessages[] = $a;
         }
+        
+        if (bx_is_api()){
+            return $aTmplVarsMessages;
+        }
 
         $this->_addJsCss();
         return $this->_oTemplate->parseHtmlByName('informer.html', [

+ 6 - 0
template/scripts/BxBasePage.php

@@ -488,6 +488,12 @@ class BxBasePage extends BxDolPage
                 'status' => $o->getStatus(),
             ];
             
+            $oInformer = BxDolInformer::getInstance(BxDolTemplate::getInstance());
+            $sRet = $oInformer ? $oInformer->display() : '';
+            if ($sRet){
+                $a['user']['informer'] = $sRet;
+            }
+            
             $sModuleNotifications = 'bx_notifications';
             if(BxDolRequest::serviceExists($sModuleNotifications, 'get_unread_notifications_num'))
                 $a['user']['notifications'] = bx_srv($sModuleNotifications, 'get_unread_notifications_num', [$o->id()]);