mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
commit
bc2fb3c900
@ -118,10 +118,17 @@ class CMSPageAddController extends CMSPageEditController {
|
|||||||
if(!SiteConfig::current_site_config()->canCreateTopLevel())
|
if(!SiteConfig::current_site_config()->canCreateTopLevel())
|
||||||
return Security::permissionFailure($this);
|
return Security::permissionFailure($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
$record = $this->getNewItem("new-$className-$parentID".$suffix, false);
|
$record = $this->getNewItem("new-$className-$parentID".$suffix, false);
|
||||||
if(class_exists('Translatable') && $record->hasExtension('Translatable')) $record->Locale = $data['Locale'];
|
if(class_exists('Translatable') && $record->hasExtension('Translatable')) $record->Locale = $data['Locale'];
|
||||||
$record->write();
|
|
||||||
|
try {
|
||||||
|
$record->write();
|
||||||
|
} catch(ValidationException $ex) {
|
||||||
|
$form->sessionMessage($ex->getResult()->message(), 'bad');
|
||||||
|
return $this->getResponseNegotiator()->respond($this->request);
|
||||||
|
}
|
||||||
|
|
||||||
$editController = singleton('CMSPageEditController');
|
$editController = singleton('CMSPageEditController');
|
||||||
$editController->setCurrentPageID($record->ID);
|
$editController->setCurrentPageID($record->ID);
|
||||||
|
|
||||||
|
@ -1,37 +1,36 @@
|
|||||||
<% with AddForm %>
|
<div class="cms-content center $BaseCSSClasses" data-layout-type="border" data-pjax-fragment="Content">
|
||||||
<form $FormAttributes data-layout-type="border">
|
<% with AddForm %>
|
||||||
|
<form $FormAttributes data-layout-type="border">
|
||||||
<div class="cms-content-header north">
|
<div class="cms-content-header north">
|
||||||
<div class="cms-content-header-info">
|
<div class="cms-content-header-info">
|
||||||
<h2><% _t('CMSAddPageController.Title','Add page') %></h2>
|
<h2><% _t('CMSAddPageController.Title','Add page') %></h2>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
<div class="cms-content-fields center cms-panel-content cms-panel-padded">
|
||||||
<div class="cms-content-fields center cms-panel-content cms-panel-padded">
|
<% if Message %>
|
||||||
|
<p id="{$FormName}_error" class="message $MessageType">$Message</p>
|
||||||
<% if Message %>
|
<% else %>
|
||||||
<p id="{$FormName}_error" class="message $MessageType">$Message</p>
|
<p id="{$FormName}_error" class="message $MessageType" style="display: none"></p>
|
||||||
<% else %>
|
<% end_if %>
|
||||||
<p id="{$FormName}_error" class="message $MessageType" style="display: none"></p>
|
|
||||||
<% end_if %>
|
<fieldset>
|
||||||
|
<% if Legend %><legend>$Legend</legend><% end_if %>
|
||||||
<fieldset>
|
<% loop Fields %>
|
||||||
<% if Legend %><legend>$Legend</legend><% end_if %>
|
$FieldHolder
|
||||||
<% loop Fields %>
|
<% end_loop %>
|
||||||
$FieldHolder
|
</fieldset>
|
||||||
<% end_loop %>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="cms-content-actions south">
|
|
||||||
<% if Actions %>
|
|
||||||
<div class="Actions">
|
|
||||||
<% loop Actions %>
|
|
||||||
$Field
|
|
||||||
<% end_loop %>
|
|
||||||
</div>
|
</div>
|
||||||
<% end_if %>
|
|
||||||
</div>
|
<div class="cms-content-actions south">
|
||||||
|
<% if Actions %>
|
||||||
</form>
|
<div class="Actions">
|
||||||
<% end_with %>
|
<% loop Actions %>
|
||||||
|
$Field
|
||||||
|
<% end_loop %>
|
||||||
|
</div>
|
||||||
|
<% end_if %>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<% end_with %>
|
||||||
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user