mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Prevent saving layout HTML/CSS if it was not previously edited
This commit is contained in:
parent
cdb520d2b1
commit
cdc713301f
1 changed files with 12 additions and 4 deletions
|
|
@ -311,14 +311,22 @@ class LayoutAdminController extends Layout
|
|||
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
$code = Context::get('code');
|
||||
$code_css = Context::get('code_css');
|
||||
$is_post = ($_SERVER['REQUEST_METHOD'] == 'POST');
|
||||
|
||||
if(!$layout_srl || !$code || !$is_post)
|
||||
$code_css = Context::get('code_css');
|
||||
if (!$layout_srl || !$code || !\RX_POST)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
$layout_info = LayoutModel::getLayout($layout_srl);
|
||||
if (!$layout_info)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\TargetNotFound;
|
||||
}
|
||||
if (!$layout_info->is_edited)
|
||||
{
|
||||
return new BaseObject(-1, 'layout.layout_editing_deprecated_p1');
|
||||
}
|
||||
|
||||
$oLayoutModel = getModel('layout');
|
||||
$layout_file = $oLayoutModel->getUserLayoutHtml($layout_srl);
|
||||
FileHandler::writeFile($layout_file, $code);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue