action-event-column.php
2 years ago
actions-list-for-column.php
2 years ago
classes-column.php
2 years ago
error-data-column.php
2 years ago
error-message-column.php
2 years ago
error-place-column.php
2 years ago
exception-name-column.php
2 years ago
export-csv-column.php
2 years ago
field-name-column.php
2 years ago
field-type-column.php
2 years ago
field-value-column.php
2 years ago
form-action-column.php
2 years ago
form-action-status-column.php
2 years ago
form-link-column.php
2 years ago
header-actions-column.php
2 years ago
ip-address-column.php
2 years ago
primary-form-column.php
2 years ago
print-pdf-column.php
2 years ago
referrer-link-column.php
2 years ago
row-actions-column.php
2 years ago
status-column.php
2 years ago
user-agent-column.php
2 years ago
user-login-column.php
2 years ago
utils.php
2 years ago
status-column.php
36 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace JFB_Modules\Form_Record\Admin\View_Columns; |
| 5 | |
| 6 | use Jet_Form_Builder\Admin\Table_Views\Column_Advanced_Base; |
| 7 | use Jet_Form_Builder\Form_Messages\Status_Info; |
| 8 | |
| 9 | // If this file is called directly, abort. |
| 10 | if ( ! defined( 'WPINC' ) ) { |
| 11 | die; |
| 12 | } |
| 13 | |
| 14 | class Status_Column extends Column_Advanced_Base { |
| 15 | |
| 16 | protected $type = self::STATUS; |
| 17 | protected $column = 'status'; |
| 18 | |
| 19 | public function get_label(): string { |
| 20 | return __( 'Status', 'jet-form-builder' ); |
| 21 | } |
| 22 | |
| 23 | public function get_value( array $record = array() ) { |
| 24 | $status = parent::get_value( $record ); |
| 25 | $status = empty( $status ) ? 'failed' : $status; |
| 26 | |
| 27 | $info = new Status_Info( $status ); |
| 28 | |
| 29 | return array( |
| 30 | 'type' => $info->is_success() ? self::STATUS_SUCCESS : self::STATUS_FAILED, |
| 31 | 'text' => $info->get_message(), |
| 32 | ); |
| 33 | } |
| 34 | |
| 35 | } |
| 36 |