浏览代码

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

AntonLV 5 年之前
父节点
当前提交
9f2b35fed7

+ 20 - 0
embed.php

@@ -0,0 +1,20 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaCore UNA Core
+ * @{
+ */
+
+require_once('./inc/header.inc.php');
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+bx_import('BxDolEmbed');
+
+if (bx_get('a') == 'get_link'){
+    $sLink = bx_get('l');
+
+    $oEmbed = BxDolEmbed::getObjectInstance();
+    if ($oEmbed)
+        echoJson(['code' => $oEmbed->getLinkHTML($sLink), 'js' => strip_tags($oEmbed->addProcessLinkMethod())]);
+}

+ 36 - 0
inc/classes/BxDolHTMLPurifierFilterEmbed.php

@@ -0,0 +1,36 @@
+<?php
+
+class BxDolHTMLPurifierFilterEmbed extends HTMLPurifier_Filter
+{
+
+    /**
+     * @type string
+     */
+    public $name = 'Embed';
+
+    /**
+     * @param string $html
+     * @param HTMLPurifier_Config $config
+     * @param HTMLPurifier_Context $context
+     * @return string
+     */
+    public function preFilter($html, $config, $context)
+    {
+        $pre_regex = '/<div class="bx-embed-link" source="([^"]*)">(.*)<\/div>/i';
+        $pre_replace = '<div class="bx-embed-link" source="\1">\1</div>';
+        return preg_replace($pre_regex, $pre_replace, $html);
+
+    }
+
+    /**
+     * @param string $html
+     * @param HTMLPurifier_Config $config
+     * @param HTMLPurifier_Context $context
+     * @return string
+     */
+    public function postFilter($html, $config, $context)
+    {
+        return $html;
+    }
+}
+

+ 13 - 1
inc/js/classes/BxDolPage.js

@@ -10,7 +10,7 @@ function BxDolPage(oOptions) {
     this._sObject = oOptions.sObject; // page object
 
     this._sActionsUri = 'page.php';
-    this._sActionsUrl = oOptions.sRootUrl + this._sActionsUri; // actions url address
+    this._sActionsUrl = oOptions.sRootUrl; // actions url address
     this._aHtmlIds = oOptions.aHtmlIds;
 
     this._isStickyColumns = oOptions.isStickyColumns == undefined ? false : oOptions.isStickyColumns;
@@ -29,6 +29,18 @@ BxDolPage.prototype.init = function() {
             additionalMarginTop: 30
         });
     }
+    $(".bx-embed-link").each(function( index ) {
+        $obj =  $(this);
+        $.getJSON(sUrlRoot + '/embed.php?', {a: 'get_link', l: $(this).attr('source')}, function(aData){
+            
+            if ($obj.parents('.ql-editor').length == 0 || true){
+                console.log( $obj.html());
+                $obj.html(aData.code);
+                bx_embed_link();
+            }
+   
+        });
+    });
 };
 
 BxDolPage.prototype.showHelp = function(oLink, iBlockId)

+ 124 - 21
inc/js/editor.quill.js

@@ -9,7 +9,31 @@ function bx_editor_init(oEditor, oParams){
     hljs.configure({   
         languages: ['javascript', 'php', 'html', 'css']
     });
-    
+    if (oParams.toolbar){
+        oParams.toolbar = {
+            container: oParams.toolbar,
+                handlers: {
+                'embed': function(value) {
+                    bx_prompt(_t('_sys_txt_quill_tooltip_embed_popup_header'), 'https://yandex.ru/', function(oPopup){
+                        sLink = $(oPopup).find("input[type = 'text']").val()
+                        $.getJSON(oParams.root_url + 'embed.php?', {a: 'get_link', l: sLink}, function(aData){
+                            oEditor.insertEmbed(100, 'embed-link', {source: sLink, inlinecode : aData.code});
+                            bx_embed_link();
+                        });
+                    });
+                },
+                'link': function(value) {
+                    if (value) {
+                        bx_prompt(_t('_sys_txt_quill_tooltip_link_popup_header'), '', function(oPopup){
+                            oEditor.format('link', $(oPopup).find("input[type = 'text']").val());
+                        });
+                    } else {
+                        oEditor.format('link', false);
+                    }
+                }
+            }
+        }
+    }
     $(oParams.selector).after("<div id='" + oParams.name + "' class='bx-def-font-inputs bx-form-input-textarea bx-form-input-html bx-form-input-html-quill " + oParams.css_class + "'>" + $(oParams.selector).val() + "</div>" );
     $(oParams.selector).hide();
     
@@ -17,25 +41,105 @@ function bx_editor_init(oEditor, oParams){
                 
     if (typeof bQuillRegistred === 'undefined' && oParams.toolbar) {
         Quill.register("modules/imageUploader", ImageUploader); 
+        var Embed = Quill.import('blots/embed');
+        
+        class MenthionLink extends Embed {
+            static create(value) {
+                let node = super.create(value);
+                if (value.id && value.value){
+                    node.setAttribute('href', value.id);
+                    node.innerHTML = '@' + value.value;
+                    node.setAttribute('title', '@' + value.value);
+                }
+                return node;
+            }
+            
+            format(name, value) {
+                console.log('format'+name+"!"+value)
+                if (name === 'href' || name === 'title') {
+                    if (value) {
+                        this.domNode.setAttribute(name, value);
+                        if (name === 'title'){
+                            this.domNode.innerHTML = value;
+                        }
+                    } else {
+                        this.domNode.removeAttribute(name, value);
+                    }
+                } 
+                else {
+                    super.format(name, value);
+                }
+            };
+                
+            static formats(node) {
+                console.log(node+"x");
+                let format = {};
+                if (node.hasAttribute('href')) {
+                    format.href = node.getAttribute('href');
+                }
+                if (node.hasAttribute('title')) {
+                    format.title = node.getAttribute('title');
+                }
+                return format;
+            }  
+            
+        }
+        MenthionLink.blotName = 'menthion-link'; 
+        MenthionLink.className = 'bx-menthion-link';
+        MenthionLink.tagName = 'a';                
+        Quill.register({
+            'formats/menthion-link': MenthionLink
+        });
+        
+        class EmbedCode extends Embed {
+            static create(value) {
+                let node = super.create(value);
+                if (value.source && value.inlinecode){
+                    node.setAttribute('source', value.source);
+                    node.innerHTML = value.inlinecode;
+                    return node;
+                }
+                return node;
+            };
+           
+            format(name, value) {
+                if (name === 'source') {
+                    if (value) {
+                        this.domNode.setAttribute(name, value);
+                    } else {
+                        this.domNode.removeAttribute(name, value);
+                    }
+                } 
+                else {
+                    super.format(name, value);
+                }
+            };
+                
+            static formats(node) {
+                let format = {};
+                if (node.hasAttribute('source')) {
+                  format.source = node.getAttribute('source');
+                }
+                return format;
+            }    
+        }
+        EmbedCode.className = 'bx-embed-link';
+        EmbedCode.blotName = 'embed-link'; 
+        EmbedCode.tagName = 'div';                
+        Quill.register({
+            'formats/embed-link': EmbedCode
+        });
+        
+        
+        
         bQuillRegistred = true; 
+        
+        var icons = Quill.import('ui/icons');
+        icons['embed'] = '<svg class="fr-svg" focusable="false" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M20.73889,15.45929a3.4768,3.4768,0,0,0-5.45965-.28662L9.5661,12.50861a3.49811,3.49811,0,0,0-.00873-1.01331l5.72174-2.66809a3.55783,3.55783,0,1,0-.84527-1.81262L8.70966,9.6839a3.50851,3.50851,0,1,0,.0111,4.63727l5.7132,2.66412a3.49763,3.49763,0,1,0,6.30493-1.526ZM18.00745,5.01056A1.49993,1.49993,0,1,1,16.39551,6.3894,1.49994,1.49994,0,0,1,18.00745,5.01056ZM5.99237,13.49536a1.49989,1.49989,0,1,1,1.61194-1.37878A1.49982,1.49982,0,0,1,5.99237,13.49536Zm11.78211,5.494a1.49993,1.49993,0,1,1,1.61193-1.37885A1.49987,1.49987,0,0,1,17.77448,18.98932Z"></path></svg>';
     }
 
-    var Embed = Quill.import('blots/embed');
-    class EmbedLink extends Embed {
-        static create(value) {
-            let node = super.create(value);
-            node.setAttribute('href', value.id);
-            node.innerHTML = '@' + value.value;
-            return node;
-        }
-    }
-    EmbedLink.blotName = 'embed-link'; 
-    EmbedLink.className = 'embed-link';
-    EmbedLink.tagName = 'a';                
-    Quill.register({
-        'formats/embed-link': EmbedLink
-    });
 
+    
     var oConfig = {              
          theme: oParams.skin,
          modules: {
@@ -46,7 +150,7 @@ function bx_editor_init(oEditor, oParams){
                 allowedChars: /^[A-Za-z\sÅÄÖåäö]*$/,
                 mentionDenotationChars: ["@"],
                 showDenotationChar: false,
-                blotName: 'embed-link',
+                blotName: 'menthion-link',
                 source: function (searchTerm, renderList, mentionChar) {
                   $.getJSON(oParams.root_url + 'searchExtended.php?action=get_authors&', { term: searchTerm}, function(data){
                     renderList(data, searchTerm);
@@ -137,9 +241,9 @@ function bx_editor_insert_html (sEditorId, sImgId, sHtml)
     if ($('#' + sEditorId) &&  $('#' + sEditorId).attr('object_editor')){
         eval ('oEditor = ' + $('#' + sEditorId).attr('object_editor'));
         if (oEditor.getSelection())
-            oEditor.clipboard.dangerouslyPasteHTML(oEditor.getSelection().index,sHtml, 'api');
+            oEditor.clipboard.dangerouslyPasteHTML(oEditor.getSelection().index, sHtml, 'api');
         else
-             oEditor.clipboard.dangerouslyPasteHTML(0,sHtml, 'api');
+             oEditor.clipboard.dangerouslyPasteHTML(0, sHtml, 'api');
     }
 }
 
@@ -160,8 +264,7 @@ function bx_editor_on_space_enter (oEditor, sEditorId)
         glBxEditorOnSpaceEnterTimer = undefined;
         if (typeof glOnSpaceEnterInEditor !== 'undefined' && glOnSpaceEnterInEditor instanceof Array) {
             for (var i = 0; i < glOnSpaceEnterInEditor.length; i++) {
-                if (typeof glOnSpaceEnterInEditor[i] === "function") {;
-                    console.log(oEditor.container.firstChild.innerHTML);                                                  
+                if (typeof glOnSpaceEnterInEditor[i] === "function") {;                                             
                     glOnSpaceEnterInEditor[i](oEditor.container.firstChild.innerHTML, sEditorId);
                 }
             }

+ 13 - 5
inc/utils.inc.php

@@ -571,8 +571,7 @@ function clear_xss($val)
 {
     // HTML Purifier plugin
     global $oHtmlPurifier;
-    if (!isset($oHtmlPurifier) && !$GLOBALS['logged']['admin']) {
-
+    if (!isset($oHtmlPurifier) /*&& !$GLOBALS['logged']['admin']*/) {
         HTMLPurifier_Bootstrap::registerAutoload();
 
         $oConfig = HTMLPurifier_Config::createDefault();
@@ -591,10 +590,18 @@ function clear_xss($val)
             $oConfig->set('HTML.Nofollow', 'true');
         }
 
-        $oConfig->set('Filter.Custom', array (new BxDolHTMLPurifierFilterYouTube(), new BxDolHTMLPurifierFilterYoutubeIframe(), new BxDolHTMLPurifierFilterAddBxLinksClass(), new BxDolHTMLPurifierFilterLocalIframe()));
-
+        $oConfig->set('Filter.Custom', array (
+            new BxDolHTMLPurifierFilterYouTube(), 
+            new BxDolHTMLPurifierFilterYoutubeIframe(), 
+            new BxDolHTMLPurifierFilterAddBxLinksClass(), 
+            new BxDolHTMLPurifierFilterLocalIframe(),
+            new BxDolHTMLPurifierFilterEmbed(),
+        ));
+   
+        $oConfig->set('Cache.DefinitionImpl', null); // chear cache
 	    $oConfig->set('HTML.DefinitionID', 'html5-definitions');
 		$oConfig->set('HTML.DefinitionRev', 1);
+      
 		if ($def = $oConfig->maybeGetRawHTMLDefinition()) {
 		    $def->addElement('section', 'Block', 'Flow', 'Common');
 		    $def->addElement('nav',     'Block', 'Flow', 'Common');
@@ -616,12 +623,13 @@ function clear_xss($val)
 		        'type' => 'Text',
             ));
             $def->addAttribute('a', 'data-profile-id', 'Number');
+            $def->addAttribute('div', 'source', 'Text');
 		}
 
         $oHtmlPurifier = new HTMLPurifier($oConfig);
     }
 
-    if (!$GLOBALS['logged']['admin'])
+    //if (!$GLOBALS['logged']['admin'])
         $val = $oHtmlPurifier->purify($val);
 
     bx_alert('system', 'clear_xss', 0, 0, array('oHtmlPurifier' => $oHtmlPurifier, 'return_data' => &$val));

+ 1 - 1
inc/version.inc.php

@@ -7,6 +7,6 @@
  * @{
  */
 
-define('BX_DOL_VERSION', '13.0.0-DEV1'); ///< system files version, for DB version @see bx_get_ver, DB and files version must match
+define('BX_DOL_VERSION', '13.0.0-A1'); ///< system files version, for DB version @see bx_get_ver, DB and files version must match
 
 /** @} */

+ 1 - 1
install/index.php

@@ -10,7 +10,7 @@
 define ('BX_DOL_INSTALL',  true);
 define ('BX_SKIP_INSTALL_CHECK', true);
 
-define ('BX_DOL_VER', '13.0.0-DEV1');
+define ('BX_DOL_VER', '13.0.0-A1');
 
 define ('BX_INSTALL_DEFAULT_LANGUAGE', 'en');
 

+ 1 - 1
install/sql/system.sql

@@ -296,7 +296,7 @@ SET @iCategoryId = LAST_INSERT_ID();
 INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_params`, `check_error`, `order`) VALUES
 (@iCategoryId, 'sys_cron_time', '_adm_stg_cpt_option_sys_cron_time', '0', 'digit', '', '', '', '', 2),
 (@iCategoryId, 'sys_install_time', '_adm_stg_cpt_option_sys_install_time', '0', 'digit', '', '', '', '', 3),
-(@iCategoryId, 'sys_upgrade_channel', '_adm_stg_cpt_option_sys_upgrade_channel', 'stable', 'select', 'stable,beta', '', '', '', 4),
+(@iCategoryId, 'sys_upgrade_channel', '_adm_stg_cpt_option_sys_upgrade_channel', 'beta', 'select', 'stable,beta', '', '', '', 4),
 (@iCategoryId, 'sys_revision', '_adm_stg_cpt_option_sys_revision', '0', 'digit', '', '', '', '', 5),
 (@iCategoryId, 'sys_eq_time', '_adm_stg_cpt_option_sys_eq_time', '0', 'digit', '', '', '', '', 6),
 (@iCategoryId, 'sys_push_queue_time', '_adm_stg_cpt_option_sys_push_queue_time', '0', 'digit', '', '', '', '', 7),

+ 3 - 0
modules/boonex/english/data/langs/system/en.xml

@@ -3570,6 +3570,9 @@ If it is not enabled then please consider implement this optimization, since it
     <string name="_sys_txt_quill_tooltip_background"><![CDATA[Select a background color]]></string>
     <string name="_sys_txt_quill_tooltip_align"><![CDATA[Text alignment]]></string>
     <string name="_sys_txt_quill_tooltip_header"><![CDATA[Select the text style]]></string>
+    <string name="_sys_txt_quill_tooltip_embed"><![CDATA[Insert an embed]]></string>
+    <string name="_sys_txt_quill_tooltip_embed_popup_header"><![CDATA[Paste an URL for embed]]></string>
+    <string name="_sys_txt_quill_tooltip_link_popup_header"><![CDATA[Paste an URL]]></string>
     
 </resources>
 

+ 3 - 0
template/scripts/BxBaseEditorQuill.php

@@ -113,6 +113,9 @@ class BxBaseEditorQuill extends BxDolEditor
             '_sys_txt_quill_tooltip_background',
             '_sys_txt_quill_tooltip_align',
             '_sys_txt_quill_tooltip_header',
+            '_sys_txt_quill_tooltip_embed',
+            '_sys_txt_quill_tooltip_embed_popup_header',
+            '_sys_txt_quill_tooltip_link_popup_header',
         ]);
         // initialize editor
         $sInitEditor = $this->_replaceMarkers(self::$CONF_COMMON, array(

+ 9 - 0
upgrade/files/12.1.0-13.0.0.A1/check.php

@@ -0,0 +1,9 @@
+<?php
+
+$mixCheckResult = 'Update can not be applied';
+
+$sVer = $this->oDb->getOne("SELECT `version` FROM `sys_modules` WHERE `name` = 'system'");
+if ('12.1.0' == $sVer)
+    $mixCheckResult = true;
+
+return $mixCheckResult;

+ 104 - 0
upgrade/files/12.1.0-13.0.0.A1/files_delete.php

@@ -0,0 +1,104 @@
+<?php
+
+$aFilesDelete = array(
+	'inc/js/editor.tinymce.js',
+	'modules/base/general/template/unit_meta_item.html',
+	'modules/base/groups/template/unit_wo_cover.html',
+	'modules/base/groups/template/unit_wo_info.html',
+	'modules/base/text/template/unit_meta_item.html',
+	'plugins/akeeba-s3',
+	'plugins/akismet',
+	'plugins/amazon-s3',
+	'plugins/banbuilder',
+	'plugins/chargebee/ChargeBee',
+	'plugins/chargebee/ssl',
+	'plugins/chargebee/ChargeBee.php',
+	'plugins/chargebee/LICENSE',
+	'plugins/curl/cacert.pem',
+	'plugins/facebook-php-sdk',
+	'plugins/htmlpurifier',
+	'plugins/intervention-image',
+	'plugins/lessphp',
+	'plugins/matthiasmullie/data',
+	'plugins/matthiasmullie/minify/Exceptions',
+	'plugins/matthiasmullie/minify/CSS.php',
+	'plugins/matthiasmullie/minify/Exception.php',
+	'plugins/matthiasmullie/minify/JS.php',
+	'plugins/matthiasmullie/minify/Minify.php',
+	'plugins/matthiasmullie/path-converter/Converter.php',
+	'plugins/matthiasmullie/path-converter/ConverterInterface.php',
+	'plugins/matthiasmullie/path-converter/NoConverter.php',
+	'plugins/matthiasmullie/LICENSE',
+	'plugins/minify',
+	'plugins/OAuth',
+	'plugins/OAuth2',
+	'plugins/parsedown',
+	'plugins/paypal/composer',
+	'plugins/paypal/paypal',
+	'plugins/paypal/autoload.php',
+	'plugins/phpmailer/Exception.php',
+	'plugins/phpmailer/LICENSE',
+	'plugins/phpmailer/PHPMailer.php',
+	'plugins/phpmailer/README.md',
+	'plugins/phpmailer/SMTP.php',
+	'plugins/phpmailer/VERSION',
+	'plugins/recaptcha',
+	'plugins/recurly/recurly',
+	'plugins/recurly/LICENSE',
+	'plugins/recurly/README.md',
+	'plugins/recurly/recurly.php',
+	'plugins/stripe/data',
+	'plugins/stripe/lib',
+	'plugins/stripe/.coveralls.github-actions.yml',
+	'plugins/stripe/.editorconfig',
+	'plugins/stripe/.php_cs.dist',
+	'plugins/stripe/build.php',
+	'plugins/stripe/CHANGELOG.md',
+	'plugins/stripe/CODE_OF_CONDUCT.md',
+	'plugins/stripe/composer.json',
+	'plugins/stripe/init.php',
+	'plugins/stripe/LICENSE',
+	'plugins/stripe/Makefile',
+	'plugins/stripe/phpdoc.dist.xml',
+	'plugins/stripe/phpstan-baseline.neon',
+	'plugins/stripe/phpstan.neon.dist',
+	'plugins/stripe/README.md',
+	'plugins/stripe/update_certs.php',
+	'plugins/stripe/VERSION',
+	'plugins/Twilio/Exceptions',
+	'plugins/Twilio/Http',
+	'plugins/Twilio/Jwt',
+	'plugins/Twilio/Rest',
+	'plugins/Twilio/Security',
+	'plugins/Twilio/TaskRouter',
+	'plugins/Twilio/TwiML',
+	'plugins/Twilio/autoload.php',
+	'plugins/Twilio/Deserialize.php',
+	'plugins/Twilio/Domain.php',
+	'plugins/Twilio/InstanceContext.php',
+	'plugins/Twilio/InstanceResource.php',
+	'plugins/Twilio/ListResource.php',
+	'plugins/Twilio/Options.php',
+	'plugins/Twilio/Page.php',
+	'plugins/Twilio/Serialize.php',
+	'plugins/Twilio/Stream.php',
+	'plugins/Twilio/Twiml.php',
+	'plugins/Twilio/Values.php',
+	'plugins/Twilio/Version.php',
+	'plugins/Twilio/VersionInfo.php',
+	'plugins_public/shepherd/css/shepherd-theme-arrows-fix.css',
+	'plugins_public/shepherd/css/shepherd-theme-arrows-plain-buttons.css',
+	'plugins_public/shepherd/css/shepherd-theme-arrows.css',
+	'plugins_public/shepherd/css/shepherd-theme-dark.css',
+	'plugins_public/shepherd/css/shepherd-theme-default.css',
+	'plugins_public/shepherd/css/shepherd-theme-square-dark.css',
+	'plugins_public/shepherd/css/shepherd-theme-square.css',
+	'plugins_public/shepherd/js/shepherd.js',
+	'plugins_public/shepherd/js/tether.js',
+	'plugins_public/shepherd/js/tether.min.js',
+	'plugins_public/tinymce',
+	'template/images/icons/una.png',
+	'template/scripts/BxBaseCaptchaReCAPTCHA.php',
+	'template/scripts/BxBaseEditorTinyMCE.php',
+);
+

+ 33 - 0
upgrade/files/12.1.0-13.0.0.A1/script.php

@@ -0,0 +1,33 @@
+<?php
+
+    if (!$this->oDb->isFieldExists('sys_modules', 'updated'))
+        $this->oDb->query("ALTER TABLE `sys_modules` ADD `updated` int(11) unsigned NOT NULL default '0' AFTER `hash`");
+
+    if (!$this->oDb->isFieldExists('sys_cron_jobs', 'ts'))
+        $this->oDb->query("ALTER TABLE `sys_cron_jobs` ADD `ts` int(11) NOT NULL");
+
+    if (!$this->oDb->isFieldExists('sys_cron_jobs', 'timing'))
+        $this->oDb->query("ALTER TABLE `sys_cron_jobs` ADD `timing` float NOT NULL");
+
+    if (!$this->oDb->isFieldExists('sys_storage_ghosts', 'order'))
+        $this->oDb->query("ALTER TABLE `sys_storage_ghosts` ADD `order` int(11) NOT NULL default '0' AFTER `created`");
+
+    if (!$this->oDb->isFieldExists('sys_form_inputs', 'help'))
+        $this->oDb->query("ALTER TABLE `sys_form_inputs` ADD `help` varchar(255) NOT NULL AFTER `info`");
+
+    if (!$this->oDb->isFieldExists('sys_menu_items', 'parent_id'))
+        $this->oDb->query("ALTER TABLE `sys_menu_items` ADD `parent_id` int(11) NOT NULL DEFAULT '0' AFTER `id`");
+
+    if (!$this->oDb->isFieldExists('sys_menu_items', 'primary'))
+        $this->oDb->query("ALTER TABLE `sys_menu_items` ADD `primary` tinyint(4) NOT NULL DEFAULT '0' AFTER `hidden_on`");
+
+    if (!$this->oDb->isFieldExists('sys_transcoder_queue', 'pid'))
+        $this->oDb->query("ALTER TABLE `sys_transcoder_queue` ADD `pid` int(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `status`");
+
+    if (!$this->oDb->isFieldExists('sys_pages_blocks', 'cache_lifetime'))
+        $this->oDb->query("ALTER TABLE `sys_pages_blocks` ADD `cache_lifetime` int(11) NOT NULL DEFAULT '0' AFTER `text_updated`");
+
+    if (!$this->oDb->isFieldExists('sys_pages_blocks', 'help'))
+        $this->oDb->query("ALTER TABLE `sys_pages_blocks` ADD `help` varchar(255) NOT NULL AFTER `text_updated`");
+
+    return true;

+ 335 - 0
upgrade/files/12.1.0-13.0.0.A1/sql.sql

@@ -0,0 +1,335 @@
+
+-- Editors
+
+DELETE FROM `sys_objects_editor` WHERE `object` IN('sys_quill', 'sys_tinymce');
+INSERT INTO `sys_objects_editor` (`object`, `title`, `skin`, `override_class_name`, `override_class_file`) VALUES
+('sys_quill', 'Quill', 'snow', 'BxTemplEditorQuill', '');
+
+-- Embeds
+
+DELETE FROM `sys_objects_embeds` WHERE `object` = 'sys_oembed';
+INSERT INTO `sys_objects_embeds` (`object`, `title`, `override_class_name`, `override_class_file`) VALUES
+('sys_oembed', 'Oembed', 'BxTemplEmbedOembed', '');
+
+-- Captcha
+
+DELETE FROM `sys_objects_captcha` WHERE `object` IN('sys_hcaptcha', 'sys_recaptcha');
+INSERT INTO `sys_objects_captcha` (`object`, `title`, `override_class_name`, `override_class_file`) VALUES
+('sys_hcaptcha', 'hCaptcha', 'BxTemplCaptchaHCaptcha', '');
+
+UPDATE `sys_objects_captcha` SET `title` = 'reCAPTCHA' WHERE `object` = 'sys_recaptcha_new';
+
+-- Email templates
+
+DELETE FROM `sys_email_templates` WHERE `Name` = 't_ManageApprove';
+INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
+('system', '_sys_et_txt_name_manage_approve', 't_ManageApprove', '_sys_et_txt_subject_manage_approve', '_sys_et_txt_body_manage_approve');
+
+-- Options
+
+UPDATE `sys_options` SET `value` = 'sys_quill' WHERE `name` = 'sys_editor_default' AND `value` = 'sys_tinymce';
+UPDATE `sys_options` SET `type` = 'select', `extra` = 'sys_recaptcha_new,sys_recaptcha_invisible,sys_hcaptcha' WHERE `name` = 'sys_editor_default';
+
+UPDATE `sys_options` SET `value` = 'sys_recaptcha_new' WHERE `name` = 'sys_captcha_default' AND `value` = 'sys_recaptcha';
+UPDATE `sys_options` SET `type` = 'select', `extra` = 'sys_recaptcha_new,sys_recaptcha_invisible,sys_hcaptcha' WHERE `name` = 'sys_captcha_default';
+
+DELETE FROM `sys_options` WHERE `name` IN('sys_tinymce_plugins_mini', 'sys_tinymce_toolbar_mini', 'sys_tinymce_plugins_standard', 'sys_tinymce_toolbar_standard', 'sys_tinymce_plugins_full', 'sys_tinymce_toolbar_full');
+
+SET @iCategoryIdHidden = (SELECT `id` FROM `sys_options_categories` WHERE `name` = 'hidden');
+
+DELETE FROM `sys_options` WHERE `name` IN('sys_quill_toolbar_mini', 'sys_quill_toolbar_standard', 'sys_quill_toolbar_full');
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_params`, `check_error`, `order`) VALUES
+(@iCategoryIdHidden, 'sys_quill_toolbar_mini', '_adm_stg_cpt_option_sys_quill_toolbar_mini', '[\'bold\',\'italic\',\'underline\',\'clean\'],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'}],[{ \'align\':\'\'},{\'align\':\'center\'},{\'align\':\'right\'}],[\'blockquote\'],[\'link\',\'image\']', 'digit', '', '', '', '', 70),
+(@iCategoryIdHidden, 'sys_quill_toolbar_standard', '_adm_stg_cpt_option_sys_quill_toolbar_standard', '[\'bold\',\'italic\',\'underline\',\'clean\'],[{ \'header\': [1, 2, 3, 4, 5, 6, false] }],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'},{\'indent\': \'-1\'},{\'indent\': \'+1\'}],[{ \'align\':\'\'},{\'align\':\'center\'},{\'align\':\'right\'},{\'align\':\'justify\'}],[\'blockquote\'],[\'link\',\'image\']', 'digit', '', '', '', '', 73),
+(@iCategoryIdHidden, 'sys_quill_toolbar_full', '_adm_stg_cpt_option_sys_quill_toolbar_full', '[{ \'header\': [1, 2, 3, 4, 5, 6, false] }],[\'bold\',\'italic\',\'underline\',\'clean\'],
+  [{ \'align\': [] }],[{\'list\':\'ordered\'}, {\'list\':\'bullet\'},{\'indent\': \'-1\'},{\'indent\': \'+1\'}],[\'blockquote\'],[{ \'color\': [] }, { \'background\': [] }],[{ \'direction\': \'rtl\' }],[{ \'script\': \'sub\'}, { \'script\': \'super\' }],[\'link\',\'image\',\'code-block\']', 'digit', '', '', '', '', 76);
+
+DELETE FROM `sys_options` WHERE `name` IN('curl_ssl_allow_untrusted');
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_params`, `check_error`, `order`) VALUES
+(@iCategoryIdHidden, 'curl_ssl_allow_untrusted', '_adm_stg_cpt_option_sys_ssl_allow_untrusted', '', 'checkbox', '', '', '', '', 145);
+
+
+SET @iCategoryIdSystem = (SELECT `id` FROM `sys_options_categories` WHERE `name` = 'system');
+
+DELETE FROM `sys_options` WHERE `name` IN('sys_site_cover_disabled');
+INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+(@iCategoryIdSystem, 'sys_site_cover_disabled', '', '', 'checkbox', '', '', '', 29);
+
+UPDATE `sys_options` SET `value` = 'sys_oembed' WHERE `name` = 'sys_embed_default' AND `value` = '';
+
+-- ACL
+
+ALTER TABLE `sys_acl_levels` CHANGE `Icon` `Icon` TEXT NOT NULL;
+
+UPDATE `sys_acl_levels` SET `Icon` = 'user-secret col-blue3' WHERE `ID` IN(7, 8) AND `Icon` = 'user-secret bx-def-font-color';
+
+-- Module
+
+UPDATE `sys_modules` SET `date` = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_install_time' LIMIT 1)  WHERE `name` = 'system' AND `date` = 0;
+
+-- Storage, transcoder & uploader
+
+CREATE TABLE IF NOT EXISTS `sys_images_editor` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` bigint(20) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `sys_images_editor_resized` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(128) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` bigint(20) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+DELETE FROM `sys_objects_storage` WHERE `object` IN('sys_images_editor', 'sys_images_editor_resized');
+INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
+('sys_images_editor', 'Local', '', 360, 2592000, 3, 'sys_images_editor', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0),
+('sys_images_editor_resized', 'Local', '', 360, 2592000, 3, 'sys_images_editor_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0);
+
+DELETE FROM `sys_objects_uploader` WHERE `object` = 'sys_cmts_html5';
+INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
+('sys_cmts_html5', 1, 'BxTemplCmtsUploaderHTML5', '');
+
+-- Forms
+
+DELETE FROM `sys_objects_form` WHERE `object` = 'sys_manage';
+INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('sys_manage', 'system', '_sys_form_manage', '', '', 'a:2:{i:0;s:7:"do_send";i:1;s:9:"do_submit";}', '', '', '', '', '', 0, 1, '', '');
+
+DELETE FROM `sys_form_displays` WHERE `display_name` = 'sys_manage_approve';
+INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
+('sys_manage_approve', 'system', 'sys_manage', '_sys_form_display_manage_approve', 0);
+
+UPDATE `sys_form_inputs` SET `value` = 'a:1:{i:0;s:14:"sys_cmts_html5";}', `values` = 'a:1:{s:14:"sys_cmts_html5";s:25:"_sys_uploader_html5_title";}' WHERE `object` = 'sys_comment';
+UPDATE `sys_form_inputs` SET `value` = 'a:1:{i:0;s:14:"sys_cmts_html5";}', `values` = 'a:1:{s:14:"sys_cmts_html5";s:25:"_sys_uploader_html5_title";}' WHERE `object` = 'sys_review';
+
+DELETE FROM `sys_form_inputs` WHERE `object` = 'sys_manage';
+INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
+('sys_manage', 'system', 'content_id', '', '', 0, 'hidden', '', '_sys_form_manage_input_sys_content_id', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('sys_manage', 'system', 'notes', '', '', 0, 'textarea', '_sys_form_manage_input_sys_notes', '_sys_form_manage_input_notes', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
+('sys_manage', 'system', 'controls', '', 'do_send,do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('sys_manage', 'system', 'do_send', '_sys_form_manage_input_do_send', '', 0, 'submit', '_sys_form_manage_input_sys_do_send', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('sys_manage', 'system', 'do_submit', '_sys_form_manage_input_do_submit', '', 0, 'submit', '_sys_form_manage_input_sys_do_submit', '', '', 0, 0, 0, 'a:1:{s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0),
+('sys_manage', 'system', 'do_cancel', '_sys_form_manage_input_do_cancel', '', 0, 'button', '_sys_form_manage_input_sys_do_cancel', '', '', 0, 0, 0, 'a:2:{s:5:"class";s:22:"bx-def-margin-sec-left";s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";}', '', '', '', '', '', '', '', 0, 0);
+
+UPDATE `sys_form_display_inputs` SET `order` = 6 WHERE `display_name` = 'sys_login' AND `input_name` = 'submit_text' AND `order` = 7;
+UPDATE `sys_form_display_inputs` SET `order` = 7 WHERE `display_name` = 'sys_login' AND `input_name` = 'login' AND `order` = 6;
+
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` = 'sys_manage_approve';
+INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
+('sys_manage_approve', 'content_id', 2147483647, 1, 1),
+('sys_manage_approve', 'notes', 2147483647, 1, 2),
+('sys_manage_approve', 'controls', 2147483647, 1, 3),
+('sys_manage_approve', 'do_send', 2147483647, 1, 4),
+('sys_manage_approve', 'do_submit', 2147483647, 1, 5),
+('sys_manage_approve', 'do_cancel', 2147483647, 1, 6);
+
+DELETE FROM `sys_form_pre_values` WHERE `Key` = 'sys_vote_reactions';
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`, `Data`) VALUES
+('sys_vote_reactions', 'like', 1, '_sys_pre_lists_vote_reactions_like', '', 'a:5:{s:5:"emoji";s:4:"👍";s:4:"icon";s:0:"";s:5:"color";s:20:"sys-colored col-gray";s:6:"weight";s:1:"1";s:7:"default";s:9:"thumbs-up";}'),
+('sys_vote_reactions', 'love', 2, '_sys_pre_lists_vote_reactions_love', '', 'a:4:{s:5:"emoji";s:4:"💓";s:4:"icon";s:0:"";s:5:"color";s:20:"sys-colored col-red1";s:6:"weight";s:1:"1";}'),
+('sys_vote_reactions', 'joy', 3, '_sys_pre_lists_vote_reactions_joy', '', 'a:4:{s:5:"emoji";s:4:"😆";s:4:"icon";s:0:"";s:5:"color";s:20:"sys-colored col-red3";s:6:"weight";s:1:"1";}'),
+('sys_vote_reactions', 'surprise', 4, '_sys_pre_lists_vote_reactions_surprise', '', 'a:4:{s:5:"emoji";s:4:"😲";s:4:"icon";s:0:"";s:5:"color";s:20:"sys-colored col-red3";s:6:"weight";s:1:"1";}'),
+('sys_vote_reactions', 'sadness', 5, '_sys_pre_lists_vote_reactions_sadness', '', 'a:4:{s:5:"emoji";s:4:"😥";s:4:"icon";s:0:"";s:5:"color";s:20:"sys-colored col-red3";s:6:"weight";s:1:"1";}'),
+('sys_vote_reactions', 'anger', 6, '_sys_pre_lists_vote_reactions_anger', '', 'a:4:{s:5:"emoji";s:4:"😠";s:4:"icon";s:0:"";s:5:"color";s:20:"sys-colored col-red3";s:6:"weight";s:1:"1";}');
+
+-- Menu
+
+UPDATE `sys_menu_templates` SET `visible` = 0 WHERE `id` IN(8, 18);
+
+SET @iMaxIdTemplate = (SELECT IFNULL(MAX(`id`), 0) FROM `sys_menu_templates`);
+
+UPDATE `sys_menu_templates` SET `id` = @iMaxIdTemplate + 1 WHERE `id` = 27 AND `template` != 'menu_profile_followings.html';
+UPDATE `sys_menu_templates` SET `id` = @iMaxIdTemplate + 2 WHERE `id` = 28 AND `template` != 'menu_main.html';
+UPDATE `sys_menu_templates` SET `id` = @iMaxIdTemplate + 3 WHERE `id` = 29 AND `template` != 'menu_add_content.html';
+
+DELETE FROM `sys_menu_templates` WHERE `id` IN(27, 28, 29);
+INSERT INTO `sys_menu_templates` (`id`, `template`, `title`, `visible`) VALUES
+(27, 'menu_profile_followings.html', '_sys_menu_template_title_profile_followings', 0),
+(28, 'menu_main.html', '_sys_menu_template_title_main', 0),
+(29, 'menu_add_content.html', '_sys_menu_template_title_add_content', 0);
+
+UPDATE `sys_objects_menu` SET `template_id` = 28 WHERE `object` = 'sys_site' AND `template_id` = 7;
+UPDATE `sys_objects_menu` SET `template_id` = 29 WHERE `object` = 'sys_add_content' AND `template_id` = 7;
+
+DELETE FROM `sys_objects_menu` WHERE `object` = 'sys_account_settings_more';
+
+DELETE FROM `sys_objects_menu` WHERE `object` IN('sys_profile_followings', 'sys_dashboard_content', 'sys_dashboard_reports');
+INSERT INTO `sys_objects_menu` (`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
+('sys_profile_followings', '_sys_menu_title_profile_followings', 'sys_profile_followings', 'system', 27, 0, 1, 'BxTemplMenuProfileFollowings', ''),
+('sys_dashboard_content', '_sys_menu_title_dashboard_content_manage', 'sys_dashboard_content_manage', 'system', 15, 0, 1, 'BxTemplMenuDashboardContentManage', ''),
+('sys_dashboard_reports', '_sys_menu_title_dashboard_reports_manage', 'sys_dashboard_reports_manage', 'system', 15, 0, 1, 'BxTemplMenuDashboardReportsManage', '');
+
+DELETE FROM `sys_menu_sets` WHERE `set_name` IN('sys_dashboard_content_manage', 'sys_dashboard_reports_manage', 'sys_profile_followings', 'sys_account_settings_more');
+INSERT INTO `sys_menu_sets` (`set_name`, `module`, `title`, `deletable`) VALUES
+('sys_dashboard_content_manage', 'system', '_sys_menu_set_title_dashboard_content_manage', 0),
+('sys_dashboard_reports_manage', 'system', '_sys_menu_set_title_dashboard_reports_manage', 0),
+('sys_profile_followings', 'system', '_sys_menu_set_title_profile_followings', 0);
+
+UPDATE `sys_menu_items` SET `icon` = 'una.svg' WHERE `set_name` = 'sys_footer' AND `name` = 'powered_by' AND `icon` = 'una.png';
+
+UPDATE `sys_menu_items` SET `onclick` = 'bx_menu_slide_inline(\'#bx-sliding-menu-sys_add_content\', $(\'#bx-menu-toolbar-item-add-content a\').get(0), \'site\');' WHERE `set_name` = 'sys_account_notifications' AND `name` = 'add-content';
+
+UPDATE `sys_menu_items` SET `name` = 'account-profile-switcher' WHERE `set_name` = 'sys_account_settings' AND `name` = 'account-settings-profile-context';
+
+DELETE FROM `sys_menu_items` WHERE `set_name` IN('sys_account_settings', 'sys_account_settings_more') AND `name` = 'account-settings-delete';
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
+('sys_account_settings', 'system', 'account-settings-delete', '_sys_menu_item_title_system_account_settings_delete', '_sys_menu_item_title_account_settings_delete', 'page.php?i=account-settings-delete', '', '', 'remove', '', 2147483646, 1, 1, 9999);
+
+DELETE FROM `sys_menu_items` WHERE `set_name` = 'sys_account_dashboard' AND `name` IN('dashboard-content', 'dashboard-reports', 'dashboard-audit');
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
+('sys_account_dashboard', 'system', 'dashboard-content', '_sys_menu_item_title_system_account_dashboard_content', '_sys_menu_item_title_account_dashboard_content', 'page.php?i=dashboard-content', '', '', 'copy', '', '', 2147483646, 1, 1, 5),
+('sys_account_dashboard', 'system', 'dashboard-reports', '_sys_menu_item_title_system_account_dashboard_reports', '_sys_menu_item_title_account_dashboard_reports', 'page.php?i=dashboard-reports', '', '', 'exclamation-circle', '', '', 2147483646, 1, 1, 6),
+('sys_account_dashboard', 'system', 'dashboard-audit', '_sys_menu_item_title_system_account_dashboard_audit', '_sys_menu_item_title_account_dashboard_audit', 'page.php?i=dashboard-audit', '', '', 'history', '', '', 2147483646, 1, 1, 7);
+
+-- Grids
+
+DELETE FROM `sys_objects_grid` WHERE `object` IN('sys_studio_groups_roles', 'sys_reports_administration');
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `override_class_name`, `override_class_file`) VALUES
+('sys_studio_groups_roles', 'Sql', 'SELECT * FROM `sys_form_pre_values` WHERE 1 ', 'sys_form_pre_values', 'id', 'Order', '', '', 20, NULL, 'start', '', '', 'LKey', 'like', '', '', 'BxTemplStudioFormsGroupsRoles', ''),
+('sys_reports_administration', 'Sql', 'WHERE 1 ', '', 'id', 'date', '', '', 20, NULL, 'start', '', 'text,type', '', 'like', '', '', 'BxTemplReportsGrid', '');
+
+UPDATE `sys_objects_grid` SET `sorting_fields` = 'content_module,profile_id,content_id,author_id,context_profile_id,added', `sorting_fields_translatable` = 'action_lang_key' WHERE `object` = 'sys_audit_administration';
+
+DELETE FROM `sys_grid_fields` WHERE `object` IN('sys_studio_groups_roles');
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('sys_studio_groups_roles', 'order', '', '2%', 0, 0, '', 1),
+('sys_studio_groups_roles', 'LKey', '_adm_rl_txt_title', '40%', 1, 0, '', 2),
+('sys_studio_groups_roles', 'actions_list', '_adm_rl_txt_actions', '10%', 0, 35, '', 3),
+('sys_studio_groups_roles', 'actions', '', '48%', 0, 0, '', 4);
+
+DELETE FROM `sys_grid_fields` WHERE `object` IN('sys_audit_administration');
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('sys_audit_administration', 'added', '_adm_form_txt_audit_added', '15%', 1, 25, '', 1),
+('sys_audit_administration', 'profile_id', '_adm_form_txt_audit_profile', '15%', 1, 25, '', 2),
+('sys_audit_administration', 'content_id', '_adm_form_txt_audit_content', '20%', 1, 25, '', 3),
+('sys_audit_administration', 'author_id', '_adm_form_txt_audit_author_content', '10%', 1, 25, '', 4),
+('sys_audit_administration', 'content_module', '_adm_form_txt_audit_module', '10%', 1, 25, '', 5),
+('sys_audit_administration', 'context_profile_id', '_adm_pgt_txt_audit_context', '15%', 1, 25, '', 6),
+('sys_audit_administration', 'action_lang_key', '_adm_pgt_txt_audit_action', '15%', 1, 25, '', 7);
+
+DELETE FROM `sys_grid_fields` WHERE `object` IN('sys_reports_administration');
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('sys_reports_administration', 'object', '_adm_form_txt_reports_object', '10%', 1, 25, '', 1),
+('sys_reports_administration', 'author', '_adm_form_txt_reports_author', '10%', 1, 25, '', 2),
+('sys_reports_administration', 'type', '_adm_form_txt_reports_type', '10%', 1, 25, '', 3),
+('sys_reports_administration', 'text', '_adm_form_txt_reports_text', '10%', 1, 25, '', 4),
+('sys_reports_administration', 'date', '_adm_form_txt_reports_date', '10%', 1, 25, '', 5),
+('sys_reports_administration', 'status', '_adm_form_txt_reports_status', '10%', 1, 25, '', 6),
+('sys_reports_administration', 'checked_by', '_adm_form_txt_reports_checked_by', '10%', 1, 25, '', 7),
+('sys_reports_administration', 'notes', '_adm_form_txt_reports_notes', '10%', 1, 25, '', 8),
+('sys_reports_administration', 'comments', '_adm_form_txt_reports_comments', '10%', 1, 25, '', 8),
+('sys_reports_administration', 'actions', '', '10%', 0, '', '', 9);
+
+DELETE FROM `sys_grid_actions` WHERE `object` = 'sys_studio_groups_roles';
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('sys_studio_groups_roles', 'independent', 'add', '_adm_rl_btn_role_add', '', 0, 1),
+('sys_studio_groups_roles', 'single', 'edit', '_adm_rl_btn_role_edit', 'pencil-alt', 0, 1),
+('sys_studio_groups_roles', 'single', 'delete', '_adm_rl_btn_role_delete', 'remove', 1, 3);
+
+DELETE FROM `sys_grid_actions` WHERE `object` = 'sys_reports_administration';
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`, `icon_only`) VALUES
+('sys_reports_administration', 'single', 'check_in', '_adm_form_btn_reports_check_in', 'lock-open', 0, 1, 1),
+('sys_reports_administration', 'single', 'check_out', '_adm_form_btn_reports_check_out', 'lock', 0, 2, 1),
+('sys_reports_administration', 'single', 'audit', '_adm_form_btn_reports_audit', 'history', 0, 3, 1);
+
+UPDATE `sys_objects_grid` SET `table` = 'sys_cmts_ids' WHERE `object` = 'sys_cmts_administration';
+
+-- Transcoder
+
+DELETE FROM `sys_objects_transcoder` WHERE `object` = 'sys_images_editor';
+INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`, `override_class_name`, `override_class_file`) VALUES
+('sys_images_editor', 'sys_images_editor_resized', 'Storage', 'a:1:{s:6:"object";s:17:"sys_images_editor";}', 'no', '1', '2592000', '0', '', '');
+
+DELETE FROM `sys_transcoder_filters` WHERE `transcoder_object` = 'sys_images_editor';
+INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES
+('sys_images_editor', 'Resize', 'a:2:{s:1:"w";s:4:"1600";s:1:"h";s:4:"1600";}', '0');
+
+-- Pages
+
+DELETE FROM `sys_objects_page` WHERE `object` IN('sys_dashboard_content', 'sys_dashboard_reports', 'sys_dashboard_audit');
+INSERT INTO `sys_objects_page` (`object`, `uri`, `title_system`, `title`, `module`, `cover`, `layout_id`, `submenu`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`, `sticky_columns`) VALUES
+('sys_dashboard_content', 'dashboard-content', '_sys_page_title_system_dashboard_content', '_sys_page_title_dashboard_content', 'system', 1, 12, '', 2147483646, 1, 'page.php?i=dashboard-content', '', '', '', 0, 1, 0, 'BxTemplPageDashboard', '', 0),
+('sys_dashboard_reports', 'dashboard-reports', '_sys_page_title_system_dashboard_reports', '_sys_page_title_dashboard_reports', 'system', 1, 12, '', 2147483646, 1, 'page.php?i=dashboard-reports', '', '', '', 0, 1, 0, 'BxTemplPageDashboard', '', 0),
+('sys_dashboard_audit', 'dashboard-audit', '_sys_page_title_system_dashboard_audit', '_sys_page_title_dashboard_audit', 'system', 1, 12, '', 2147483646, 1, 'page.php?i=dashboard-audit', '', '', '', 0, 1, 0, 'BxTemplPageDashboard', '', 0);
+
+UPDATE `sys_objects_page` SET `layout_id` = 18 WHERE `layout_id` = 5 AND `object` IN('sys_create_account', 'sys_login', 'sys_login_step2', 'sys_login_step3');
+
+UPDATE `sys_objects_page` SET `title_system` = '_sys_page_title_system_cmts_view' WHERE `object` = 'sys_cmts_view';
+
+DELETE FROM `sys_pages_layouts` WHERE `name` IN('1_column_thin', '1_column_half');
+INSERT INTO `sys_pages_layouts` (`id`, `name`, `icon`, `title`, `template`, `cells_number`) VALUES
+(18, '1_column_thin', 'layout_1_column_thin.png', '_sys_layout_1_column_thin', 'layout_1_column_thin.html', 1),
+(19, '1_column_half', 'layout_1_column_half.png', '_sys_layout_1_column_half', 'layout_1_column_half.html', 1);
+
+-- Pages blocks
+
+SET @iBlockOrder = IFNULL((SELECT `order` FROM `sys_pages_blocks` WHERE `object` = '' AND `cell_id` = 0 ORDER BY `order` DESC LIMIT 1), 0);
+
+DELETE FROM `sys_pages_blocks` WHERE `object` = '' AND `module` = 'system' AND `title_system` = '_sys_page_block_title_sys_std_site_submenu';
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `tabs`, `async`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
+('', 0, 'system', '_sys_page_block_title_sys_std_site_submenu', '_sys_page_block_title_std_site_submenu', 3, 0, 0, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:16:"get_site_submenu";s:6:"params";a:0:{}s:5:"class";s:13:"TemplServices";}', 0, 1, 1, @iBlockOrder + 1);
+
+DELETE FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `title` IN('_sys_page_block_title_profile_avatar', '_sys_page_block_title_profile_menu', '_sys_page_block_title_profile_followings');
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `tabs`, `async`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
+('sys_home', 0, 'system', '', '_sys_page_block_title_profile_avatar', 3, 0, 0, 2147483646, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:14:"profile_avatar";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 0, 1, 1),
+('sys_home', 0, 'system', '', '_sys_page_block_title_profile_menu', 3, 0, 0, 2147483644, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:12:"profile_menu";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 0, 1, 2),
+('sys_home', 0, 'system', '', '_sys_page_block_title_profile_followings', 3, 0, 0, 2147483644, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:18:"profile_followings";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 0, 1, 3);
+
+UPDATE `sys_pages_blocks` SET `designbox_id` = 13 WHERE `object` = 'sys_home' AND `title` = '_sys_page_block_title_homepage_menu' AND `designbox_id` = 3;
+
+DELETE FROM `sys_pages_blocks` WHERE `object` = 'sys_dashboard_content' AND `title` = '_sys_page_block_title_dashboard_content';
+DELETE FROM `sys_pages_blocks` WHERE `object` = 'sys_dashboard_audit' AND `title` = '_sys_page_block_title_dashboard_audit';
+DELETE FROM `sys_pages_blocks` WHERE `object` = 'sys_dashboard_reports' AND `title` = '_sys_page_block_title_dashboard_reports';
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `tabs`, `async`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
+('sys_dashboard_content', 1, 'system', '', '_sys_page_block_title_dashboard_content', 11, 1, 0, 192, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:14:"manage_content";s:6:"params";a:0:{}s:5:"class";s:22:"TemplDashboardServices";}', 0, 1, 1, 1),
+('sys_dashboard_audit', 1, 'system', '', '_sys_page_block_title_dashboard_audit', 11, 0, 0, 192, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:12:"manage_audit";s:6:"params";a:0:{}s:5:"class";s:22:"TemplDashboardServices";}', 0, 1, 1, 1),
+('sys_dashboard_reports', 1, 'system', '', '_sys_page_block_title_dashboard_reports', 11, 1, 0, 192, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:14:"manage_reports";s:6:"params";a:0:{}s:5:"class";s:22:"TemplDashboardServices";}', 0, 1, 1, 1);
+
+UPDATE `sys_pages_blocks` SET `title_system` = '_sys_page_block_title_system_cmts_view' WHERE `object` = 'sys_cmts_view' AND `title` = '_cmt_page_view_title';
+
+-- Logs
+
+DELETE FROM `sys_objects_logs` WHERE `object` IN('sys_cron_jobs', 'sys_transcoder');
+INSERT INTO `sys_objects_logs` (`object`, `module`, `logs_storage`, `title`, `active`, `class_name`, `class_file`) VALUES
+('sys_cron_jobs', 'system', 'Auto', '_sys_log_cron_jobs', 0, '', ''),
+('sys_transcoder', 'system', 'Auto', '_sys_log_transcoder', 1, '', '');
+
+-- Preloader
+
+DELETE FROM `sys_preloader` WHERE `module` = 'system' AND `type` = 'css_system' AND `content` = 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:21:"get_preloader_content";s:6:"params";a:1:{i:0;s:8:"tailwind";}s:5:"class";s:12:"BaseServices";}';
+INSERT INTO `sys_preloader`(`module`, `type`, `content`, `active`, `order`) VALUES
+('system', 'css_system', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:21:"get_preloader_content";s:6:"params";a:1:{i:0;s:8:"tailwind";}s:5:"class";s:12:"BaseServices";}', 1, 4);
+
+DELETE FROM `sys_preloader` WHERE `module` = 'system' AND `type` = 'js_system' AND `content` = 'BxDolConnection.js';
+INSERT INTO `sys_preloader`(`module`, `type`, `content`, `active`, `order`) VALUES
+('system', 'js_system', 'BxDolConnection.js', 1, 44);
+
+-- Switch upgrade channel
+
+UPDATE `sys_options` SET `value` = 'beta' WHERE `name` = 'sys_upgrade_channel';
+
+-- Last step is to update current version
+
+UPDATE `sys_modules` SET `version` = '13.0.0-A1' WHERE (`version` = '12.1.0.B1') AND `name` = 'system';
+