@@ -6,27 +6,27 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreatePasswordResetsTable extends Migration |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the migrations. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function up() |
|
| 15 | - { |
|
| 16 | - Schema::create('password_resets', function (Blueprint $table) { |
|
| 17 | - $table->string('email')->index(); |
|
| 18 | - $table->string('token'); |
|
| 19 | - $table->timestamp('created_at')->nullable(); |
|
| 20 | - }); |
|
| 21 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the migrations. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function up() |
|
| 15 | + { |
|
| 16 | + Schema::create('password_resets', function (Blueprint $table) { |
|
| 17 | + $table->string('email')->index(); |
|
| 18 | + $table->string('token'); |
|
| 19 | + $table->timestamp('created_at')->nullable(); |
|
| 20 | + }); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Reverse the migrations. |
|
| 25 | - * |
|
| 26 | - * @return void |
|
| 27 | - */ |
|
| 28 | - public function down() |
|
| 29 | - { |
|
| 30 | - Schema::dropIfExists('password_resets'); |
|
| 31 | - } |
|
| 23 | + /** |
|
| 24 | + * Reverse the migrations. |
|
| 25 | + * |
|
| 26 | + * @return void |
|
| 27 | + */ |
|
| 28 | + public function down() |
|
| 29 | + { |
|
| 30 | + Schema::dropIfExists('password_resets'); |
|
| 31 | + } |
|
| 32 | 32 | } |
@@ -6,31 +6,31 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreateUsersTable extends Migration |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the migrations. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function up() |
|
| 15 | - { |
|
| 16 | - Schema::create('users', function (Blueprint $table) { |
|
| 17 | - $table->bigIncrements('id'); |
|
| 18 | - $table->string('name'); |
|
| 19 | - $table->string('email')->unique(); |
|
| 20 | - $table->timestamp('email_verified_at')->nullable(); |
|
| 21 | - $table->string('password'); |
|
| 22 | - $table->rememberToken(); |
|
| 23 | - $table->timestamps(); |
|
| 24 | - }); |
|
| 25 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the migrations. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function up() |
|
| 15 | + { |
|
| 16 | + Schema::create('users', function (Blueprint $table) { |
|
| 17 | + $table->bigIncrements('id'); |
|
| 18 | + $table->string('name'); |
|
| 19 | + $table->string('email')->unique(); |
|
| 20 | + $table->timestamp('email_verified_at')->nullable(); |
|
| 21 | + $table->string('password'); |
|
| 22 | + $table->rememberToken(); |
|
| 23 | + $table->timestamps(); |
|
| 24 | + }); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Reverse the migrations. |
|
| 29 | - * |
|
| 30 | - * @return void |
|
| 31 | - */ |
|
| 32 | - public function down() |
|
| 33 | - { |
|
| 34 | - Schema::dropIfExists('users'); |
|
| 35 | - } |
|
| 27 | + /** |
|
| 28 | + * Reverse the migrations. |
|
| 29 | + * |
|
| 30 | + * @return void |
|
| 31 | + */ |
|
| 32 | + public function down() |
|
| 33 | + { |
|
| 34 | + Schema::dropIfExists('users'); |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -7,14 +7,14 @@ |
||
| 7 | 7 | |
| 8 | 8 | class UserAccessServiceProvider extends ServiceProvider |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * Booting the package. |
|
| 12 | - */ |
|
| 13 | - public function boot() |
|
| 14 | - { |
|
| 15 | - // allow Super Admin full access |
|
| 16 | - Gate::after(function ($user, $ability) { |
|
| 17 | - return $user->hasRole('Super Admin'); |
|
| 18 | - }); |
|
| 19 | - } |
|
| 10 | + /** |
|
| 11 | + * Booting the package. |
|
| 12 | + */ |
|
| 13 | + public function boot() |
|
| 14 | + { |
|
| 15 | + // allow Super Admin full access |
|
| 16 | + Gate::after(function ($user, $ability) { |
|
| 17 | + return $user->hasRole('Super Admin'); |
|
| 18 | + }); |
|
| 19 | + } |
|
| 20 | 20 | } |
@@ -6,31 +6,31 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreateUserSettingsTable extends Migration |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the migrations. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function up() |
|
| 15 | - { |
|
| 16 | - $this->down(); |
|
| 9 | + /** |
|
| 10 | + * Run the migrations. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function up() |
|
| 15 | + { |
|
| 16 | + $this->down(); |
|
| 17 | 17 | |
| 18 | - Schema::create('user_settings', function (Blueprint $table) { |
|
| 19 | - $table->increments('id'); |
|
| 20 | - $table->unsignedInteger('user_id'); |
|
| 21 | - $table->string('group', 512); |
|
| 22 | - $table->string('name', 128); |
|
| 23 | - $table->text('value'); |
|
| 24 | - }); |
|
| 25 | - } |
|
| 18 | + Schema::create('user_settings', function (Blueprint $table) { |
|
| 19 | + $table->increments('id'); |
|
| 20 | + $table->unsignedInteger('user_id'); |
|
| 21 | + $table->string('group', 512); |
|
| 22 | + $table->string('name', 128); |
|
| 23 | + $table->text('value'); |
|
| 24 | + }); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Reverse the migrations. |
|
| 29 | - * |
|
| 30 | - * @return void |
|
| 31 | - */ |
|
| 32 | - public function down() |
|
| 33 | - { |
|
| 34 | - Schema::dropIfExists('user_settings'); |
|
| 35 | - } |
|
| 27 | + /** |
|
| 28 | + * Reverse the migrations. |
|
| 29 | + * |
|
| 30 | + * @return void |
|
| 31 | + */ |
|
| 32 | + public function down() |
|
| 33 | + { |
|
| 34 | + Schema::dropIfExists('user_settings'); |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -6,42 +6,42 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreateDashboardTables extends Migration |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the migrations. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function up() |
|
| 15 | - { |
|
| 16 | - $this->down(); |
|
| 9 | + /** |
|
| 10 | + * Run the migrations. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function up() |
|
| 15 | + { |
|
| 16 | + $this->down(); |
|
| 17 | 17 | |
| 18 | - Schema::create('dashboards', function (Blueprint $table) { |
|
| 19 | - $table->increments('id'); |
|
| 20 | - $table->unsignedInteger('user_id'); |
|
| 21 | - $table->string('name', 64); |
|
| 22 | - $table->smallInteger('position'); |
|
| 23 | - }); |
|
| 18 | + Schema::create('dashboards', function (Blueprint $table) { |
|
| 19 | + $table->increments('id'); |
|
| 20 | + $table->unsignedInteger('user_id'); |
|
| 21 | + $table->string('name', 64); |
|
| 22 | + $table->smallInteger('position'); |
|
| 23 | + }); |
|
| 24 | 24 | |
| 25 | - Schema::create('dashboard_applets', function (Blueprint $table) { |
|
| 26 | - $table->increments('id'); |
|
| 27 | - $table->unsignedInteger('dashboard_id'); |
|
| 28 | - $table->string('class', 512); |
|
| 29 | - $table->smallInteger('column'); |
|
| 30 | - $table->smallInteger('row'); |
|
| 31 | - $table->text('options'); |
|
| 25 | + Schema::create('dashboard_applets', function (Blueprint $table) { |
|
| 26 | + $table->increments('id'); |
|
| 27 | + $table->unsignedInteger('dashboard_id'); |
|
| 28 | + $table->string('class', 512); |
|
| 29 | + $table->smallInteger('column'); |
|
| 30 | + $table->smallInteger('row'); |
|
| 31 | + $table->text('options'); |
|
| 32 | 32 | |
| 33 | - $table->foreign('dashboard_id')->references('id')->on('dashboards'); |
|
| 34 | - }); |
|
| 35 | - } |
|
| 33 | + $table->foreign('dashboard_id')->references('id')->on('dashboards'); |
|
| 34 | + }); |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Reverse the migrations. |
|
| 39 | - * |
|
| 40 | - * @return void |
|
| 41 | - */ |
|
| 42 | - public function down() |
|
| 43 | - { |
|
| 44 | - Schema::dropIfExists('dashboard_applets'); |
|
| 45 | - Schema::dropIfExists('dashboards'); |
|
| 46 | - } |
|
| 37 | + /** |
|
| 38 | + * Reverse the migrations. |
|
| 39 | + * |
|
| 40 | + * @return void |
|
| 41 | + */ |
|
| 42 | + public function down() |
|
| 43 | + { |
|
| 44 | + Schema::dropIfExists('dashboard_applets'); |
|
| 45 | + Schema::dropIfExists('dashboards'); |
|
| 46 | + } |
|
| 47 | 47 | } |
@@ -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 | } |