@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | { |
94 | 94 | // looks like a single tag, <img src="" class="" />, <hr class="" /> |
95 | 95 | if (Arr::in($name, self::$singleTags)) { |
96 | - return '<' . $name . self::applyProperties($properties) . ' />'; |
|
97 | - } elseif(Arr::in($name, self::$containerTags)) { // looks like a container tag, <div class=""></div> |
|
98 | - return '<' . $name . self::applyProperties($properties) . '>' . $content . '</' . $name . '>'; |
|
96 | + return '<'.$name.self::applyProperties($properties).' />'; |
|
97 | + } elseif (Arr::in($name, self::$containerTags)) { // looks like a container tag, <div class=""></div> |
|
98 | + return '<'.$name.self::applyProperties($properties).'>'.$content.'</'.$name.'>'; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | // empty response |
@@ -122,9 +122,9 @@ discard block |
||
122 | 122 | } |
123 | 123 | // sounds like single standalone property, ex required, selected etc |
124 | 124 | if ($value === null || $value === false) { |
125 | - $build .= ' ' . htmlentities($property, ENT_QUOTES, "UTF-8"); |
|
125 | + $build .= ' '.htmlentities($property, ENT_QUOTES, "UTF-8"); |
|
126 | 126 | } else { // sounds like a classic key="value" property |
127 | - $build .= ' ' . htmlentities($property, ENT_QUOTES, "UTF-8") . '="' . htmlentities($value, ENT_QUOTES, "UTF-8") . '"'; |
|
127 | + $build .= ' '.htmlentities($property, ENT_QUOTES, "UTF-8").'="'.htmlentities($value, ENT_QUOTES, "UTF-8").'"'; |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | return $build; |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | // init dom model |
41 | 41 | $dom = new Dom(); |
42 | 42 | // draw response |
43 | - $table = $dom->table(function () use ($dom, $elements, $selectOptions) { |
|
43 | + $table = $dom->table(function() use ($dom, $elements, $selectOptions) { |
|
44 | 44 | $res = null; |
45 | 45 | // check if thead is defined |
46 | 46 | if (isset($elements['thead']) && Obj::isArray($elements['thead']) && count($elements['thead']) > 0 && Obj::isArray($elements['thead']['titles'])) { |
47 | 47 | // add thead container |
48 | - $res .= $dom->thead(function () use ($dom, $elements, $selectOptions) { |
|
49 | - return $dom->tr(function () use ($dom, $elements, $selectOptions) { |
|
48 | + $res .= $dom->thead(function() use ($dom, $elements, $selectOptions) { |
|
49 | + return $dom->tr(function() use ($dom, $elements, $selectOptions) { |
|
50 | 50 | $tr = null; |
51 | 51 | foreach ($elements['thead']['titles'] as $order => $title) { |
52 | 52 | $th = null; |
@@ -61,12 +61,12 @@ discard block |
||
61 | 61 | } |
62 | 62 | // make global checkbox for selectable columns |
63 | 63 | if ($selectOptions !== false && $order + 1 === $selectOptions['attachOrder']) { |
64 | - $th = $dom->input(function () { |
|
64 | + $th = $dom->input(function() { |
|
65 | 65 | return null; |
66 | - }, ['type' => 'checkbox', 'name' => 'selectAll']) . ' ' . $th; |
|
66 | + }, ['type' => 'checkbox', 'name' => 'selectAll']).' '.$th; |
|
67 | 67 | } |
68 | 68 | // build tr row collecting all th's |
69 | - $tr .= $dom->th(function () use ($th) { |
|
69 | + $tr .= $dom->th(function() use ($th) { |
|
70 | 70 | return $th; |
71 | 71 | }, $title['property']); |
72 | 72 | } |
@@ -85,14 +85,14 @@ discard block |
||
85 | 85 | // sort td items inside row by key increment |
86 | 86 | ksort($row); |
87 | 87 | // add data in tr container |
88 | - $tr .= $dom->tr(function () use ($dom, $row, $selectOptions) { |
|
88 | + $tr .= $dom->tr(function() use ($dom, $row, $selectOptions) { |
|
89 | 89 | $td = null; |
90 | 90 | foreach ($row as $order => $item) { |
91 | 91 | if (!Obj::isInt($order)) { |
92 | 92 | continue; |
93 | 93 | } |
94 | 94 | // collect td item |
95 | - $td .= $dom->td(function () use ($dom, $order, $item, $selectOptions) { |
|
95 | + $td .= $dom->td(function() use ($dom, $order, $item, $selectOptions) { |
|
96 | 96 | $text = null; |
97 | 97 | // make text secure based on passed options |
98 | 98 | if ($item['html'] === true) { |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | } |
107 | 107 | // check if selectable box is enabled and equal current order id |
108 | 108 | if ($selectOptions !== false && $order === $selectOptions['attachOrder']) { |
109 | - $text = $dom->input(function (){ |
|
109 | + $text = $dom->input(function() { |
|
110 | 110 | return null; |
111 | - }, Arr::merge($selectOptions['selector'], ['value' => htmlentities($text, null, 'UTF-8')])) . ' ' . $text; |
|
111 | + }, Arr::merge($selectOptions['selector'], ['value' => htmlentities($text, null, 'UTF-8')])).' '.$text; |
|
112 | 112 | } |
113 | 113 | return $text; |
114 | 114 | }, $item['property']); |
@@ -131,14 +131,14 @@ discard block |
||
131 | 131 | // build js code for "selectAll" checkbox |
132 | 132 | self::buildSelectorHtml($selectOptions); |
133 | 133 | // return response inside "form" tag |
134 | - return $dom->form(function () use ($dom, $selectOptions, $table) { |
|
134 | + return $dom->form(function() use ($dom, $selectOptions, $table) { |
|
135 | 135 | foreach ($selectOptions['buttons'] as $btn) { |
136 | 136 | if (!Obj::isArray($btn)) { |
137 | 137 | continue; |
138 | 138 | } |
139 | - $table .= $dom->input(function(){ |
|
139 | + $table .= $dom->input(function() { |
|
140 | 140 | return null; |
141 | - }, $btn) . ' '; |
|
141 | + }, $btn).' '; |
|
142 | 142 | } |
143 | 143 | return $table; |
144 | 144 | }, $selectOptions['form']); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | private static function buildSelectorHtml(array $opt) |
155 | 155 | { |
156 | 156 | $js = '$(function () { |
157 | - var targetSwitchbox = $(\'input[name="' . $opt['selector']['name'] . '"]\'); |
|
157 | + var targetSwitchbox = $(\'input[name="' . $opt['selector']['name'].'"]\'); |
|
158 | 158 | $(\'input[name="selectAll"]\').change(function() { |
159 | 159 | $(targetSwitchbox).each(function () { |
160 | 160 | $(this).prop(\'checked\', !$(this).is(\':checked\')); |