chg: [element:genericForm] Usage of bootstrap component to generate ajax modal
parent
26859d045e
commit
fc436e89e2
|
@ -1076,6 +1076,7 @@ class BoostrapModal extends BootstrapGeneric {
|
|||
|
||||
private function genModal()
|
||||
{
|
||||
$this->options['modalClass'] = !empty($this->options['modalClass']) && !is_array($this->options['modalClass'])? [$this->options['modalClass']] : $this->options['modalClass'];
|
||||
$dialog = $this->openNode('div', [
|
||||
'class' => array_merge(
|
||||
['modal-dialog', (!empty($this->options['size'])) ? "modal-{$this->options['size']}" : ''],
|
||||
|
|
|
@ -106,17 +106,18 @@
|
|||
$modelName = h(\Cake\Utility\Inflector::humanize(\Cake\Utility\Inflector::singularize($this->request->getParam('controller'))));
|
||||
if (!empty($ajax)) {
|
||||
$seedModal = 'mseed-' . mt_rand();
|
||||
echo $this->element('genericElements/genericModal', [
|
||||
echo $this->Bootstrap->modal([
|
||||
'title' => empty($data['title']) ? sprintf('%s %s', $actionName, $modelName) : h($data['title']),
|
||||
'body' => $this->element('genericElements/Form/formLayouts/formRaw', [
|
||||
'bodyHtml' => $this->element('genericElements/Form/formLayouts/formRaw', [
|
||||
'formCreate' => $formCreate,
|
||||
'ajaxFlashMessage' => $ajaxFlashMessage,
|
||||
'fieldsString' => $fieldsString,
|
||||
'formEnd' => $formEnd,
|
||||
'metaTemplateString' => $metaTemplateString,
|
||||
]),
|
||||
'actionButton' => $this->element('genericElements/Form/submitButton', $submitButtonData),
|
||||
'class' => "modal-lg {$seedModal}"
|
||||
'size' => !empty($fieldsString) ? 'xl' : 'lg',
|
||||
'type' => 'confirm',
|
||||
'modalClass' => $seedModal,
|
||||
]);
|
||||
} else if (!empty($raw)) {
|
||||
echo $this->element('genericElements/Form/formLayouts/formDefault', [
|
||||
|
|
Loading…
Reference in New Issue