2014-06-06 21:38:34 +10:00
|
|
|
<?php namespace System\Controllers;
|
|
|
|
|
|
|
|
use Lang;
|
|
|
|
use Flash;
|
|
|
|
use Redirect;
|
|
|
|
use BackendMenu;
|
|
|
|
use Backend\Classes\Controller;
|
2014-07-27 15:07:22 +11:00
|
|
|
use System\Classes\SettingsManager;
|
2014-06-06 21:38:34 +10:00
|
|
|
|
|
|
|
/**
|
2014-07-04 18:47:46 +10:00
|
|
|
* Mail layouts controller
|
2014-06-06 21:38:34 +10:00
|
|
|
*
|
|
|
|
* @package october\system
|
|
|
|
* @author Alexey Bobkov, Samuel Georges
|
|
|
|
*/
|
2014-07-04 18:47:46 +10:00
|
|
|
class MailLayouts extends Controller
|
2014-06-06 21:38:34 +10:00
|
|
|
{
|
2017-07-27 17:35:14 +10:00
|
|
|
/**
|
|
|
|
* @var array Extensions implemented by this controller.
|
|
|
|
*/
|
2014-06-06 21:38:34 +10:00
|
|
|
public $implement = [
|
2017-07-27 17:35:14 +10:00
|
|
|
\Backend\Behaviors\FormController::class,
|
2014-06-06 21:38:34 +10:00
|
|
|
];
|
|
|
|
|
2017-07-27 17:35:14 +10:00
|
|
|
/**
|
|
|
|
* @var array `FormController` configuration.
|
|
|
|
*/
|
2014-06-06 21:38:34 +10:00
|
|
|
public $formConfig = 'config_form.yaml';
|
|
|
|
|
2017-07-27 17:35:14 +10:00
|
|
|
/**
|
|
|
|
* @var array Permissions required to view this page.
|
|
|
|
*/
|
|
|
|
public $requiredPermissions = ['system.manage_mail_templates'];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor.
|
|
|
|
*/
|
2014-06-06 21:38:34 +10:00
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
|
|
|
|
BackendMenu::setContext('October.System', 'system', 'settings');
|
2014-07-27 15:07:22 +11:00
|
|
|
SettingsManager::setContext('October.System', 'mail_templates');
|
2014-06-06 21:38:34 +10:00
|
|
|
}
|
2017-07-22 21:32:16 +10:00
|
|
|
|
|
|
|
public function update_onResetDefault($recordId)
|
|
|
|
{
|
|
|
|
$model = $this->formFindModelObject($recordId);
|
|
|
|
|
|
|
|
$model->fillFromCode();
|
|
|
|
$model->save();
|
|
|
|
|
|
|
|
Flash::success(Lang::get('backend::lang.form.reset_success'));
|
|
|
|
|
|
|
|
return Redirect::refresh();
|
|
|
|
}
|
2014-10-18 11:58:50 +02:00
|
|
|
}
|