From 42ea1c23560ac29c7e7796714b2a1e4f40eb4481 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Wed, 31 Oct 2018 17:56:32 +0100 Subject: [PATCH] bootstrap's helper improves --- bl-kernel/admin/themes/booty/init.php | 65 +++++++++++++++++---------- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/bl-kernel/admin/themes/booty/init.php b/bl-kernel/admin/themes/booty/init.php index 4798180f..2859f202 100644 --- a/bl-kernel/admin/themes/booty/init.php +++ b/bl-kernel/admin/themes/booty/init.php @@ -102,33 +102,43 @@ EOF; public static function formInputTextBlock($args) { - $id = 'js'.$args['name']; + $name = $args['name']; + $disabled = empty($args['disabled'])?'':'disabled'; + $placeholder = isset($args['placeholder'])?$args['placeholder']:''; + $value = isset($args['value'])?$args['value']:''; + + $id = 'js'.$name; if (isset($args['id'])) { $id = $args['id']; } + $tip = ''; + if (isset($args['tip'])) { + $tip = ''.$args['tip'].''; + } + + $label = ''; + if (isset($args['label'])) { + $label = ''; + } + $class = 'form-control'; if (isset($args['class'])) { $class = $class.' '.$args['class']; } - $disabled = empty($args['disabled'])?'':'disabled'; - - $html = '
'; - - if (isset($args['label'])) { - $html .= ''; + $type = 'text'; + if (isset($args['type'])) { + $type = $args['type']; } - $html .= ''; - - if (isset($args['tip'])) { - $html .= ''.$args['tip'].''; - } - - $html .= '
'; - - return $html; +return << + $label + + $tip + +EOF; } public static function formInputFile($args) @@ -235,16 +245,25 @@ EOF; public static function formInputText($args) { - $label = isset($args['label'])?$args['label']:''; - $placeholder = isset($args['placeholder'])?$args['placeholder']:''; - $tip = isset($args['tip'])?$args['tip']:' '; - $value = isset($args['value'])?$args['value']:''; $name = $args['name']; + $disabled = empty($args['disabled'])?'':'disabled'; + $placeholder = isset($args['placeholder'])?$args['placeholder']:''; + $value = isset($args['value'])?$args['value']:''; + $id = 'js'.$name; if (isset($args['id'])) { $id = $args['id']; } - $disabled = empty($args['disabled'])?'':'disabled'; + + $tip = ''; + if (isset($args['tip'])) { + $tip = ''.$args['tip'].''; + } + + $label = ''; + if (isset($args['label'])) { + $label = ''; + } $class = 'form-control'; if (isset($args['class'])) { @@ -258,10 +277,10 @@ EOF; return << - + $label
- $tip + $tip
EOF;