Comment
3 months ago
Media
3 months ago
Post
3 months ago
User
3 months ago
ActionsFactory.php
3 months ago
CustomFieldFactory.php
3 months ago
IntegrationPlaceholder.php
3 months ago
OriginalFactory.php
3 months 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 | |
| 17 | public function get_label(): string |
| 18 | { |
| 19 | return __('Actions', 'codepress-admin-columns'); |
| 20 | } |
| 21 | |
| 22 | public function get_column_type(): string |
| 23 | { |
| 24 | return 'column-actions'; |
| 25 | } |
| 26 | |
| 27 | protected function get_settings(Config $config): AC\Setting\ComponentCollection |
| 28 | { |
| 29 | return new AC\Setting\ComponentCollection([ |
| 30 | (new ComponentFactory\ActionIcons())->create($config), |
| 31 | ]); |
| 32 | } |
| 33 | |
| 34 | protected function get_formatters(Config $config): FormatterCollection |
| 35 | { |
| 36 | $formatters = parent::get_formatters($config); |
| 37 | |
| 38 | if ($config->get('use_icons', 'off') === 'on') { |
| 39 | return $formatters->add(new Message('<span class="cpac_use_icons"></span>')); |
| 40 | } |
| 41 | |
| 42 | return $formatters; |
| 43 | } |
| 44 | |
| 45 | } |