HEX
Server: nginx/1.18.0
System: Linux iZj6c1ieg2jrpk1z5tzi19Z 6.3.9-1.el7.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 21 22:18:40 EDT 2023 x86_64
User: www (1001)
PHP: 8.2.4
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.cytocare.cn/wp-content/plugins/wp-mail-logging/src/Renderer/WPML_ColumnManager.php
<?php

namespace No3x\WPML\Renderer;

use No3x\WPML\Renderer\Column\ActionsColumn;
use No3x\WPML\Renderer\Column\AttachmentsColumn;
use No3x\WPML\Renderer\Column\ErrorColumn;
use No3x\WPML\Renderer\Column\GenericColumn;
use No3x\WPML\Renderer\Column\IColumn;
use No3x\WPML\Renderer\Column\SubjectColumn;
use No3x\WPML\Renderer\Column\TimestampColumn;

class WPML_ColumnManager {

    const COLUMN_MAIL_ID        = 'mail_id';
    const COLUMN_TIMESTAMP		= 'timestamp';
    const COLUMN_HOST           = 'host';
    const COLUMN_RECEIVER		= 'receiver';
    const COLUMN_SUBJECT		= 'subject';
    const COLUMN_MESSAGE		= 'message';
    const COLUMN_HEADERS		= 'headers';
    const COLUMN_ATTACHMENTS	= 'attachments';
    const COLUMN_ERROR		    = 'error';
    const COLUMN_PLUGIN_VERSION = 'plugin_version';

    private $columns;

    /**
     * WPML_ColumnRenderer constructor.
     */
    public function __construct() {

    }

    /**
     * Setup the columns.
     *
     * @since 1.14.0
     */
    private function setupColumns() {

        $this->columns = [
            self::COLUMN_MAIL_ID     => __( 'ID', 'wp-mail-logging' ),
            self::COLUMN_TIMESTAMP   => __( 'Time', 'wp-mail-logging' ),
            self::COLUMN_HOST        => __( 'Host', 'wp-mail-logging' ),
            self::COLUMN_RECEIVER    => __( 'Receiver', 'wp-mail-logging' ),
            self::COLUMN_SUBJECT     => __( 'Subject', 'wp-mail-logging' ),
            self::COLUMN_ATTACHMENTS => __( 'Attachments', 'wp-mail-logging' ),
            self::COLUMN_ERROR       => __( 'Error', 'wp-mail-logging' ),
        ];
    }

    /**
     * @param $column_name
     * @return IColumn
     */
    public function getColumnRenderer($column_name) {
        switch ($column_name) {
            case self::COLUMN_TIMESTAMP:
                return new TimestampColumn();
            case self::COLUMN_ATTACHMENTS:
                return new AttachmentsColumn();
            case self::COLUMN_ERROR:
                return new ErrorColumn();
            case self::COLUMN_SUBJECT:
                return new SubjectColumn();
            default:
                return new GenericColumn($column_name);
        }
    }

    public function getColumns() {

        if ( empty( $this->columns ) ) {
            $this->setupColumns();
        }

        return $this->columns;
    }

    public function getColumnNames() {
        return array_keys($this->columns);
    }

    public function getTranslationForColumn($column_name) {
        return $this->getColumns()[$column_name];
    }
}