Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Mar 6, 2024
1 parent d4558fe commit cab116a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion demos/form-control/multiline-crud.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

namespace Atk4\Ui\Demos;

/** @var \Atk4\Ui\App $app */
use Atk4\Ui\App;

/** @var App $app */
require_once __DIR__ . '/../init-app.php';

// TODO
8 changes: 4 additions & 4 deletions mastercrud-develop/src/MasterCRUD.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public function initTabs(array $defs, View $view = null)
// $sub_crud->addDecorator($m->title_field, [Table\Column\Link::class, [$t => false, 'path' => $this->getPath($ref)], [$m->table . '_id' => 'id']]);

// Creating url template in order to produce proper url.
$sub_crud->addDecorator($m->title_field, [Table\Column\Link::class, 'url' => $this->getApp()->url(['path' => $this->getPath($ref)]) . '&' . $m->table . '_id=' . '{$id}']);
$sub_crud->addDecorator($m->title_field, [Table\Column\Link::class, 'url' => $this->getApp()->url(['path' => $this->getPath($ref)]) . '&' . $m->table . '_id={$id}']);
}

$this->addActions($sub_crud, $subdef);
Expand Down Expand Up @@ -266,7 +266,7 @@ public function addActions(View $crud, array $defs)
if (is_string($action)) {
$crud->menu->addItem($key)->on(
'click',
new JsModal('Executing ' . $key, $this->add([VirtualPage::class])->set(function ($p) use ($key, $crud) {
new JsModal('Executing ' . $key, $this->add([VirtualPage::class])->set(static function ($p) use ($key, $crud) {
// TODO: this does ont work within a tab :(
$p->add(new MethodExecutor($crud->model, $key));
}))
Expand Down Expand Up @@ -304,11 +304,11 @@ public function addActions(View $crud, array $defs)
}

if (isset($action[0]) && $action[0] instanceof \Closure) {
$crud->addModalAction($label ?: $key, $key, function ($p, $id) use ($action, $crud) {
$crud->addModalAction($label ?: $key, $key, static function ($p, $id) use ($action, $crud) {
call_user_func($action[0], $p, $crud->model->load($id));
});
} else {
$crud->addModalAction($label ?: $key, $key, function ($p, $id) use ($action, $key, $crud) {
$crud->addModalAction($label ?: $key, $key, static function ($p, $id) use ($action, $key, $crud) {
$p->add(new MethodExecutor($crud->model->load($id), $key, $action));
});
}
Expand Down
2 changes: 1 addition & 1 deletion mastercrud-develop/src/MethodExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function init(): void
{
parent::init();

$this->console = $this->add([Console::class, 'event' => false]); //->addStyle('display', 'none');
$this->console = $this->add([Console::class, 'event' => false]); // ->addStyle('display', 'none');
$this->console->addStyle('max-height', '50em')->addStyle('overflow', 'scroll');

$this->form = $this->add([Form::class]);
Expand Down

0 comments on commit cab116a

Please sign in to comment.