Просмотр исходного кода

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

AntonLV 4 лет назад
Родитель
Сommit
03ab69d31a

+ 6 - 1
inc/classes/BxDolCaptchaQuery.php

@@ -11,7 +11,7 @@
  * Database queries for captcha objects.
  * @see BxDolCaptcha
  */
-class BxDolCaptchaQuery extends BxDolDb
+class BxDolCaptchaQuery extends BxDolFactoryObjectQuery
 {
     protected $_aObject;
 
@@ -23,6 +23,7 @@ class BxDolCaptchaQuery extends BxDolDb
 
     static public function getCaptchaObject ($sObject)
     {
+        return parent::getObjectFromTable($sObject, 'sys_objects_captcha');
         $oDb = BxDolDb::getInstance();
         $sQuery = $oDb->prepare("SELECT * FROM `sys_objects_captcha` WHERE `object` = ?", $sObject);
         $aObject = $oDb->getRow($sQuery);
@@ -32,6 +33,10 @@ class BxDolCaptchaQuery extends BxDolDb
         return $aObject;
     }
 
+    static public function getObjects ()
+    {
+        return parent::getObjectsFromTable('sys_objects_captcha');
+    }
 }
 
 /** @} */

+ 3 - 17
inc/js/editor.quill.js

@@ -20,7 +20,6 @@ function bx_editor_init(oEditor, oParams){
             handlers: {
             'show-html': function() {
                  bx_alert('<textarea class="bx-def-font-inputs bx-form-input-textarea bx-form-input-html-quill-code" id="' + oParams.name + '_code">' + oEditor.container.firstChild.innerHTML + '</textarea>',function() {
-                     //console.log($('#'+oParams.name+'_code').val());
                      oEditor.container.firstChild.innerHTML = $('#'+oParams.name+'_code').val();
                  });
             },  
@@ -334,14 +333,6 @@ function bx_editor_init(oEditor, oParams){
     if (bEmptyToolbar)
         $(oParams.selector).next().hide();
 
-    oEditor.keyboard.addBinding({
-        key: ' ',
-        handler: function(range, context) {
-            bx_editor_on_space_enter (oEditor.container.firstChild.innerHTML, oParams.selector);
-            return true;
-        }
-    });
-    
     oEditor.clipboard.addMatcher (Node.TEXT_NODE, function (node, delta) {
         const Delta = Quill.import('delta')
         bx_editor_on_space_enter(node.data, oParams.selector, false);
@@ -363,14 +354,6 @@ function bx_editor_init(oEditor, oParams){
         });
     }
     
-    oEditor.keyboard.bindings[13].unshift({
-        key: 13,
-        handler: (range, context) => {
-            bx_editor_on_space_enter (oEditor.container.firstChild.innerHTML, oParams.selector)
-            return true;
-        }
-    });
-    
     oEditor.on('text-change', function(delta, oldDelta, source) {
         sVal = oEditor.container.firstChild.innerHTML;
         if(!oParams.empty_tags){
@@ -408,6 +391,7 @@ function bx_editor_insert_img (sEditorId, sImgId, sImgUrl, sClasses) {
 
 function bx_editor_on_space_enter (sCode, sEditorId, bSpace = true)
 {
+    console.log(10);
     if (typeof glBxEditorOnSpaceEnterTimer !== 'undefined')
         clearTimeout(glBxEditorOnSpaceEnterTimer);
     
@@ -418,11 +402,13 @@ function bx_editor_on_space_enter (sCode, sEditorId, bSpace = true)
 }
 
 function bx_editor_on_space_enter_in(sCode, sEditorId) {
+     console.log(11);
     glBxEditorOnSpaceEnterTimer = undefined;
     if (typeof glOnSpaceEnterInEditor !== 'undefined' && glOnSpaceEnterInEditor instanceof Array) {
         for (var i = 0; i < glOnSpaceEnterInEditor.length; i++) {
             if (typeof glOnSpaceEnterInEditor[i] === "function") {;                                             
                 glOnSpaceEnterInEditor[i](sCode, sEditorId);
+                    console.log(12);                                               
             }
         }
     }

+ 1 - 1
install/sql/system.sql

@@ -491,7 +491,7 @@ SET @iCategoryId = LAST_INSERT_ID();
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
 (@iCategoryId, 'sys_security_form_token_enable', '_adm_stg_cpt_option_sys_security_form_token_enable', 'on', 'checkbox', '', '', '', 10),
 (@iCategoryId, 'sys_security_form_token_lifetime', '_adm_stg_cpt_option_sys_security_form_token_lifetime', '86400', 'digit', '', '', '', 11),
-(@iCategoryId, 'sys_captcha_default', '_adm_stg_cpt_option_sys_captcha_default', 'sys_recaptcha_new', 'select', 'sys_recaptcha_new,sys_recaptcha_invisible,sys_hcaptcha', '', '', '', 19),
+(@iCategoryId, 'sys_captcha_default', '_adm_stg_cpt_option_sys_captcha_default', 'sys_recaptcha_new', 'select', 'a:3:{s:6:"module";s:6:"system";s:6:"method";s:27:"get_options_captcha_default";s:5:"class";s:13:"TemplServices";}', '', '', 19),
 (@iCategoryId, 'sys_recaptcha_key_public', '_adm_stg_cpt_option_sys_recaptcha_key_public', '', 'digit', '', '', '', 20),
 (@iCategoryId, 'sys_recaptcha_key_private', '_adm_stg_cpt_option_sys_recaptcha_key_private', '', 'digit', '', '', '', 21),
 (@iCategoryId, 'sys_add_nofollow', '_adm_stg_cpt_option_sys_add_nofollow', 'on', 'checkbox', '', '', '', 30),

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

@@ -66,7 +66,7 @@ class BxBaseModGeneralModule extends BxDolModule
         if(isset($CNF['FIELD_STATUS']) && $aContentInfo[$CNF['FIELD_STATUS']] != 'active')
             return false;
 
-        if(isset($CNF['FIELD_STATUS_ADMIN']) && $aContentInfo[$CNF['FIELD_STATUS_ADMIN']] != 'active')
+        if(isset($CNF['FIELD_STATUS_ADMIN']) && isset($aContentInfo[$CNF['FIELD_STATUS_ADMIN']]) && $aContentInfo[$CNF['FIELD_STATUS_ADMIN']] != 'active')
             return false;
 
         return true;        

+ 2 - 2
modules/boonex/forum/classes/BxForumSearchResult.php

@@ -209,8 +209,8 @@ class BxForumSearchResult extends BxBaseModTextSearchResult
     function displayResultBlock()
     {
         if ($this->bShowcaseView) {
-            $this->oModule->_oTemplate->addCss(array('unaca.css'));
-            $this->oModule->_oTemplate->addJs(array('unaca.js'));
+            $this->oModule->_oTemplate->addCss(array('carusel.css'));
+            $this->oModule->_oTemplate->addJs(array('carusel.js'));
             
             return $this->oModule->_oTemplate->parseHtmlByName('unaca.html', ['content' => str_replace(['bx-forum-wrapper', 'bx-base-unit-showcase-wrapper'], '' ,str_replace('bx-search-result-block', 'bx-search-result-block unaca-t', parent::displayResultBlock()))]);
             

+ 0 - 0
modules/boonex/forum/js/unaca.js → modules/boonex/forum/js/carusel.js


+ 0 - 0
modules/boonex/forum/template/css/unaca.css → modules/boonex/forum/template/css/carusel.css


+ 5 - 0
studio/template/css/launcher.css

@@ -403,4 +403,9 @@ div.bx-std-widget-caption a {
 }
 #bx-informer .bx-informer-msg{
     background-color: rgba(255, 234, 193, 1);
+    display: none;
+    z-index: 10;
+}
+#bx-informer #sys-account-need-to-change-password.bx-informer-msg{
+    display: block;
 }

+ 10 - 0
template/scripts/BxBaseServices.php

@@ -980,6 +980,16 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
     }
     
 
+    public function serviceGetOptionsCaptchaDefault()
+    {
+        $aResults = [];
+        $aObjects = BxDolCaptchaQuery::getObjects();
+        foreach($aObjects as $aObject)
+            $aResults[$aObject['object']] = $aObject['title'];
+
+        return $aResults;
+    }
+
     public function serviceGetOptionsEmbedDefault()
     {
         $aResults = array(