Skip to content

Commit

Permalink
Merge pull request #369 from mageplaza/2.4-develop
Browse files Browse the repository at this point in the history
2.4 develop
  • Loading branch information
chuccv authored Jun 12, 2024
2 parents 5630b77 + bfdc2d7 commit 3e5b3cb
Show file tree
Hide file tree
Showing 51 changed files with 654 additions and 549 deletions.
4 changes: 2 additions & 2 deletions Block/Post/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function commentHtml($comment)
{
$html = '';
foreach (explode("\n", trim($comment)) as $value) {
$html .= '<p>' . $value . '</p>';
$html .= '<p>' . $this->escapeHtml($value) . '</p>';
}

return $html;
Expand Down Expand Up @@ -285,7 +285,7 @@ public function getCommentsTree($comments, $cmtId)
. $userName . '</span>
</div>
<div class="cmt-row__cmt-content">
' . $this->escapeHtml($this->commentHtml($comment['content'])) . '
' . $this->commentHtml($comment['content']) . '
</div>
<div class="cmt-row__cmt-interactions interactions">
<div class="interactions__btn-actions">
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "mageplaza/magento-2-blog-extension",
"description": "Magento 2 Blog extension",
"require": {
"mageplaza/module-core": "^1.5.6",
"mageplaza/module-core": "^1.5.7",
"mageplaza/facebook-graph-sdk": "^1.0.1"
},
"type": "magento2-module",
"version": "4.2.2",
"version": "4.2.3",
"license": "proprietary",
"keywords": [
"magento 2",
Expand Down
3 changes: 3 additions & 0 deletions view/adminhtml/layout/mageplaza_blog_post_edit.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="editor"/>
<head>
<css src="Mageplaza_Blog::css/post/edit/post.css"/>
</head>
<body>
<referenceContainer name="content">
<block class="Mageplaza\Blog\Block\Adminhtml\Post\Edit" name="mageplaza_blog_post_edit"/>
Expand Down
5 changes: 4 additions & 1 deletion view/adminhtml/templates/category/edit.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
use Magento\Framework\Escaper;

/** @var Escaper $escaper */
?>
<div id="category-edit-container" class="category-content">
<?= $block->getChildHtml('form') ?>
Expand Down Expand Up @@ -46,7 +49,7 @@
* with this form, we surely delete same Category in the tree and at backend
*/
function categoryDelete (url) {
if (confirm('<?= $block->escapeHtml(__('Are you sure you want to delete this Category?')) ?>')) {
if (confirm('<?= $escaper->escapeHtml(__('Are you sure you want to delete this Category?')) ?>')) {
location.href = url;
}
}
Expand Down
27 changes: 15 additions & 12 deletions view/adminhtml/templates/category/edit/form.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
* @license https://www.mageplaza.com/LICENSE.txt
*/
use Mageplaza\Blog\Block\Adminhtml\Category\Edit\Form;
use Magento\Framework\Escaper;

/** @var Form $block */
/** @var Escaper $escaper */

$parentId = $block->getParentCategoryId();
$categoryId = $block->getCategoryId();
$blockGrid = $block->getLayout()->getBlock('mageplaza_blog_category_edit_tab_post');
Expand All @@ -32,9 +35,9 @@ $gridJsObjectName = $blockGrid->getJsObjectName();
<?= $block->getTabsHtml() ?>

<iframe name="iframeSave" style="display:none; width:100%;"
src="<?= $block->escapeUrl($block->getViewFileUrl('blank.html')) ?>"></iframe>
src="<?= $escaper->escapeUrl($block->getViewFileUrl('blank.html')) ?>"></iframe>
<form id="category_edit_form" name="category-edit-form"
action="<?= $block->escapeUrl($block->getSaveUrl()) ?>" method="post"
action="<?= $escaper->escapeUrl($block->getSaveUrl()) ?>" method="post"
enctype="multipart/form-data">
<div class="no-display">
<input type="hidden" name="isIframe" value="1"/>
Expand All @@ -56,17 +59,17 @@ $gridJsObjectName = $blockGrid->getJsObjectName();
"Magento_Catalog/catalog/category/assign-products": {
"selectedProducts": <?= /** @noEscape */ $block->getPostsJson() ?>,
"gridJsObjectName": <?= '"' . $gridJsObjectName . '"' ?: '{}'; ?>
}
}
}
}
}
</script>
</div>
<div id="category_tab_content"></div>
</form>

<div data-id="information-dialog-category" class="messages" style="display: none;">
<div class="message message-notice">
<div><?= $block->escapeHtml(__('This operation can take a long time')) ?></div>
<div><?= $escaper->escapeHtml(__('This operation can take a long time')) ?></div>
</div>
</div>

Expand Down Expand Up @@ -174,12 +177,12 @@ $gridJsObjectName = $blockGrid->getJsObjectName();
<?php if ($block->isAjax()
&& ($tabsBlock = $block->getLayout()->getBlock('tabs'))
&& ($_tabsJsObject = $tabsBlock->getJsObjectName())) : ?>
require(["jquery", "mage/backend/tabs"], function ($) {
var activeAnchor = $('#<?= /** @noEscape */ $tabsBlock->getId() ?>').tabs('activeAnchor');
if (activeAnchor.length) {
$('active_tab_id').value = activeAnchor.prop('id');
}
$('active_tab_id').tabsJsObject = $('#<?= /** @noEscape */ $tabsBlock->getId() ?>');
});
require(["jquery", "mage/backend/tabs"], function ($) {
var activeAnchor = $('#<?= /** @noEscape */ $tabsBlock->getId() ?>').tabs('activeAnchor');
if (activeAnchor.length) {
$('active_tab_id').value = activeAnchor.prop('id');
}
$('active_tab_id').tabsJsObject = $('#<?= /** @noEscape */ $tabsBlock->getId() ?>');
});
<?php endif; ?>
</script>
6 changes: 4 additions & 2 deletions view/adminhtml/templates/import/form/import.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
*/

use Mageplaza\Blog\Block\Adminhtml\Import\Edit\Import;
use Magento\Framework\Escaper;

/** @var Import $block */
/** @var Escaper $escaper */
?>
<script>
require(['jquery'], function ($) {
Expand Down Expand Up @@ -85,7 +87,7 @@ use Mageplaza\Blog\Block\Adminhtml\Import\Edit\Import;
initImportCheckConnection: function () {
if ($('#edit_form').valid()) {
$('body').loader('show');
var url = '<?= $block->escapeUrl($block->getUrl(
var url = '<?= $escaper->escapeUrl($block->getUrl(
'mageplaza_blog/import/validate',
['form_key' => $block->getFormKey()]
)) ?>';
Expand Down Expand Up @@ -134,7 +136,7 @@ use Mageplaza\Blog\Block\Adminhtml\Import\Edit\Import;
importAction: function () {
$('body').loader('show');
$.ajax({
url: '<?= $block->escapeUrl($block->getUrl(
url: '<?= $escaper->escapeUrl($block->getUrl(
'mageplaza_blog/import/import',
['form_key' => $block->getFormKey()]
))?>',
Expand Down
9 changes: 5 additions & 4 deletions view/adminhtml/web/category/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

define([
'jquery',
'prototype'
'prototype',
'extjs/ext-tree-checkbox'
], function (jQuery) {

var categorySubmit = function (url, useAjax) {
Expand Down Expand Up @@ -51,11 +52,11 @@ define([

// Make operations with Blog Category tree
if (isCreating) {
if (!tree.currentNodeId) {
if (!Ext.tree.currentNodeId) {
// First submit of form - select some node to be current
tree.currentNodeId = parentId;
Ext.tree.currentNodeId = parentId;
}
tree.addNodeTo = parentId;
Ext.tree.addNodeTo = parentId;
}

// Submit form
Expand Down
23 changes: 23 additions & 0 deletions view/adminhtml/web/css/post/edit/post.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Mageplaza
*
* NOTICE OF LICENSE
*
* This source file is subject to the Mageplaza.com license that is
* available through the world-wide-web at this URL:
* https://www.mageplaza.com/LICENSE.txt
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Mageplaza
* @package Mageplaza_Blog
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/

.page-actions {
overflow-x: visible !important;
}
2 changes: 1 addition & 1 deletion view/frontend/layout/catalog_product_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</head>
<body>
<referenceBlock name="product.info.details">
<block class="Mageplaza\Blog\Block\Post\RelatedPost" name="related.post.tab" template="Mageplaza_Blog::post/relatedpost.phtml" group="detailed_info" ifconfig="blog/product_post/product_detail/enable_post"/>
<block class="Mageplaza\Blog\Block\Post\RelatedPost" name="related.post.tab" template="Mageplaza_Blog::post/related_post.phtml" group="detailed_info" ifconfig="blog/product_post/product_detail/enable_post"/>
</referenceBlock>
</body>
</page>
2 changes: 1 addition & 1 deletion view/frontend/layout/mpblog_post_editpost.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</head>
<body>
<referenceContainer name="content">
<block class="Mageplaza\Blog\Block\Post\ManagePost" name="mpblog.author.post" as="mpblog_post" template="Mageplaza_Blog::post/managePost.phtml"/>
<block class="Mageplaza\Blog\Block\Post\ManagePost" name="mpblog.author.post" as="mpblog_post" template="Mageplaza_Blog::post/manage_post.phtml"/>
</referenceContainer>
</body>
</page>
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/layout/mpblog_post_history.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<body>
<referenceContainer name="content">
<block class="Mageplaza\Blog\Block\Post\AuthorPost" name="mpblog.author.post" as="mpblog_post" template="Mageplaza_Blog::post/author_post.phtml" cacheable="false">
<block class="Mageplaza\Blog\Block\Post\ManagePost" name="mpblog.manage.post" as="mpblog_manage_post" template="Mageplaza_Blog::post/managePost.phtml">
<block class="Mageplaza\Blog\Block\Post\ManagePost" name="mpblog.manage.post" as="mpblog_manage_post" template="Mageplaza_Blog::post/manage_post.phtml">
<block name="field_additional"/>
</block>
</block>
Expand Down
Loading

0 comments on commit 3e5b3cb

Please sign in to comment.