|
@@ -104,6 +104,11 @@ class UI {
|
|
|
public static function setTitleJsTag($title) { self::setTitle($title); }
|
|
|
public static function setTitle($title) { self::tag('script', null, "document.title = '{$title}';", "\n"); }
|
|
|
|
|
|
+ public static function hTable($params) {
|
|
|
+ ob_start();
|
|
|
+ UI::table($params);
|
|
|
+ return ob_get_clean();
|
|
|
+ }
|
|
|
/**
|
|
|
* $params - Array
|
|
|
* $params['caption'] (optional) -> <caption>...</caption>
|
|
@@ -335,7 +340,31 @@ class UI {
|
|
|
}
|
|
|
$childrens[] = self::h('button', array_merge(
|
|
|
[
|
|
|
- 'type'=>'submit',
|
|
|
+ 'type' => 'submit',
|
|
|
+ 'class' => 'btn ' . V::get('class', 'btn-default', $params),
|
|
|
+ 'style' => V::get('style', '', $params)
|
|
|
+ ],
|
|
|
+ (!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 hSimplePostTaskButton($label, $postTaskName, $params = [], $childrens = []) {
|
|
|
+ $childrens[] = self::h('input', [ 'type' => 'hidden', 'name' => '_postTask', 'value' => $postTaskName ]);
|
|
|
+ if (!empty($params['data'])) foreach ($params['data'] as $k => $v) $childrens[] = self::h('input', ['type'=>'hidden', 'name'=>$k, 'value'=>$v]);
|
|
|
+ if (!empty($params['fields'])) {
|
|
|
+ foreach ($params['fields'] as $fieldParams) {
|
|
|
+ $childrens[] = self::h('input', $fieldParams);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $childrens[] = self::h('button', array_merge(
|
|
|
+ [
|
|
|
+ 'type' => 'submit',
|
|
|
'class' => 'btn ' . V::get('class', 'btn-default', $params),
|
|
|
'style' => V::get('style', '', $params)
|
|
|
],
|