Explorar el Código

added title to UI::hButtonPost

Piotr Labudda hace 8 años
padre
commit
93b63eaac2
Se han modificado 1 ficheros con 13 adiciones y 12 borrados
  1. 13 12
      SE/se-lib/UI.php

+ 13 - 12
SE/se-lib/UI.php

@@ -314,19 +314,20 @@ class UI {
 				$childrens[] = self::h('input', $fieldParams);
 			}
 		}
-		$childrens[] = self::h('button', [
-			'type'=>'submit',
-			'class' => 'btn ' . V::get('class', 'btn-default', $params),
-			'style' => V::get('style', '', $params)
-		], $label);
-		return self::h('form', [
-				'action' => V::get('action', '', $params),
-				'method' => V::get('method', 'post', $params),
-				'style' => V::get('form.style', 'display:inline', $params),
-				'class' => "form-inline"
+		$childrens[] = self::h('button', array_merge(
+			[
+				'type'=>'submit',
+				'class' => 'btn ' . V::get('class', 'btn-default', $params),
+				'style' => V::get('style', '', $params)
 			],
-			$childrens
-		);
+			(!empty($params['title'])) ? ['title' => $params['title']] : []
+		), $label);
+		return self::h('form', [
+			'action' => V::get('action', '', $params),
+			'method' => V::get('method', 'post', $params),
+			'style' => V::get('form.style', 'display:inline', $params),
+			'class' => "form-inline"
+		], $childrens);
 	}
 
 	public static function hButtonAjax($label, $jsEventPrefix, $params = []) {