@@ -68,25 +68,25 @@ discard block |
||
| 68 | 68 | return $this->response(); |
| 69 | 69 | |
| 70 | 70 | |
| 71 | - $cols_layout = $epesi->add(['Columns', 'id' => 'dashboard']); |
|
| 71 | + $cols_layout = $epesi->add(['Columns', 'id' => 'dashboard']); |
|
| 72 | 72 | |
| 73 | - foreach ([1, 2, 3] as $column_id) { |
|
| 74 | - $col = $cols_layout->addColumn(['ui' => 'sortable', 'id' => 'dashboard_applets_1_' . $column_id]); |
|
| 75 | - foreach ([1, 2, 3] as $applet_id) { |
|
| 76 | - $this->applet($col); |
|
| 77 | - } |
|
| 78 | - } |
|
| 73 | + foreach ([1, 2, 3] as $column_id) { |
|
| 74 | + $col = $cols_layout->addColumn(['ui' => 'sortable', 'id' => 'dashboard_applets_1_' . $column_id]); |
|
| 75 | + foreach ([1, 2, 3] as $applet_id) { |
|
| 76 | + $this->applet($col); |
|
| 77 | + } |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | - $cols_layout->js(true)->find('.sortable')->sortable([ |
|
| 81 | - 'cursor' => 'move', |
|
| 82 | - 'handle' => '.panel-sortable-handle', |
|
| 83 | - 'connectWith' => '.sortable', |
|
| 84 | - 'update' => new jsFunction([new jsExpression('console.log($( ".sortable" ).sortable( "toArray"))')]) |
|
| 85 | - ]); |
|
| 80 | + $cols_layout->js(true)->find('.sortable')->sortable([ |
|
| 81 | + 'cursor' => 'move', |
|
| 82 | + 'handle' => '.panel-sortable-handle', |
|
| 83 | + 'connectWith' => '.sortable', |
|
| 84 | + 'update' => new jsFunction([new jsExpression('console.log($( ".sortable" ).sortable( "toArray"))')]) |
|
| 85 | + ]); |
|
| 86 | 86 | |
| 87 | - $cols_layout->js(true)->find('.applet-close')->click(new jsFunction(['e'], [new jsExpression('$(e.target).closest(".panel-sortable").remove()')])); |
|
| 87 | + $cols_layout->js(true)->find('.applet-close')->click(new jsFunction(['e'], [new jsExpression('$(e.target).closest(".panel-sortable").remove()')])); |
|
| 88 | 88 | |
| 89 | - $epesi->addStyle('#dashboard .panel-sortable-handle { |
|
| 89 | + $epesi->addStyle('#dashboard .panel-sortable-handle { |
|
| 90 | 90 | cursor: move; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -95,13 +95,13 @@ discard block |
||
| 95 | 95 | cursor: pointer; |
| 96 | 96 | }'); |
| 97 | 97 | |
| 98 | - $epesi->requireJS('https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js'); |
|
| 98 | + $epesi->requireJS('https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.0/jquery-ui.js'); |
|
| 99 | 99 | // $epesi->requireJS('http://ksylvest.github.io/jquery-gridly/javascripts/jquery.gridly.js'); |
| 100 | 100 | |
| 101 | 101 | |
| 102 | - return response($epesi->run()); |
|
| 102 | + return response($epesi->run()); |
|
| 103 | 103 | |
| 104 | - $layout = $epesi->layout; |
|
| 104 | + $layout = $epesi->layout; |
|
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | // $text = $epesi->add(['Text', '<span id="testddd"><a href="#">testing popup</a><br><br><br></span>']); |
@@ -123,15 +123,15 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | |
| 125 | 125 | |
| 126 | - // Add item into menu |
|
| 127 | - $layout->menuLeft->addItem(['Dashboard 1', 'icon' => 'home'], ['index']); |
|
| 128 | - $layout->menuLeft->addItem(['Dashboard 2', 'icon' => 'home'], ['index']); |
|
| 129 | - $layout->menuLeft->addItem('Layouts', new jsModal('Test', null)); |
|
| 130 | - $sub = $layout->menuLeft->addMenu('Some Bars'); |
|
| 131 | - $sub->addItem(['Bar 1', 'icon' => 'object group']); |
|
| 132 | - $sub->addItem(['Bar 2', 'icon' => 'object group']); |
|
| 126 | + // Add item into menu |
|
| 127 | + $layout->menuLeft->addItem(['Dashboard 1', 'icon' => 'home'], ['index']); |
|
| 128 | + $layout->menuLeft->addItem(['Dashboard 2', 'icon' => 'home'], ['index']); |
|
| 129 | + $layout->menuLeft->addItem('Layouts', new jsModal('Test', null)); |
|
| 130 | + $sub = $layout->menuLeft->addMenu('Some Bars'); |
|
| 131 | + $sub->addItem(['Bar 1', 'icon' => 'object group']); |
|
| 132 | + $sub->addItem(['Bar 2', 'icon' => 'object group']); |
|
| 133 | 133 | |
| 134 | - $label = $layout->menuRight->add(['Label', 'Zoe', 'image' => 'https://semantic-ui.com/images/avatar/small/ade.jpg']); |
|
| 134 | + $label = $layout->menuRight->add(['Label', 'Zoe', 'image' => 'https://semantic-ui.com/images/avatar/small/ade.jpg']); |
|
| 135 | 135 | |
| 136 | 136 | // $sub = $layout->menuRight->addMenu(['User', 'image' => 'http://127.0.0.1/data/Base_Theme/templates/default/Utils/RecordBrowser/history.png']); |
| 137 | 137 | // $sub->addItem(['Bar 3', 'icon' => 'object group']); |
@@ -139,99 +139,99 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | // $menu = $epesi->add(['Menu', 'labeled icon', ]); |
| 141 | 141 | |
| 142 | - $layout->menu->addItem(['Back', 'icon' => ['angle left', 'Back', ]]); |
|
| 142 | + $layout->menu->addItem(['Back', 'icon' => ['angle left', 'Back', ]]); |
|
| 143 | 143 | |
| 144 | - $layout->template['Footer'] = 'Test'; |
|
| 144 | + $layout->template['Footer'] = 'Test'; |
|
| 145 | 145 | |
| 146 | 146 | // $EditGroup = $layout->menuLeft->addGroup(['Edit', 'icon' => 'edit']); |
| 147 | 147 | // $EditGroup->addItem('Basics', ['edit/basic']); |
| 148 | 148 | |
| 149 | - $cols_layout = $epesi->add(['Columns']); |
|
| 149 | + $cols_layout = $epesi->add(['Columns']); |
|
| 150 | 150 | |
| 151 | - $col1 = $cols_layout->addColumn(); |
|
| 152 | - $col1->add(['Header', 'Ships >> Edit', 'icon' => 'ship', 'size' => 2]); |
|
| 151 | + $col1 = $cols_layout->addColumn(); |
|
| 152 | + $col1->add(['Header', 'Ships >> Edit', 'icon' => 'ship', 'size' => 2]); |
|
| 153 | 153 | |
| 154 | - $col2 = $cols_layout->addColumn(); |
|
| 155 | - $h1 = $col2->add(['Header', null, 'aligned right', 'size' => 5]); |
|
| 154 | + $col2 = $cols_layout->addColumn(); |
|
| 155 | + $h1 = $col2->add(['Header', null, 'aligned right', 'size' => 5]); |
|
| 156 | 156 | |
| 157 | - $h1->add(['Text', '* Indicates required fields' . ' ']); |
|
| 157 | + $h1->add(['Text', '* Indicates required fields' . ' ']); |
|
| 158 | 158 | |
| 159 | - $bar = $h1->add(['ui' => 'buttons']); |
|
| 159 | + $bar = $h1->add(['ui' => 'buttons']); |
|
| 160 | 160 | |
| 161 | - $bar->add(['Button', 'icon' => 'info']); |
|
| 162 | - $bar->add(['Button', 'icon' => 'history']); |
|
| 163 | - $bar->add(['Button', 'icon' => 'copy']); |
|
| 164 | - $bar->add(['Button', 'icon' => 'eye']); |
|
| 161 | + $bar->add(['Button', 'icon' => 'info']); |
|
| 162 | + $bar->add(['Button', 'icon' => 'history']); |
|
| 163 | + $bar->add(['Button', 'icon' => 'copy']); |
|
| 164 | + $bar->add(['Button', 'icon' => 'eye']); |
|
| 165 | 165 | |
| 166 | - $f = $epesi->add(['Form'/* , 'buttonSave' => false */]);//->setAttr(['method' => 'POST', 'action' => '/test']); |
|
| 166 | + $f = $epesi->add(['Form'/* , 'buttonSave' => false */]);//->setAttr(['method' => 'POST', 'action' => '/test']); |
|
| 167 | 167 | |
| 168 | - $sub_layout = $f->layout->addSubLayout('Generic', false); |
|
| 169 | - $cols_layout = $sub_layout->addSubLayout('Columns'); |
|
| 170 | - $c1 = $cols_layout->addColumn(); |
|
| 171 | - $c1->addField('text_crlf', [new \atk4\ui\FormField\Input()])->set($f->id); |
|
| 172 | - $c1->addField('text_cr', [new \atk4\ui\FormField\Input()])->set("First line Second line"); |
|
| 173 | - $c1->addField('text_lf', [new \atk4\ui\FormField\Input()])->set("First line Second line"); |
|
| 174 | - |
|
| 175 | - $c2 = $cols_layout->addColumn(); |
|
| 168 | + $sub_layout = $f->layout->addSubLayout('Generic', false); |
|
| 169 | + $cols_layout = $sub_layout->addSubLayout('Columns'); |
|
| 170 | + $c1 = $cols_layout->addColumn(); |
|
| 171 | + $c1->addField('text_crlf', [new \atk4\ui\FormField\Input()])->set($f->id); |
|
| 172 | + $c1->addField('text_cr', [new \atk4\ui\FormField\Input()])->set("First line Second line"); |
|
| 173 | + $c1->addField('text_lf', [new \atk4\ui\FormField\Input()])->set("First line Second line"); |
|
| 174 | + |
|
| 175 | + $c2 = $cols_layout->addColumn(); |
|
| 176 | 176 | |
| 177 | 177 | // $g = $f->addGroup('Without model'); |
| 178 | 178 | |
| 179 | 179 | // $g = $f->addGroup('With model'); |
| 180 | - $c2->addField('m_text_crlf', [new \atk4\ui\FormField\DropDown()])->set("First line\r\nSecond line"); |
|
| 181 | - $c2->addField('m_text_cr', [new \atk4\ui\FormField\Input()])->set("First line\rSecond line"); |
|
| 182 | - $c2->addField('m_text_lf', [new \atk4\ui\FormField\Input()])->set("First line\nSecond line"); |
|
| 180 | + $c2->addField('m_text_crlf', [new \atk4\ui\FormField\DropDown()])->set("First line\r\nSecond line"); |
|
| 181 | + $c2->addField('m_text_cr', [new \atk4\ui\FormField\Input()])->set("First line\rSecond line"); |
|
| 182 | + $c2->addField('m_text_lf', [new \atk4\ui\FormField\Input()])->set("First line\nSecond line"); |
|
| 183 | 183 | |
| 184 | 184 | // $epesi->add(['Button', 'icon' => ['angle left', 'Back', ]]); |
| 185 | 185 | |
| 186 | - $tabs_layout = $f->layout->addSubLayout('Tabs'); |
|
| 186 | + $tabs_layout = $f->layout->addSubLayout('Tabs'); |
|
| 187 | 187 | |
| 188 | - $t1 = $tabs_layout->addTab([ 'Tab 1', 'icon' => 'time', 'label' => ['20', 'floating red']]);//new Label('20', 'floating red')]); |
|
| 188 | + $t1 = $tabs_layout->addTab([ 'Tab 1', 'icon' => 'time', 'label' => ['20', 'floating red']]);//new Label('20', 'floating red')]); |
|
| 189 | 189 | |
| 190 | - $cols_layout = $t1->addSubLayout('Columns'); |
|
| 191 | - $c1 = $cols_layout->addColumn(); |
|
| 192 | - $c1->addField('m_text_crlf2', [new \atk4\ui\FormField\Input()], ['caption' => 'Test'])->set("First line\r\nSecond line"); |
|
| 193 | - $c1->addField('m_text_cr2', [new \atk4\ui\FormField\Input()])->set("First line\rSecond line"); |
|
| 194 | - $c1->addField('m_text_lf2', [new \atk4\ui\FormField\Input()])->set("First line\nSecond line"); |
|
| 195 | - $c2 = $cols_layout->addColumn(); |
|
| 196 | - $c2->addField('m_text_crlf5', [new \atk4\ui\FormField\Input()])->set("First line\r\nSecond line"); |
|
| 197 | - $c2->addField('m_text_cr5', [new \atk4\ui\FormField\Input()])->set("First line\rSecond line"); |
|
| 198 | - $c2->addField('m_text_lf5', [new \atk4\ui\FormField\Input()])->set("First line\nSecond line"); |
|
| 199 | - $t2 = $cols_layout->addColumn(); |
|
| 200 | - $t2->addField('m_text_crlf3', [new \atk4\ui\FormField\Input()])->set("First line\r\nSecond line"); |
|
| 201 | - $t2->addField('m_text_cr3', [new \atk4\ui\FormField\Input()])->set("First line\rSecond line"); |
|
| 202 | - $t2->addField('m_text_lf3', [new \atk4\ui\FormField\Input()])->set("First line\nSecond line"); |
|
| 203 | - |
|
| 204 | - $a = $t1->addSubLayout('Accordion'); |
|
| 205 | - $a1 = $a->addSection('Static Tab'); |
|
| 206 | - $a1->addField('m_text_crlf8', [new \atk4\ui\FormField\Input()])->set("First line\r\nSecond line"); |
|
| 207 | - $a1->addField('m_text_cr8', [new \atk4\ui\FormField\Input()])->set("First line\rSecond line"); |
|
| 208 | - $a1->addField('m_text_lf8', [new \atk4\ui\FormField\Input()])->set("First line\nSecond line"); |
|
| 209 | - |
|
| 210 | - $t3 = $tabs_layout->addTab('Tab 3'); |
|
| 211 | - $t3->add(['Message', 'Content of this tab will refresh only if you reload entire page']); |
|
| 212 | - $t3->add('LoremIpsum'); |
|
| 213 | - |
|
| 214 | - $f->onSubmit(function ($form) { |
|
| 215 | - return [ |
|
| 216 | - new \atk4\ui\jsNotify([ |
|
| 217 | - 'duration' => 2000, |
|
| 218 | - 'content' => 'Thank you!' |
|
| 219 | - ]), |
|
| 190 | + $cols_layout = $t1->addSubLayout('Columns'); |
|
| 191 | + $c1 = $cols_layout->addColumn(); |
|
| 192 | + $c1->addField('m_text_crlf2', [new \atk4\ui\FormField\Input()], ['caption' => 'Test'])->set("First line\r\nSecond line"); |
|
| 193 | + $c1->addField('m_text_cr2', [new \atk4\ui\FormField\Input()])->set("First line\rSecond line"); |
|
| 194 | + $c1->addField('m_text_lf2', [new \atk4\ui\FormField\Input()])->set("First line\nSecond line"); |
|
| 195 | + $c2 = $cols_layout->addColumn(); |
|
| 196 | + $c2->addField('m_text_crlf5', [new \atk4\ui\FormField\Input()])->set("First line\r\nSecond line"); |
|
| 197 | + $c2->addField('m_text_cr5', [new \atk4\ui\FormField\Input()])->set("First line\rSecond line"); |
|
| 198 | + $c2->addField('m_text_lf5', [new \atk4\ui\FormField\Input()])->set("First line\nSecond line"); |
|
| 199 | + $t2 = $cols_layout->addColumn(); |
|
| 200 | + $t2->addField('m_text_crlf3', [new \atk4\ui\FormField\Input()])->set("First line\r\nSecond line"); |
|
| 201 | + $t2->addField('m_text_cr3', [new \atk4\ui\FormField\Input()])->set("First line\rSecond line"); |
|
| 202 | + $t2->addField('m_text_lf3', [new \atk4\ui\FormField\Input()])->set("First line\nSecond line"); |
|
| 203 | + |
|
| 204 | + $a = $t1->addSubLayout('Accordion'); |
|
| 205 | + $a1 = $a->addSection('Static Tab'); |
|
| 206 | + $a1->addField('m_text_crlf8', [new \atk4\ui\FormField\Input()])->set("First line\r\nSecond line"); |
|
| 207 | + $a1->addField('m_text_cr8', [new \atk4\ui\FormField\Input()])->set("First line\rSecond line"); |
|
| 208 | + $a1->addField('m_text_lf8', [new \atk4\ui\FormField\Input()])->set("First line\nSecond line"); |
|
| 209 | + |
|
| 210 | + $t3 = $tabs_layout->addTab('Tab 3'); |
|
| 211 | + $t3->add(['Message', 'Content of this tab will refresh only if you reload entire page']); |
|
| 212 | + $t3->add('LoremIpsum'); |
|
| 213 | + |
|
| 214 | + $f->onSubmit(function ($form) { |
|
| 215 | + return [ |
|
| 216 | + new \atk4\ui\jsNotify([ |
|
| 217 | + 'duration' => 2000, |
|
| 218 | + 'content' => 'Thank you!' |
|
| 219 | + ]), |
|
| 220 | 220 | // 'm_text_crlf5' => 'error', |
| 221 | 221 | // 'm_text_crlf3' => 'error message', |
| 222 | - ]; |
|
| 222 | + ]; |
|
| 223 | 223 | |
| 224 | - // check what values are submitted |
|
| 225 | - echo "We're URL encoding submitted values to be able to see what line end is actually submitted."; |
|
| 224 | + // check what values are submitted |
|
| 225 | + echo "We're URL encoding submitted values to be able to see what line end is actually submitted."; |
|
| 226 | 226 | // foreach ($form->model->get() as $k=>$v) { |
| 227 | 227 | // var_dump([$k => urlencode($v)]); |
| 228 | 228 | // } |
| 229 | - echo 'As you can see - without model it submits CRLF, but with model it will normalize all to LF'; |
|
| 230 | - }); |
|
| 229 | + echo 'As you can see - without model it submits CRLF, but with model it will normalize all to LF'; |
|
| 230 | + }); |
|
| 231 | 231 | |
| 232 | 232 | |
| 233 | 233 | |
| 234 | - return $epesi->response(); |
|
| 234 | + return $epesi->response(); |
|
| 235 | 235 | |
| 236 | 236 | |
| 237 | 237 | |
@@ -253,5 +253,5 @@ discard block |
||
| 253 | 253 | // $column->append(Dashboard::dependencies()); |
| 254 | 254 | // }); |
| 255 | 255 | // }); |
| 256 | - } |
|
| 256 | + } |
|
| 257 | 257 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $form->addElements($applet->settings()); |
| 58 | 58 | |
| 59 | 59 | // form on submit |
| 60 | - $form->onSubmit(function ($f) { |
|
| 60 | + $form->onSubmit(function($f) { |
|
| 61 | 61 | dd('test'); |
| 62 | 62 | return $f->success( |
| 63 | 63 | 'Record Added', |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $bar->add(['Button', 'icon' => 'copy']); |
| 164 | 164 | $bar->add(['Button', 'icon' => 'eye']); |
| 165 | 165 | |
| 166 | - $f = $epesi->add(['Form'/* , 'buttonSave' => false */]);//->setAttr(['method' => 'POST', 'action' => '/test']); |
|
| 166 | + $f = $epesi->add(['Form'/* , 'buttonSave' => false */]); //->setAttr(['method' => 'POST', 'action' => '/test']); |
|
| 167 | 167 | |
| 168 | 168 | $sub_layout = $f->layout->addSubLayout('Generic', false); |
| 169 | 169 | $cols_layout = $sub_layout->addSubLayout('Columns'); |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | $tabs_layout = $f->layout->addSubLayout('Tabs'); |
| 187 | 187 | |
| 188 | - $t1 = $tabs_layout->addTab([ 'Tab 1', 'icon' => 'time', 'label' => ['20', 'floating red']]);//new Label('20', 'floating red')]); |
|
| 188 | + $t1 = $tabs_layout->addTab(['Tab 1', 'icon' => 'time', 'label' => ['20', 'floating red']]); //new Label('20', 'floating red')]); |
|
| 189 | 189 | |
| 190 | 190 | $cols_layout = $t1->addSubLayout('Columns'); |
| 191 | 191 | $c1 = $cols_layout->addColumn(); |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $t3->add(['Message', 'Content of this tab will refresh only if you reload entire page']); |
| 212 | 212 | $t3->add('LoremIpsum'); |
| 213 | 213 | |
| 214 | - $f->onSubmit(function ($form) { |
|
| 214 | + $f->onSubmit(function($form) { |
|
| 215 | 215 | return [ |
| 216 | 216 | new \atk4\ui\jsNotify([ |
| 217 | 217 | 'duration' => 2000, |
@@ -22,11 +22,11 @@ |
||
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | return [ |
| 25 | - __('DASHBOARD') => count($ret) > 1? [ |
|
| 25 | + __('DASHBOARD') => count($ret) > 1 ? [ |
|
| 26 | 26 | 'access' => true, |
| 27 | 27 | 'group' => $ret, |
| 28 | 28 | 'weight' => -10000 |
| 29 | - ]: array_merge(reset($ret), ['weight' => -10000]), |
|
| 29 | + ] : array_merge(reset($ret), ['weight' => -10000]), |
|
| 30 | 30 | ]; |
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | \ No newline at end of file |