PluginProbe ʕ •ᴥ•ʔ
Admin Columns / 7.1.4
Admin Columns v7.1.4
7.1.4 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 / Service / CurrentTable.php
codepress-admin-columns / classes / Service Last commit date
AdminBar.php 1 day ago AdminBarEditColumns.php 1 day ago Colors.php 1 day ago CommonAssets.php 1 day ago CurrentTable.php 1 day ago ManageHeadings.php 1 day ago ManageValue.php 1 day ago NoticeChecks.php 1 day ago PluginUpdate.php 1 day ago PromoChecks.php 1 day ago QuickEdit.php 1 day ago SaveHeadings.php 1 day ago Setup.php 1 day ago TableRows.php 1 day ago Tooltips.php 1 day ago View.php 1 day ago
CurrentTable.php
116 lines
1 <?php
2
3 declare(strict_types=1);
4
5 namespace AC\Service;
6
7 use AC\AdminColumns;
8 use AC\ListScreen;
9 use AC\ListScreenRepository\Storage;
10 use AC\Registerable;
11 use AC\Request;
12 use AC\Settings\GeneralOption;
13 use AC\Table;
14 use AC\TableScreenFactory;
15 use WP_Screen;
16
17 class CurrentTable implements Registerable
18 {
19 private Storage $storage;
20
21 private Table\TablePreference $preference;
22
23 private Table\PrimaryColumnFactory $primary_column_factory;
24
25 private TableScreenFactory $table_screen_factory;
26
27 private Table\InlineStyle\ColumnSize $column_size;
28
29 private AdminColumns $plugin;
30
31 private GeneralOption $option_storage;
32
33 public function __construct(
34 Storage $storage,
35 AdminColumns $plugin,
36 TableScreenFactory $table_screen_factory,
37 Table\TablePreference $preference,
38 Table\PrimaryColumnFactory $primary_column_factory,
39 Table\InlineStyle\ColumnSize $column_size,
40 GeneralOption $option_storage
41 ) {
42 $this->storage = $storage;
43 $this->preference = $preference;
44 $this->primary_column_factory = $primary_column_factory;
45 $this->table_screen_factory = $table_screen_factory;
46 $this->column_size = $column_size;
47 $this->plugin = $plugin;
48 $this->option_storage = $option_storage;
49 }
50
51 public function register(): void
52 {
53 add_action('current_screen', [$this, 'handle']);
54 }
55
56 public function handle(WP_Screen $wp_screen): void
57 {
58 $user = wp_get_current_user();
59
60 if (! $user) {
61 return;
62 }
63
64 if (! $this->table_screen_factory->can_create_from_wp_screen($wp_screen)) {
65 return;
66 }
67
68 $table_screen = $this->table_screen_factory->create_from_wp_screen($wp_screen);
69
70 $request = new Request();
71
72 $request->add_middleware(
73 new Request\Middleware\ListScreenTable(
74 $this->storage,
75 $table_screen->get_id(),
76 $this->preference,
77 $user
78 )
79 );
80
81 do_action('ac/table/request', $request, $table_screen);
82
83 $list_screen = $request->get('list_screen');
84
85 do_action('ac/table/screen', $table_screen, $list_screen);
86
87 if ($list_screen instanceof ListScreen) {
88 $this->preference->save(
89 $table_screen->get_id(),
90 $list_screen->get_id()
91 );
92
93 $list = new Table\Service\ListScreen(
94 $list_screen,
95 $this->primary_column_factory,
96 $this->column_size
97 );
98 $list->register();
99
100 do_action('ac/table/list_screen', $list_screen, $table_screen);
101 }
102
103 $table = new Table\Screen(
104 $this->plugin,
105 $table_screen,
106 $this->option_storage,
107 $list_screen
108 );
109
110 do_action('ac/table', $table);
111
112 $table->register();
113 }
114
115 }
116