PluginProbe ʕ •ᴥ•ʔ
Admin Columns / 4.7.7
Admin Columns v4.7.7
7.0.19 2.3.5 2.4 2.4.1 2.4.10 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.6.1 2.5.6.2 2.5.6.3 2.5.6.4 3.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.7 3.1 3.1.1 3.1.10 3.1.2 3.1.3 3.1.5 3.2.3 3.2.7 3.3.1 3.4.1 3.4.6 3.4.8 4.0.1 4.0.3 4.1.6 4.2.2 4.2.5 4.3 4.3.2 4.4.1 4.4.4 4.4.5 4.5.5 4.6.1 4.7.18 4.7.19 4.7.20 4.7.7 7.0.13 7.0.14 7.0.16 trunk 1.0 1.1 1.1.3 1.2 1.2.1 1.3 1.3.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.5.1 1.4.6 1.4.6.1 1.4.6.2 1.4.6.3 1.4.6.4 1.4.7 1.4.8 1.4.9 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2 2.2.1 2.2.1.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.5.1 2.2.6 2.2.6.1 2.2.6.2 2.2.6.3 2.2.6.4 2.2.7 2.2.8 2.2.8.1 2.2.9 2.3.1 2.3.2 2.3.3
codepress-admin-columns / classes / Controller / TableListScreenSetter.php
codepress-admin-columns / classes / Controller Last commit date
ColumnRequest 2 years ago ListScreen 2 years ago Middleware 2 years ago AjaxColumnModalValue.php 2 years ago AjaxColumnRequest.php 2 years ago AjaxColumnValue.php 2 years ago AjaxGeneralOptions.php 2 years ago AjaxRequestCustomFieldKeys.php 2 years ago AjaxScreenOptions.php 2 years ago ColumnRequest.php 2 years ago DefaultColumns.php 2 years ago ListScreenRestoreColumns.php 2 years ago RestoreSettingsRequest.php 2 years ago TableListScreenSetter.php 2 years ago
TableListScreenSetter.php
88 lines
1 <?php
2
3 namespace AC\Controller;
4
5 use AC\Asset\Location\Absolute;
6 use AC\ColumnSize;
7 use AC\ListScreen;
8 use AC\ListScreenFactory;
9 use AC\ListScreenRepository\Storage;
10 use AC\Registerable;
11 use AC\Request;
12 use AC\Settings\General\EditButton;
13 use AC\Table;
14 use WP_Screen;
15
16 class TableListScreenSetter implements Registerable
17 {
18
19 private $storage;
20
21 private $location;
22
23 private $list_screen_factory;
24
25 private $preference;
26
27 private $primary_column_factory;
28
29 private $edit_button;
30
31 public function __construct(
32 Storage $storage,
33 Absolute $location,
34 ListScreenFactory $list_screen_factory,
35 Table\LayoutPreference $preference,
36 Table\PrimaryColumnFactory $primary_column_factory,
37 EditButton $edit_button
38 ) {
39 $this->storage = $storage;
40 $this->list_screen_factory = $list_screen_factory;
41 $this->location = $location;
42 $this->preference = $preference;
43 $this->primary_column_factory = $primary_column_factory;
44 $this->edit_button = $edit_button;
45 }
46
47 public function register(): void
48 {
49 add_action('current_screen', [$this, 'handle']);
50 }
51
52 public function handle(WP_Screen $wp_screen): void
53 {
54 $request = new Request();
55
56 $request->add_middleware(
57 new Middleware\ListScreenTable(
58 $this->storage,
59 $this->list_screen_factory,
60 $wp_screen,
61 $this->preference
62 )
63 );
64
65 $list_screen = $request->get('list_screen');
66
67 if ( ! $list_screen instanceof ListScreen) {
68 return;
69 }
70
71 if ($list_screen->has_id()) {
72 $this->preference->set($list_screen->get_key(), (string)$list_screen->get_id());
73 }
74
75 $table_screen = new Table\Screen(
76 $this->location,
77 $list_screen,
78 new ColumnSize\ListStorage($this->storage),
79 new ColumnSize\UserStorage(new ColumnSize\UserPreference()),
80 $this->primary_column_factory,
81 $this->edit_button
82 );
83 $table_screen->register();
84
85 do_action('ac/table', $table_screen);
86 }
87
88 }