From 643e948440a310ab1b7ff34c7be2d16cc4679504 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 26 Jun 2018 06:51:04 +0200 Subject: [PATCH] add field_wrap to formField(), separate some methods in get and print --- views/bootstrap/class.Bootstrap.php | 62 ++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 7cebad703..b67f190d8 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -838,12 +838,14 @@ background-image: linear-gradient(to bottom, #882222, #111111);; return; } /* }}} */ - function formField($title, $value) { /* {{{ */ + function formField($title, $value, $params=array()) { /* {{{ */ if($title !== null) { echo "
"; echo " "; echo "
"; } + if(isset($params['field_wrap'][0])) + echo $params['field_wrap'][0]; if(is_string($value)) { echo $value; } elseif(is_array($value)) { @@ -895,6 +897,8 @@ background-image: linear-gradient(to bottom, #882222, #111111);; break; } } + if(isset($params['field_wrap'][1])) + echo $params['field_wrap'][1]; if($title !== null) { echo "
"; echo "
"; @@ -1855,6 +1859,20 @@ $(function() { return ''; } /* }}} */ + /** + * Output left-arrow with link which takes over a number of ids into + * a select box. + * + * Clicking in the button will preset the comma seperated list of ids + * in data-ref as options in the select box with name $name + * + * @param string $name id of select box + * @param array $ids list of option values + */ + function getSelectPresetButtonHtml($name, $ids) { /* {{{ */ + return ''; + } /* }}} */ + /** * Output left-arrow with link which takes over a number of ids into * a select box. @@ -1866,9 +1884,7 @@ $(function() { * @param array $ids list of option values */ function printSelectPresetButtonHtml($name, $ids) { /* {{{ */ -?> - " data-ref="" data-ids=""> -'; + } /* }}} */ + /** * Output left-arrow with link which takes over a string into * a input field. @@ -1906,9 +1936,7 @@ $(document).ready( function() { * @param string $text text */ function printInputPresetButtonHtml($name, $text, $sep='') { /* {{{ */ -?> - " data-ref="" data-text=""> - + return ''; + - " data-ref="" data-text=""> -