Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #15 from mageplaza/2.4-develop
Browse files Browse the repository at this point in the history
Clean code
  • Loading branch information
haitv282 committed Oct 14, 2020
2 parents 6d3e04d + 967552c commit 1f188c5
Show file tree
Hide file tree
Showing 47 changed files with 5,516 additions and 5,516 deletions.
88 changes: 44 additions & 44 deletions Block/Adminhtml/System/ComingsoonMultipleImages.php
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
<?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_BetterMaintenance
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/

namespace Mageplaza\BetterMaintenance\Block\Adminhtml\System;

use Magento\Framework\Data\Form\Element\AbstractElement;

/**
* Class ComingsoonMultipleImages
* @package Mageplaza\BetterMaintenance\Block\Adminhtml\System
*/
class ComingsoonMultipleImages extends MultipleImages
{
/**
* @param AbstractElement $element
*
* @return string
*/
protected function _getElementHtml(AbstractElement $element)
{
$html = '';
$html .= $this->setMultiImgElement()->setResponse('comingsoon')->toHtml();

return $html;
}
}
<?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_BetterMaintenance
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/

namespace Mageplaza\BetterMaintenance\Block\Adminhtml\System;

use Magento\Framework\Data\Form\Element\AbstractElement;

/**
* Class ComingsoonMultipleImages
* @package Mageplaza\BetterMaintenance\Block\Adminhtml\System
*/
class ComingsoonMultipleImages extends MultipleImages
{
/**
* @param AbstractElement $element
*
* @return string
*/
protected function _getElementHtml(AbstractElement $element)
{
$html = '';
$html .= $this->setMultiImgElement()->setResponse('comingsoon')->toHtml();

return $html;
}
}
122 changes: 61 additions & 61 deletions Block/Adminhtml/System/DatePicker.php
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
<?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_BetterMaintenance
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/

namespace Mageplaza\BetterMaintenance\Block\Adminhtml\System;

use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;

/**
* Class DatePicker
*
* @package Mageplaza\BetterMaintenance\Block\Adminhtml\System
*/
class DatePicker extends Field
{
/**
* @param AbstractElement $element
*
* @return string
*/
protected function _getElementHtml(AbstractElement $element)
{
$html = $element->getElementHtml();

$html .= '<button type="button" style="display:none;" class="ui-datepicker-trigger '
. 'v-middle"></button>';

$html .= '<script type="text/javascript">
require(["jquery", "jquery/ui", "mage/calendar"], function ($) {
$(document).ready(function () {
$("#' . $element->getHtmlId() . '").datetimepicker({dateFormat: "m/d/y", ampm: true});
var picker = $(".ui-datepicker-trigger");
picker.removeAttr("style");
picker.click(function(){
$("#' . $element->getHtmlId() . '").focus();
});
});
});
</script>';

return $html;
}
}
<?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_BetterMaintenance
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/

namespace Mageplaza\BetterMaintenance\Block\Adminhtml\System;

use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;

/**
* Class DatePicker
*
* @package Mageplaza\BetterMaintenance\Block\Adminhtml\System
*/
class DatePicker extends Field
{
/**
* @param AbstractElement $element
*
* @return string
*/
protected function _getElementHtml(AbstractElement $element)
{
$html = $element->getElementHtml();

$html .= '<button type="button" style="display:none;" class="ui-datepicker-trigger '
. 'v-middle"></button>';

$html .= '<script type="text/javascript">
require(["jquery", "jquery/ui", "mage/calendar"], function ($) {
$(document).ready(function () {
$("#' . $element->getHtmlId() . '").datetimepicker({dateFormat: "m/d/y", ampm: true});
var picker = $(".ui-datepicker-trigger");
picker.removeAttr("style");
picker.click(function(){
$("#' . $element->getHtmlId() . '").focus();
});
});
});
</script>';

return $html;
}
}
88 changes: 44 additions & 44 deletions Block/Adminhtml/System/MaintenanceMultipleImages.php
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
<?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_BetterMaintenance
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/

namespace Mageplaza\BetterMaintenance\Block\Adminhtml\System;

use Magento\Framework\Data\Form\Element\AbstractElement;

/**
* Class MaintenanceMultipleImages
* @package Mageplaza\BetterMaintenance\Block\Adminhtml\System
*/
class MaintenanceMultipleImages extends MultipleImages
{
/**
* @param AbstractElement $element
*
* @return string
*/
protected function _getElementHtml(AbstractElement $element)
{
$html = '';
$html .= $this->setMultiImgElement()->setResponse('maintenance')->toHtml();

return $html;
}
}
<?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_BetterMaintenance
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/

namespace Mageplaza\BetterMaintenance\Block\Adminhtml\System;

use Magento\Framework\Data\Form\Element\AbstractElement;

/**
* Class MaintenanceMultipleImages
* @package Mageplaza\BetterMaintenance\Block\Adminhtml\System
*/
class MaintenanceMultipleImages extends MultipleImages
{
/**
* @param AbstractElement $element
*
* @return string
*/
protected function _getElementHtml(AbstractElement $element)
{
$html = '';
$html .= $this->setMultiImgElement()->setResponse('maintenance')->toHtml();

return $html;
}
}
90 changes: 45 additions & 45 deletions Block/Adminhtml/System/MultipleImages.php
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
<?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_BetterMaintenance
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/

namespace Mageplaza\BetterMaintenance\Block\Adminhtml\System;

use Magento\Config\Block\System\Config\Form\Field;
use Mageplaza\BetterMaintenance\Block\Adminhtml\System\Renderer\Images;

/**
* Class MultipleImages
* @package Mageplaza\BetterMaintenance\Block\Adminhtml\System
*/
abstract class MultipleImages extends Field
{
/**
* @return mixed
*/
public function setMultiImgElement()
{
return $this->_layout
->createBlock(Images::class)
->setTemplate('Mageplaza_BetterMaintenance::system/config/gallery.phtml')
->setId('media_gallery_content')
->setElement($this)
->setFormName('edit_form');
}
}
<?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_BetterMaintenance
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/

namespace Mageplaza\BetterMaintenance\Block\Adminhtml\System;

use Magento\Config\Block\System\Config\Form\Field;
use Mageplaza\BetterMaintenance\Block\Adminhtml\System\Renderer\Images;

/**
* Class MultipleImages
* @package Mageplaza\BetterMaintenance\Block\Adminhtml\System
*/
abstract class MultipleImages extends Field
{
/**
* @return mixed
*/
public function setMultiImgElement()
{
return $this->_layout
->createBlock(Images::class)
->setTemplate('Mageplaza_BetterMaintenance::system/config/gallery.phtml')
->setId('media_gallery_content')
->setElement($this)
->setFormName('edit_form');
}
}
Loading

0 comments on commit 1f188c5

Please sign in to comment.