Skip to content

Commit

Permalink
Added model to fabrik-button layout data, for overrides that want inf…
Browse files Browse the repository at this point in the history
…ormation about the form.
  • Loading branch information
cheesegrits committed Dec 30, 2016
1 parent b2a2ca1 commit 37f8027
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions components/com_fabrik/views/form/view.base.php
Expand Up @@ -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) : '';
Expand All @@ -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) : '';
Expand All @@ -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
Expand All @@ -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 != ''
Expand All @@ -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;
Expand All @@ -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) : '';
Expand All @@ -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);
Expand All @@ -1087,15 +1094,17 @@ 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);

$layoutData = (object) array(
'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);
Expand Down

0 comments on commit 37f8027

Please sign in to comment.