Comment
2 days ago
Media
2 days ago
Post
2 days ago
User
2 days ago
ActionsFactory.php
2 days ago
CustomFieldFactory.php
2 days ago
IntegrationPlaceholder.php
2 days ago
OriginalFactory.php
2 days ago
ActionsFactory.php
45 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\ColumnFactory; |
| 6 | |
| 7 | use AC; |
| 8 | use AC\Column\BaseColumnFactory; |
| 9 | use AC\Formatter\Message; |
| 10 | use AC\FormatterCollection; |
| 11 | use AC\Setting\ComponentFactory; |
| 12 | use AC\Setting\Config; |
| 13 | |
| 14 | class ActionsFactory extends BaseColumnFactory |
| 15 | { |
| 16 | public function get_label(): string |
| 17 | { |
| 18 | return __('Actions', 'codepress-admin-columns'); |
| 19 | } |
| 20 | |
| 21 | public function get_column_type(): string |
| 22 | { |
| 23 | return 'column-actions'; |
| 24 | } |
| 25 | |
| 26 | protected function get_settings(Config $config): AC\Setting\ComponentCollection |
| 27 | { |
| 28 | return new AC\Setting\ComponentCollection([ |
| 29 | (new ComponentFactory\ActionIcons())->create($config), |
| 30 | ]); |
| 31 | } |
| 32 | |
| 33 | protected function get_formatters(Config $config): FormatterCollection |
| 34 | { |
| 35 | $formatters = parent::get_formatters($config); |
| 36 | |
| 37 | if ($config->get('use_icons', 'off') === 'on') { |
| 38 | return $formatters->add(new Message('<span class="cpac_use_icons"></span>')); |
| 39 | } |
| 40 | |
| 41 | return $formatters; |
| 42 | } |
| 43 | |
| 44 | } |
| 45 |