From 37f8027089c6fbaefd760912811f49bb940b5592 Mon Sep 17 00:00:00 2001 From: Hugh Messenger Date: Fri, 30 Dec 2016 14:41:23 -0600 Subject: [PATCH] Added model to fabrik-button layout data, for overrides that want information about the form. --- .../com_fabrik/views/form/view.base.php | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/components/com_fabrik/views/form/view.base.php b/components/com_fabrik/views/form/view.base.php index c6c1077e3cf..5d5b8b20900 100644 --- a/components/com_fabrik/views/form/view.base.php +++ b/components/com_fabrik/views/form/view.base.php @@ -972,7 +972,8 @@ protected function _loadTmplBottom(&$form) 'type' => 'reset', 'class' => 'btn-warning button clearSession', 'name' => 'Reset', - 'label' => $resetLabel + 'label' => $resetLabel, + 'formModel' => $model ); $form->resetButton = $params->get('reset_button', 0) && $this->editable == '1' ? $btnLayout->render($layoutData) : ''; @@ -987,7 +988,8 @@ protected function _loadTmplBottom(&$form) 'type' => 'submit', 'class' => 'button', 'name' => 'Copy', - 'label' => $copyLabel + 'label' => $copyLabel, + 'formModel' => $model ); $form->copyButton = $params->get('copy_button', 0) && $this->editable && $model->getRowId() != '' ? $btnLayout->render($layoutData) : ''; @@ -1003,7 +1005,8 @@ protected function _loadTmplBottom(&$form) 'type' => $model->isAjax() ? 'button' : 'submit', 'class' => 'button', 'name' => 'apply', - 'label' => $applyLabel + 'label' => $applyLabel, + 'formModel' => $model ); $form->applyButton = $params->get('apply_button', 0) && $this->editable @@ -1020,7 +1023,8 @@ protected function _loadTmplBottom(&$form) 'type' => 'submit', 'class' => 'btn-danger button', 'name' => 'delete', - 'label' => $deleteLabel + 'label' => $deleteLabel, + 'formModel' => $model ); $form->deleteButton = $params->get('delete_button', 0) && $canDelete && $this->editable && $thisRowId != '' @@ -1038,7 +1042,8 @@ protected function _loadTmplBottom(&$form) 'type' => 'button', 'class' => 'clearSession', 'name' => '', - 'label' => FText::_('COM_FABRIK_CLEAR_MULTI_PAGE_SESSION') + 'label' => FText::_('COM_FABRIK_CLEAR_MULTI_PAGE_SESSION'), + 'formModel' => $model ); $multiPageSession = $model->sessionModel && $model->sessionModel->last_page > 0; @@ -1049,7 +1054,8 @@ protected function _loadTmplBottom(&$form) 'class' => 'button', 'name' => 'Goback', 'label' => $goBackLabel, - 'attributes' => $model->isAjax() ? '' : FabrikWorker::goBackAction() + 'attributes' => $model->isAjax() ? '' : FabrikWorker::goBackAction(), + 'formModel' => $model ); $form->gobackButton = $params->get('goback_button', 0) ? $btnLayout->render($layoutData) : ''; @@ -1071,7 +1077,8 @@ protected function _loadTmplBottom(&$form) 'type' => $model->isAjax() ? 'button' : 'submit', 'class' => 'btn-primary button ' . $submitClass, 'name' => 'Submit', - 'label' => $submitLabel + 'label' => $submitLabel, + 'formModel' => $model ); $form->submitButton = $btnLayout->render($layoutData); @@ -1087,7 +1094,8 @@ protected function _loadTmplBottom(&$form) 'type' => 'button', 'class' => 'fabrikPagePrevious button', 'name' => 'fabrikPagePrevious', - 'label' => FabrikHelperHTML::icon('icon-previous', FText::_('COM_FABRIK_PREV')) + 'label' => FabrikHelperHTML::icon('icon-previous', FText::_('COM_FABRIK_PREV')), + 'formModel' => $model ); $form->prevButton = $btnLayout->render($layoutData); @@ -1095,7 +1103,8 @@ protected function _loadTmplBottom(&$form) 'type' => 'button', 'class' => 'fabrikPageNext button', 'name' => 'fabrikPageNext', - 'label' => FText::_('COM_FABRIK_NEXT') . ' ' . FabrikHelperHTML::icon('icon-next') + 'label' => FText::_('COM_FABRIK_NEXT') . ' ' . FabrikHelperHTML::icon('icon-next'), + 'formModel' => $model ); $form->nextButton = $btnLayout->render($layoutData);