From 566e3b713d58344ee5ed89104bebddd5bf94bf5c Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 22 Apr 2021 14:38:23 +0200 Subject: [PATCH] add 4th parameter $type to formSubmit() --- views/bootstrap/class.Bootstrap.php | 14 +++++++++++--- views/bootstrap4/class.Bootstrap4.php | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 819fbc10c..32bed970f 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -1150,14 +1150,22 @@ background-image: linear-gradient(to bottom, #882222, #111111);; return; } /* }}} */ - function formSubmit($value, $name='', $target='') { /* {{{ */ + function formSubmit($value, $name='', $target='', $type='primary') { /* {{{ */ + switch($type) { + case 'danger': + $class = 'btn-danger'; + break; + case 'primary': + default: + $class = 'btn-primary'; + } echo "
\n"; if(is_string($value)) { - echo "\n"; + echo "\n"; } else { if(is_array($value)) { foreach($value as $i=>$v) - echo "\n"; + echo "\n"; } } echo "
\n"; diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index 0817bdf69..c0a63d1f9 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -1142,14 +1142,22 @@ background-image: linear-gradient(to bottom, #882222, #111111);; return; } /* }}} */ - function formSubmit($value, $name='', $target='') { /* {{{ */ + function formSubmit($value, $name='', $target='', $type='primary') { /* {{{ */ + switch($type) { + case 'danger': + $class = 'btn-danger'; + break; + case 'primary': + default: + $class = 'btn-primary'; + } // echo "
\n"; if(is_string($value)) { - echo "\n"; + echo "\n"; } else { if(is_array($value)) { foreach($value as $i=>$v) - echo "\n"; + echo "\n"; } } // echo "
\n";