HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/zaklada/wp-content/plugins/wpml-translation-management/classes/ATE/Log/View.php
<?php

namespace WPML\TM\ATE\Log;

use WPML\Collect\Support\Collection;

class View {

	/** @var Collection $logs */
	private $logs;

	public function __construct( Collection $logs ) {
		$this->logs = $logs;
	}

	public function renderSupportSection() {
		?>
		<div class="wrap">
			<h2 id="ate-log">
				<?php esc_html_e( 'Advanced Translation Editor', 'wpml-translation-management' ); ?>
			</h2>
			<p>
				<a href="<?php echo admin_url( 'admin.php?page=' . Hooks::SUBMENU_HANDLE ); ?>">
					<?php echo sprintf( esc_html__( 'Error Logs (%d)', 'wpml-translation-management' ), $this->logs->count() ); ?>
				</a>
			</p>
		</div>
		<?php
	}

	public function renderPage() {
		?>
		<div class="wrap">
			<h1><?php esc_html_e( 'Advanced Translation Editor Error Logs', 'wpml-translation-management' ); ?></h1>
			<br>
			<table class="wp-list-table widefat fixed striped posts">
				<thead><?php $this->renderTableHeader(); ?></thead>

				<tbody id="the-list">
				<?php
					if ( $this->logs->isEmpty() ) {
						$this->renderEmptyTable();
					} else {
						$this->logs->each( [ $this, 'renderTableRow' ] );
					}
				?>
				</tbody>
				<tfoot><?php $this->renderTableHeader(); ?></tfoot>
			</table>
		</div>
		<?php
	}

	private function renderTableHeader() {
		?>
		<tr>
			<th class="date">
				<span><?php esc_html_e( 'Date', 'wpml-translation-management' ); ?></span>
			</th>
			<th class="event">
				<span><?php esc_html_e( 'Event', 'wpml-translation-management' ); ?></span>
			</th>
			<th class="description">
				<span><?php esc_html_e( 'Description', 'wpml-translation-management' ); ?></span>
			</th>
			<th class="wpml-job-id">
				<span><?php esc_html_e( 'WPML Job ID', 'wpml-translation-management' ); ?></span>
			</th>
			<th class="ate-job-id">
				<span><?php esc_html_e( 'ATE Job ID', 'wpml-translation-management' ); ?></span>
			</th>
			<th class="extra-data">
				<span><?php esc_html_e( 'Extra data', 'wpml-translation-management' ); ?></span>
			</th>
		</tr>
		<?php
	}

	public function renderTableRow( Entry $entry ) {
		?>
		<tr>
			<td class="date">
				<?php echo esc_html( $entry->getFormattedDate() ); ?>
			</td>
			<td class="event">
				<?php echo esc_html( $entry->getEventLabel() ); ?>
			</td>
			<td class="description">
				<?php echo esc_html( $entry->description ); ?>
			</td>
			<td class="wpml-job-id">
				<?php echo esc_html( $entry->wpmlJobId ); ?>
			</td>
			<td class="ate-job-id">
				<?php echo esc_html( $entry->ateJobId ); ?>
			</td>
			<td class="extra-data">
				<?php echo esc_html( $entry->getExtraDataToString() ); ?>
			</td>
		</tr>
		<?php
	}

	private function renderEmptyTable() {
		?>
		<tr>
			<td colspan="6" class="title column-title has-row-actions column-primary">
				<?php esc_html_e( 'No entries', 'wpml-translation-management' ); ?>
			</td>
		</tr>
		<?php
	}
}