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