Jelajahi Sumber

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

AntonLV 6 tahun lalu
induk
melakukan
db21cd87dd

+ 5 - 0
inc/classes/BxDolPageQuery.php

@@ -105,6 +105,11 @@ class BxDolPageQuery extends BxDolDb
         return $this->getOne($sQuery);
     }
 
+    public function getPageBlockContentPlaceholder($iId)
+    {
+        $sQuery = $this->prepare("SELECT `id`, `module`, `template` FROM `sys_pages_content_placeholders` WHERE `id` = ?", $iId);
+        return $this->getRow($sQuery);
+    }
 }
 
 /** @} */

+ 5 - 3
inc/js/classes/BxDolMenuMoreAuto.js

@@ -57,9 +57,11 @@ BxDolMenuMoreAuto.prototype.init = function() {
            $this.update();
         });
 
-        oMenu.find(this._sClassItem).on('resize', function() {
-            $this.update(true);
-        });
+        setTimeout(function () {
+            oMenu.find(this._sClassItem).on('resize', function() {
+                $this.update(true);
+            });
+        }, 200);
     }
 };
 

+ 1 - 1
inc/js/functions.js

@@ -74,7 +74,7 @@ function getHtmlData( elem, url, callback, method, confirmation, values, loading
 
 		$block.css('position', 'relative'); // set temporarily for displaying "loading icon"
 
-        if (typeof loading == undefined || loading) {
+        if ('undefined' === typeof(loading) || loading) {
     		bx_loading_content($block, true);
 	    	var $loadingDiv = $block.find('.bx-loading-ajax');
 

File diff ditekan karena terlalu besar
+ 0 - 0
install/sql/system.sql


+ 10 - 0
modules/base/general/classes/BxBaseModGeneralDb.php

@@ -127,6 +127,16 @@ class BxBaseModGeneralDb extends BxDolModuleDb
         return $this->query("UPDATE `" . $CNF['TABLE_ENTRIES'] . "` SET " . $this->arrayToSQL($aParamsSet) . " WHERE " . $this->arrayToSQL($aParamsWhere, " AND "));
     }
 
+    public function updateStatusAdmin($iContentId, $isActive)
+    {
+        $CNF = $this->_oConfig->CNF;
+        if (!isset($CNF['FIELD_STATUS_ADMIN']))
+            return false;
+        
+        $sQuery = $this->prepare("UPDATE `" . $CNF['TABLE_ENTRIES'] . "` SET `" . $CNF['FIELD_STATUS_ADMIN'] . "` = ? WHERE `" . $CNF['FIELD_ID'] . "` = ?", $isActive ? 'active' : 'hidden', $iContentId);
+        return $this->query($sQuery);
+    }
+    
     public function publishEntries()
     {
         $CNF = $this->_oConfig->CNF;

+ 8 - 2
modules/boonex/english/data/langs/system/en.xml

@@ -1473,7 +1473,8 @@
 	<string name="_adm_stg_cpt_option_sys_security_form_token_lifetime"><![CDATA[CSRF token lifetime in seconds(0 - do not track time)]]></string>
 	<string name="_adm_stg_cpt_option_sys_security_impact_threshold_block"><![CDATA[Total security impact threshold to send report and block aggressor]]></string>
 	<string name="_adm_stg_cpt_option_sys_security_impact_threshold_log"><![CDATA[Total security impact threshold to send report]]></string>
-	<string name="_adm_stg_cpt_option_sys_site_logo_height"><![CDATA[Logo Height]]></string>
+  <string name="_adm_stg_cpt_option_sys_security_block_content_after_n_reports"><![CDATA[Block content after N reports (0 - do not block)]]></string>
+  <string name="_adm_stg_cpt_option_sys_site_logo_height"><![CDATA[Logo Height]]></string>
 	<string name="_adm_stg_cpt_option_sys_site_logo_width"><![CDATA[Logo Width]]></string>
 	<string name="_adm_stg_cpt_option_sys_storage_default"><![CDATA[Default storage engine (other than Local may require custom/additional setup)]]></string>
 	<string name="_adm_stg_cpt_option_sys_storage_s3_access_key"><![CDATA[AWS access key]]></string>
@@ -2785,7 +2786,12 @@ If it is not enabled then please consider implement this optimization, since it
     <string name="_sys_off"><![CDATA[off]]></string>
     <string name="_sys_pages"><![CDATA[Pages]]></string>
     <string name="_sys_page_content_ph_loading_indicator"><![CDATA[With loading indicator]]></string>
-    <string name="_sys_page_content_ph_timeline"><![CDATA[With timeline placeholder]]></string>
+    <string name="_sys_page_content_ph_text"><![CDATA[With text placeholder]]></string>
+    <string name="_sys_page_content_ph_image"><![CDATA[With image placeholder]]></string>
+    <string name="_sys_page_content_ph_create_post"><![CDATA[With create post placeholder]]></string>
+    <string name="_sys_page_content_ph_profile_units"><![CDATA[With profile units placeholder]]></string>
+    <string name="_sys_page_content_ph_text_units_list"><![CDATA[With text units list placeholder]]></string>
+    <string name="_sys_page_content_ph_text_units_gallery"><![CDATA[With text units gallery placeholder]]></string>
 	<string name="_sys_page_block_title_about"><![CDATA[About]]></string>
 	<string name="_sys_page_block_title_account_profile_create"><![CDATA[Create a profile...]]></string>
 	<string name="_sys_page_block_title_account_profile_switcher"><![CDATA[Use site as ...]]></string>

+ 2 - 0
modules/boonex/russian/data/langs/bx_timeline/ru.xml

@@ -147,6 +147,8 @@
     <string name="_bx_timeline_page_block_title_system_manage_administration"><![CDATA[Управление всеми событями ленты]]></string>
     <string name="_bx_timeline_page_block_title_manage"><![CDATA[Управление]]></string>
 
+    <string name="_bx_timeline_page_content_ph_timeline"><![CDATA[Лента: c заполнителем в виде ленты]]></string>
+
     <!-- Menus -->
     <string name="_bx_timeline_menu_title_view"><![CDATA[Просмотр]]></string>
     <string name="_bx_timeline_menu_set_title_view"><![CDATA[Просмотр]]></string>

+ 7 - 1
modules/boonex/russian/data/langs/system/ru.xml

@@ -1456,6 +1456,7 @@
 	<string name="_adm_stg_cpt_option_sys_security_form_token_lifetime"><![CDATA[CSRF token - срок жизни в секундах (0 - не вести отчёт времени)]]></string>
 	<string name="_adm_stg_cpt_option_sys_security_impact_threshold_block"><![CDATA[Общий порог угрозы бесопасности перед тем, как послать отчёт и заблокировать агрессора]]></string>
 	<string name="_adm_stg_cpt_option_sys_security_impact_threshold_log"><![CDATA[Общий порог угрозы бесопасности перед тем, как послать отчёт]]></string>
+  <string name="_adm_stg_cpt_option_sys_security_block_content_after_n_reports"><![CDATA[Блокировать контент после N жалоб (0 - не блокировать)]]></string>
 	<string name="_adm_stg_cpt_option_sys_site_logo_height"><![CDATA[Высота лого]]></string>
 	<string name="_adm_stg_cpt_option_sys_site_logo_width"><![CDATA[Ширина лого]]></string>
 	<string name="_adm_stg_cpt_option_sys_storage_default"><![CDATA[Основной движок хранения (отличный от Local может потребовать дополнительную настройку)]]></string>
@@ -2736,7 +2737,12 @@
     <string name="_sys_off"><![CDATA[выкл.]]></string>
     <string name="_sys_pages"><![CDATA[Страницы]]></string>
     <string name="_sys_page_content_ph_loading_indicator"><![CDATA[С индикатором загрузки]]></string>
-    <string name="_sys_page_content_ph_timeline"><![CDATA[С заполнителем в виде ленты]]></string>
+    <string name="_sys_page_content_ph_text"><![CDATA[С заполнителем в виде текста]]></string>
+    <string name="_sys_page_content_ph_image"><![CDATA[С заполнителем в виде картинки]]></string>
+    <string name="_sys_page_content_ph_create_post"><![CDATA[С заполнителем в виде создания поста]]></string>
+    <string name="_sys_page_content_ph_profile_units"><![CDATA[С заполнителем в виде профайлов]]></string>
+    <string name="_sys_page_content_ph_text_units_list"><![CDATA[С заполнителем в виде списка текстовых блоков]]></string>
+    <string name="_sys_page_content_ph_text_units_gallery"><![CDATA[С заполнителем в виде галереи текстовых блоков]]></string>
 	<string name="_sys_page_block_title_about"><![CDATA[Об...]]></string>
 	<string name="_sys_page_block_title_account_profile_create"><![CDATA[Создать профиль...]]></string>
 	<string name="_sys_page_block_title_account_profile_switcher"><![CDATA[Использовать сайт как ...]]></string>

+ 7 - 0
modules/boonex/timeline/classes/BxTimelineDb.php

@@ -57,6 +57,13 @@ class BxTimelineDb extends BxBaseModNotificationsDb
                 }
         }
     }
+    
+    public function updateStatusAdmin($iContentId, $isActive)
+    {
+        $CNF = $this->_oConfig->CNF;
+        $sQuery = $this->prepare("UPDATE `" . $CNF['TABLE_ENTRIES'] . "` SET `active` = ? WHERE `" . $CNF['FIELD_ID'] . "` = ?", $isActive ? '1' : '0', $iContentId);
+        return $this->query($sQuery);
+    }
 
     public function activateModuleEvents($aData, $bActivate = true)
     {

+ 2 - 0
modules/boonex/timeline/install/langs/en.xml

@@ -147,6 +147,8 @@
     <string name="_bx_timeline_page_block_title_system_manage_administration"><![CDATA[Manage All]]></string>
     <string name="_bx_timeline_page_block_title_manage"><![CDATA[Manage]]></string>
 
+    <string name="_bx_timeline_page_content_ph_timeline"><![CDATA[Timeline: with timeline placeholder]]></string>
+
     <!-- Menus -->
     <string name="_bx_timeline_menu_title_view"><![CDATA[View]]></string>
     <string name="_bx_timeline_menu_set_title_view"><![CDATA[View]]></string>

+ 5 - 0
modules/boonex/timeline/install/sql/disable.sql

@@ -1,3 +1,8 @@
+
+-- CONTENT PLACEHOLDERS
+DELETE FROM `sys_pages_content_placeholders` WHERE `module` = 'bx_timeline';
+
+
 -- PAGES & BLOCKS
 DELETE FROM `sys_objects_page` WHERE `module` = 'bx_timeline';
 DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_timeline' OR `object` IN('bx_timeline_view', 'bx_timeline_view_home', 'bx_timeline_item', 'bx_photos_item_brief');

+ 6 - 0
modules/boonex/timeline/install/sql/enable.sql

@@ -1,3 +1,9 @@
+
+-- CONTENT PLACEHOLDERS
+SET @iCPHOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_pages_content_placeholders` ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_pages_content_placeholders` (`module`, `title`, `template`, `order`) VALUES
+('bx_timeline', '_bx_timeline_page_content_ph_timeline', 'block_async_timeline.html', @iCPHOrder + 1);
+
 -- PAGES & BLOCKS
 INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
 ('bx_timeline_view', '_bx_timeline_page_title_sys_view', '_bx_timeline_page_title_view', 'bx_timeline', 5, 2147483647, 1, 'timeline-view', 'page.php?i=timeline-view', '', '', '', 0, 1, 0, 'BxTimelinePageView', 'modules/boonex/timeline/classes/BxTimelinePageView.php'),

+ 0 - 0
template/block_async_2.html → modules/boonex/timeline/template/block_async_timeline.html


+ 16 - 0
template/block_async_create_post.html

@@ -0,0 +1,16 @@
+
+<div class="sys-cpf-form sys-cpf-default">
+    <div class="sys-cpf-user">
+        <div class="bx-base-pofile-unit-thumb bx-def-thumb bx-def-thumb-size bx-def-box-sizing bx-cont-ph"></div>
+    </div>
+    <div class="sys-cpf-content bx-def-thumb-size-min-height bx-def-thumb-size-left-indent bx-def-font-grayed">
+        <div class="bx-def-thumb-size"><span class="bx-cont-ph" style="width:11rem;">&nbsp;</span></div>
+    </div>
+</div>
+
+<script>
+    var iBlockID = '__id__';
+    $(document).ready(function () {
+        getHtmlData($('#bx-page-block-' + iBlockID), bx_append_url_params(document.location.href, 'dynamic=tab&pageBlock=' + iBlockID), undefined, 'post', false, {includedCss: JSON.stringify(aIncludedCss), includedJs: JSON.stringify(aIncludedJs)}, false);
+    });
+</script>

+ 9 - 0
template/block_async_image.html

@@ -0,0 +1,9 @@
+
+<div class="bx-cont-ph" style="height:18rem;">&nbsp;</div>
+
+<script>
+    var iBlockID = '__id__';
+    $(document).ready(function () {
+        getHtmlData($('#bx-page-block-' + iBlockID), bx_append_url_params(document.location.href, 'dynamic=tab&pageBlock=' + iBlockID), undefined, 'post', false, {includedCss: JSON.stringify(aIncludedCss), includedJs: JSON.stringify(aIncludedJs)}, false);
+    });
+</script>

+ 0 - 0
template/block_async_1.html → template/block_async_loading_indicator.html


+ 33 - 0
template/block_async_profile_units.html

@@ -0,0 +1,33 @@
+
+<template class="bx-cont-ph-profile-unit">
+    <div class="bx-base-pofile-unit-with-cover bx-def-padding-sec bx-def-box-sizing" style="min-width:19rem;">
+        <div class="bx-base-pofile-unit-cnt bx-def-box bx-def-border bx-def-round-corners bx-def-color-bg-box">
+            <span class="bx-base-pofile-unit-cover bx-def-align-center bg-col-gray" href="#" onclick="return false">
+                <div class="bx-def-unit-img bx-def-ava-size bx-def-ava bx-cont-ph"></div>
+            </span>
+            <div class="bx-base-pofile-unit-title bx-def-box-sizing bx-def-padding-sec">
+                <div class="bx-cont-ph bx-def-margin-thd-bottom" style="width:5rem;">&nbsp;</div>
+            </div>
+            <div class="bx-base-pofile-unit-info">
+                <div class="bx-base-general-unit-meta bx-def-box-sizing bx-def-padding-sec-rightbottomleft">
+                    <ul id="bx-persons-snippet-meta" class="bx-menu-custom bx-menu-custom-hor bx-menu-hor-inline bx-menu-object-bx_persons_snippet_meta bx-clearfix">
+                        <li class="bx-menu-item">
+                            <span class="bx-base-profile-unit-meta-item bx-cont-ph-inline" style="width:6rem;">&nbsp;</span>
+                        </li>
+                        <li class="bx-menu-item bx-def-margin-left"><span class="bx-base-profile-unit-meta-item bx-cont-ph-inline" style="width:6rem;">&nbsp;</span>
+                        </li>
+                    </ul>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+    var iBlockID = '__id__';
+    var sTmpl = $('#bx-page-block-' + iBlockID + ' .bx-cont-ph-profile-unit').html();
+    $('#bx-page-block-' + iBlockID + ' .bx-db-content').append(sTmpl + sTmpl + sTmpl);
+    $(document).ready(function () {
+        getHtmlData($('#bx-page-block-' + iBlockID), bx_append_url_params(document.location.href, 'dynamic=tab&pageBlock=' + iBlockID), undefined, 'post', false, {includedCss: JSON.stringify(aIncludedCss), includedJs: JSON.stringify(aIncludedJs)}, false);
+    });
+</script>

+ 15 - 0
template/block_async_text.html

@@ -0,0 +1,15 @@
+
+<div class="bx-cont-ph bx-def-margin-thd-bottom">&nbsp;</div>
+<div class="bx-cont-ph bx-def-margin-thd-bottom">&nbsp;</div>
+<div class="bx-cont-ph bx-def-margin-thd-bottom">&nbsp;</div>
+<div class="bx-cont-ph bx-def-margin-thd-bottom">&nbsp;</div>
+<div class="bx-cont-ph bx-def-margin-thd-bottom">&nbsp;</div>
+<div class="bx-cont-ph bx-def-margin-thd-bottom">&nbsp;</div>
+<div class="bx-cont-ph bx-def-margin-thd-bottom">&nbsp;</div>
+
+<script>
+    var iBlockID = '__id__';
+    $(document).ready(function () {
+        getHtmlData($('#bx-page-block-' + iBlockID), bx_append_url_params(document.location.href, 'dynamic=tab&pageBlock=' + iBlockID), undefined, 'post', false, {includedCss: JSON.stringify(aIncludedCss), includedJs: JSON.stringify(aIncludedJs)}, false);
+    });
+</script>

+ 36 - 0
template/block_async_text_units_gallery.html

@@ -0,0 +1,36 @@
+
+<template class="bx-cont-ph-profile-unit">
+
+
+<div class="bx-base-text-unit bx-base-text-unit-gallery bx-def-gal-unit-size bx-def-padding-sec" style="width:19rem;">
+    <div class="bx-base-text-unit-cnt bx-def-box bx-def-round-corners bx-def-color-bg-box bx-def-box-sizing">
+                <div class="bx-base-text-unit-thumb bx-def-gal-div-size bx-def-round-corners bx-def-font-middle bx-cont-ph">
+                </div>
+        
+        
+        <div class="bx-base-text-unit-text bx-def-padding-leftright bx-def-padding-sec-topbottom bx-def-box-sizing">
+            <div class="bx-base-text-unit-title">
+                <div class="bx-def-font-h2 bx-cont-ph-inline" style="width:14rem;">&nbsp;</div>
+            </div>
+            <div class="bx-base-text-unit-info">
+                <div class="bx-base-general-unit-meta">
+                    <ul id="bx-posts-snippet-meta" class="bx-menu-custom bx-menu-custom-hor bx-menu-hor-inline bx-menu-object-bx_posts_snippet_meta bx-clearfix">
+                        <li class="bx-menu-item bx-menu-item-date"><span class="bx-base-general-unit-meta-item bx-cont-ph-inline" style="width:7rem;">&nbsp;</span></li>
+                    </ul>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+
+</template>
+
+<script>
+    var iBlockID = '__id__';
+    var sTmpl = $('#bx-page-block-' + iBlockID + ' .bx-cont-ph-profile-unit').html();
+    $('#bx-page-block-' + iBlockID + ' .bx-db-content').append(sTmpl + sTmpl + sTmpl);
+    $(document).ready(function () {
+        getHtmlData($('#bx-page-block-' + iBlockID), bx_append_url_params(document.location.href, 'dynamic=tab&pageBlock=' + iBlockID), undefined, 'post', false, {includedCss: JSON.stringify(aIncludedCss), includedJs: JSON.stringify(aIncludedJs)}, false);
+    });
+</script>

+ 33 - 0
template/block_async_text_units_list.html

@@ -0,0 +1,33 @@
+
+<template class="bx-cont-ph-text-unit">
+    <div class="bx-base-text-unit bx-base-text-unit-ext bx-def-box bx-def-round-corners bx-def-color-bg-box bx-def-margin-bottom">
+        <div class="bx-base-text-unit-cover bx-base-text-unit-cover bx-def-round-corners bx-cont-ph" style="height:18.75rem;"></div>
+        <div class="bx-base-text-unit-text bx-def-padding bx-def-box-sizing">
+            <div class="bx-base-text-unit-title">
+                <h2 class="bx-def-font-h2 bx-cont-ph-inline" style="width:20rem; margin:0;">&nbsp;</h2>
+            </div>           
+            <div class="bx-base-text-unit-info bx-def-margin-sec-top bx-def-font-small">
+                <div class="bx-base-general-unit-meta">
+                    <ul id="bx-posts-snippet-meta" class="bx-menu-custom bx-menu-custom-hor bx-menu-hor-inline bx-menu-object-bx_posts_snippet_meta bx-clearfix">
+                        <li class="bx-menu-item bx-menu-item-date"><span class="bx-base-general-unit-meta-item bx-cont-ph" style="width:10rem;">&nbsp;</span></li>
+                    </ul>
+                </div>
+            </div>
+            <div class="bx-base-text-unit-summary bx-def-margin-sec-top bx-clearfix">
+                <div class="bx-cont-ph bx-def-margin-thd-bottom">&nbsp;</div>
+                <div class="bx-cont-ph bx-def-margin-thd-bottom">&nbsp;</div>
+                <div class="bx-cont-ph bx-def-margin-thd-bottom">&nbsp;</div>
+                <div class="bx-cont-ph bx-def-margin-thd-bottom">&nbsp;</div>
+            </div> 
+        </div>
+    </div>
+</template>
+
+<script>
+    var iBlockID = '__id__';
+    var sTmpl = $('#bx-page-block-' + iBlockID + ' .bx-cont-ph-text-unit').html();
+    $('#bx-page-block-' + iBlockID + ' .bx-db-content').append(sTmpl + sTmpl + sTmpl);
+    $(document).ready(function () {
+        getHtmlData($('#bx-page-block-' + iBlockID), bx_append_url_params(document.location.href, 'dynamic=tab&pageBlock=' + iBlockID), undefined, 'post', false, {includedCss: JSON.stringify(aIncludedCss), includedJs: JSON.stringify(aIncludedJs)}, false);
+    });
+</script>

+ 11 - 1
template/scripts/BxBasePage.php

@@ -263,7 +263,17 @@ class BxBasePage extends BxDolPage
      */
     public function getBlockAsyncCode($aBlock, $iAsync)
     {
-        return $this->_oTemplate->parseHtmlByName('block_async_' . $iAsync . '.html', $aBlock);
+        $aContentPlaceholder = $this->_oQuery->getPageBlockContentPlaceholder($iAsync);
+        if (!$aContentPlaceholder)
+            return _t('_sys_txt_error_occured');
+        $oTemplate = $this->_oTemplate;
+        if ('system' != $aContentPlaceholder['module']) {
+            $oModule = BxDolModule::getInstance($aContentPlaceholder['module']);
+            if (!$oModule)
+                return _t('_sys_txt_error_occured');
+            $oTemplate = $oModule->_oTemplate;
+        }
+        return $oTemplate->parseHtmlByName($aContentPlaceholder['template'], $aBlock);
     }
 
     /**

+ 10 - 0
template/scripts/BxBaseReport.php

@@ -295,6 +295,16 @@ class BxBaseReport extends BxDolReport
                 }
 
                 $aReport = $this->_oQuery->getReport($iObjectId);
+                
+                $iBlockContentAfter = (int)getParam('sys_security_block_content_after_n_reports');
+                if ($iBlockContentAfter > 0 && $aReport['count'] >= $iBlockContentAfter){
+                    $oModule = BxDolModule::getInstance($this->_sSystem);
+                    if(!$oModule)
+                        return;
+                    
+                    $oModule = $oModule->_oDb->updateStatusAdmin($iObjectId, false);
+                }
+                
                 return array(
                         'eval' => $this->getJsObjectName() . '.onReport(oData, oElement)',
                         'code' => 0,

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini