This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,33 @@
<?php
/**
* 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
*/
use Magento\Framework\Escaper;
/** @var Escaper $escaper */
?>
<?php if ($block->isBlogEnabled()) : ?>
<div class="field choice mp-blog-sign-up-author">
<input type="checkbox" name="is_mp_author" title="<?= $block->escapeHtmlAttr(__('Sign Up to be an Author')) ?>"
value="1" id="is_mp_author" class="checkbox">
<label for="is_mp_author" class="label">
<span><?= $escaper->escapeHtml(__('Sign Up to be an Author')) ?></span>
</label>
</div>
<?php endif; ?>
@@ -0,0 +1,189 @@
<?php
/**
* 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
*/
use Mageplaza\Blog\Block\Author\SignupForm;
use Magento\Framework\Escaper;
/** @var SignupForm $block */
/** @var Escaper $escaper */
$author = $block->getAuthor();
?>
<form enctype="multipart/form-data" data-mage-init='{"validation": {}}'
action="<?= $escaper->escapeHtml($block->getUrl('mpblog/author/register')) ?>" method="post" class="form"
name="mp_blog_author_form">
<fieldset class="fieldset">
<legend class="legend">
<span><?= /* @noEscape */ $author['name'] === '' ? __('Signup Author') : __('Author Information') ?></span>
</legend>
<br>
<div class="field required mp-field">
<label for="name" class="label"><span><?= $escaper->escapeHtml(__('Display Name')) ?></span></label>
<div class="control">
<input type="text" name="name" id="name" value="<?= $escaper->escapeHtml($author['name']) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Display Name')) ?>"
class="input-text" data-validate="{required:true, 'validate-no-empty':true}">
</div>
</div>
<?php if (isset($author['status'])) : ?>
<div class="field mp-field">
<label for="name" class="label"><span><?= $escaper->escapeHtml(__('Status')) ?></span></label>
<div class="control">
<span><?= $escaper->escapeHtml($author['status']) ?></span>
</div>
</div>
<?php endif;?>
<div class="field mp-field">
<label for="short_desciption" class="label">
<span><?= $escaper->escapeHtml(__('Short Description')) ?></span>
</label>
<div class="control">
<textarea name="short_description" id="short_description" rows="5" cols="19">
<?= /* @noEscape */ $author['short_description']
? $block->getPageFilter($author['short_description']) : '' ?>
</textarea>
</div>
</div>
<div class="field mp-field">
<label for="image" class="label"><span><?= /* @noEscape */
__('Avatar') ?></span></label>
<div class="control">
<?php if (!empty($author['image'])) : ?>
<a class="mp-image-link"
href="<?= $escaper->escapeUrl($block->getImageUrl($author['image'], 'auth')) ?>" >
<img src="<?= $escaper->escapeUrl($block->getImageUrl($author['image'], 'auth')) ?>"
id="post_image_image"
title="<?= $escaper->escapeHtmlAttr($author['image']) ?>"
alt="<?= $escaper->escapeHtmlAttr($author['image']) ?>" height="22" width="22"
class="small-image-preview v-middle">
</a>
<?php endif; ?>
<input type="file" name="image" id="image" value="<?= $escaper->escapeHtml($author['image']) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Avatar')) ?>"
class="input-file"
style="width: 90%;position: relative;top: -5px">
<?php if (!empty($author['image'])) : ?>
<span class="delete-image">
<input style="width: 8%" type="checkbox" name="image[delete]" value="1" class="checkbox" id="post_image_delete">
<label for="post_image_delete"> Delete Image</label>
</span>
<?php endif; ?>
</div>
</div>
<div class="field mp-field">
<label for="url_key" class="label"><span><?= $escaper->escapeHtml(__('URL Key')) ?></span></label>
<div class="control">
<input type="text" name="url_key" id="url_key" value="<?= $escaper->escapeHtmlAttr($author['url_key']) ?>"
title="<?= $escaper->escapeHtmlAttr(__('URL Key')) ?>"
class="input-text">
</div>
</div>
<div class="field mp-field">
<label for="full_url" class="label"><span><?= $escaper->escapeHtml(__('Full URL')) ?></span></label>
<div class="control">
<span class="mp_full_url">
<?= $escaper->escapeHtml($block->getUrl("blog/author")
. $author['url_key'] . $block->getUrlSuffix()) ?>
</span>
</div>
</div>
<div class="field mp-field">
<label for="facebook_link" class="label"><span><?= $escaper->escapeHtml(__('Facebook Link')) ?></span></label>
<div class="control">
<input type="url" name="facebook_link" id="facebook_link"
value="<?= $escaper->escapeHtml($author['facebook_link']) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Facebook Link')) ?>" class="input-text">
</div>
</div>
<div class="field mp-field">
<label for="twitter_link" class="label"><span><?= $escaper->escapeHtml(__('Twitter Link')) ?></span></label>
<div class="control">
<input type="url" name="twitter_link" id="twitter_link"
value="<?= $escaper->escapeHtmlAttr($author['twitter_link']) ?>"
title="<?= $escaper->escapeHtmlAttr(__('Twitter Link')) ?>" class="input-text">
</div>
</div>
</fieldset>
<div class="actions-toolbar">
<div class="primary">
<button type="submit" class="action submit primary"
title="<?= /* @noEscape */ $author['name'] === '' ? __('Submit') : __('Save') ?>">
<span>
<?= /* @noEscape */ $author['name'] === '' ? __('Submit') : __('Save') ?>
</span>
</button>
</div>
</div>
</form>
<style>
.mp-field {
display: flex;
}
.mp-field .control{
width: 70%;
}
.mp-field .control .delete-image{
width: 65%;
}
.mp-field .label {
width: 30%;
}
.sidebar.sidebar-main:before {
content: unset !important;
}
@media (max-width: 768px) {
fieldset.fieldset {
display: contents;
}
fieldset.fieldset .control .mp_full_url {
word-break: break-all;
}
.actions-toolbar {
margin-top: 20px;
}
}
</style>
<script>
require(
[
'jquery',
"Mageplaza_Blog/js/get-editor"
], function ($, editor) {
$('#url_key').on('keyup', function () {
var url = '<?= $escaper->escapeUrl($block->getUrl("blog/author")) ?>'
+ $(this).val() + '<?= $escaper->escapeHtml($block->getUrlSuffix())?>';
if ($(this).val() === '') {
url = '';
}
$('.mp_full_url').html(url);
});
editor.config(
'short_description',
'<?= /* @noEscape */ $block->getVersion() ?>',
'<?= /* @noEscape */ $block->getMagentoVersion() ?>',
'99%'
);
});
</script>
@@ -0,0 +1,75 @@
<?php
/**
* 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
*/
use Mageplaza\Blog\Block\Author\Widget;
use Mageplaza\Blog\Helper\Image;
use Magento\Framework\Escaper;
/** @var Widget $block */
/** @var Escaper $escaper */
$author = $block->getCurrentAuthor();
if ($author) : ?>
<div class="mp-sidebar mpcss">
<div class="row">
<div class="author-name col-xs-12">
<h3><?= $escaper->escapeHtml($author->getName()) ?></h3>
</div>
<div class="author-image col-xs-12">
<img class="img-responsive"
src="<?= $escaper->escapeUrl($author->getImage() ? $block->resizeImage($author->getImage(), '135x', Image::TEMPLATE_MEDIA_TYPE_AUTH) : $block->getDefaultAuthorImage()) ?>"
alt="<?= $escaper->escapeHtml($author->getName()); ?>"/>
</div>
<div class="author-content col-xs-12">
<?= $block->getPageFilter(($author->getShortDescription())) ?: $escaper->escapeHtml(__('No info')) ?>
</div>
<div class="author-social col-xs-12">
<?php if ($author->getFacebookLink()) : ?>
<a href="<?= $escaper->escapeUrl($author->getFacebookLink()) ?>" target="_blank">
<img class="img-responsive"
src="<?= $escaper->escapeUrl($block->getViewFileUrl('Mageplaza_Blog::media/images/facebook.png')) ?>"
align="middle"
alt="<?= $escaper->escapeHtml($author->getName()); ?>"/>
</a>
<?php else : ?>
<img class="img-responsive"
src="<?= $escaper->escapeUrl($block->getViewFileUrl('Mageplaza_Blog::media/images/facebookoff.png')) ?>"
align="middle"
alt="<?= $escaper->escapeHtml($author->getName()); ?>"/>
<?php endif; ?>
<?php if ($author->getTwitterLink()) : ?>
<a href="<?= $escaper->escapeUrl($author->getTwitterLink()) ?>" target="_blank">
<img class="img-responsive"
src="<?= $escaper->escapeUrl($block->getViewFileUrl('Mageplaza_Blog::media/images/twitter.png')) ?>"
align="middle"
alt="<?= $escaper->escapeHtml($author->getName()); ?>"/>
</a>
<?php else : ?>
<img class="img-responsive"
src="<?= $escaper->escapeUrl($block->getViewFileUrl('Mageplaza_Blog::media/images/twitter-off.png')) ?>"
align="middle"
alt="<?= $escaper->escapeHtml($author->getName()); ?>"/>
<?php endif; ?>
<div class="mp-clear"></div>
</div>
<div class="author-border col-xs-12"></div>
</div>
</div>
<?php endif; ?>