|
Apache/2.4.41 (Ubuntu) Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) server ip : 62.171.164.128 | your ip : 127.0.0.1 safemode OFF > / home / dev2.destoffenstraat.com / app / code / Makarovsoft / Email / Block / Adminhtml / Template / |
Filename | /home/dev2.destoffenstraat.com/app/code/Makarovsoft/Email/Block/Adminhtml/Template/Edit.php |
Size | 2.76 kb |
Permission | rwxrwxrwx |
Owner | root : root |
Create time | 17-Aug-2025 10:26 |
Last modified | 06-Apr-2021 18:06 |
Last accessed | 22-Aug-2025 12:54 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
namespace Makarovsoft\Email\Block\Adminhtml\Template;
use Magento\Backend\Block\Widget\Form\Container as FormContainer;
use Magento\Backend\Block\Widget\Context;
use Magento\Framework\Registry;
class Edit extends FormContainer
{
/**
* Core registry
*
* @var \Magento\Framework\Registry
*/
protected $coreRegistry = null;
/**
* constructor
*
* @param Context $context
* @param Registry $registry
* @param array $data
*/
public function __construct(
Context $context,
Registry $registry,
array $data = []
)
{
$this->coreRegistry = $registry;
parent::__construct($context, $data);
}
/**
* Initialize template edit block
*
* @return void
*/
protected function _construct()
{
$this->_objectId = 'template_id';
$this->_blockGroup = 'Makarovsoft_Email';
$this->_controller = 'adminhtml_template';
parent::_construct();
$this->buttonList->update('save', 'label', __('Save Template'));
$this->buttonList->add(
'save-and-continue',
[
'label' => __('Save and Continue Edit'),
'class' => 'save',
'data_attribute' => [
'mage-init' => [
'button' => [
'event' => 'saveAndContinueEdit',
'target' => '#edit_form'
]
]
]
],
-100
);
$this->buttonList->update('delete', 'label', __('Delete Template'));
}
/**
* Retrieve text for header element depending on loaded template
*
* @return string
*/
public function getHeaderText()
{
/** @var \Makarovsoft\Email\Model\Template $template */
$template = $this->coreRegistry->registry('makarovsoft_email_template');
if ($template->getId()) {
return __("Edit Template '%1'", $this->escapeHtml($template->getName()));
}
return __('New Template');
}
/**
* Prepare layout
*
* @return \Magento\Framework\View\Element\AbstractBlock
*/
protected function _prepareLayout()
{
$this->_formScripts[] = "
function toggleEditor() {
if (tinyMCE.getInstanceById('template_content') == null) {
tinyMCE.execCommand('mceAddControl', false, 'template_content');
} else {
tinyMCE.execCommand('mceRemoveControl', false, 'template_content');
}
};
";
return parent::_prepareLayout();
}
}
namespace Makarovsoft\Email\Block\Adminhtml\Template;
use Magento\Backend\Block\Widget\Form\Container as FormContainer;
use Magento\Backend\Block\Widget\Context;
use Magento\Framework\Registry;
class Edit extends FormContainer
{
/**
* Core registry
*
* @var \Magento\Framework\Registry
*/
protected $coreRegistry = null;
/**
* constructor
*
* @param Context $context
* @param Registry $registry
* @param array $data
*/
public function __construct(
Context $context,
Registry $registry,
array $data = []
)
{
$this->coreRegistry = $registry;
parent::__construct($context, $data);
}
/**
* Initialize template edit block
*
* @return void
*/
protected function _construct()
{
$this->_objectId = 'template_id';
$this->_blockGroup = 'Makarovsoft_Email';
$this->_controller = 'adminhtml_template';
parent::_construct();
$this->buttonList->update('save', 'label', __('Save Template'));
$this->buttonList->add(
'save-and-continue',
[
'label' => __('Save and Continue Edit'),
'class' => 'save',
'data_attribute' => [
'mage-init' => [
'button' => [
'event' => 'saveAndContinueEdit',
'target' => '#edit_form'
]
]
]
],
-100
);
$this->buttonList->update('delete', 'label', __('Delete Template'));
}
/**
* Retrieve text for header element depending on loaded template
*
* @return string
*/
public function getHeaderText()
{
/** @var \Makarovsoft\Email\Model\Template $template */
$template = $this->coreRegistry->registry('makarovsoft_email_template');
if ($template->getId()) {
return __("Edit Template '%1'", $this->escapeHtml($template->getName()));
}
return __('New Template');
}
/**
* Prepare layout
*
* @return \Magento\Framework\View\Element\AbstractBlock
*/
protected function _prepareLayout()
{
$this->_formScripts[] = "
function toggleEditor() {
if (tinyMCE.getInstanceById('template_content') == null) {
tinyMCE.execCommand('mceAddControl', false, 'template_content');
} else {
tinyMCE.execCommand('mceRemoveControl', false, 'template_content');
}
};
";
return parent::_prepareLayout();
}
}