Tweaks to page rendering methods

This commit is contained in:
Corey McKrill 2023-10-24 17:02:18 -07:00
parent 591c728ac3
commit 21a995bb50
No known key found for this signature in database
GPG Key ID: 84BBFE669C4D97B8
1 changed files with 9 additions and 8 deletions

View File

@ -94,8 +94,8 @@ class PageController {
switch ( $handler ) {
case LogHandlerFileV2::class:
$args = $this->get_query_params();
$this->render_filev2( $args );
$params = $this->get_query_params();
$this->render_filev2( $params );
break;
case 'WC_Log_Handler_DB':
WC_Admin_Status::status_logs_db();
@ -109,17 +109,17 @@ class PageController {
/**
* Render the views for the FileV2 log handler.
*
* @param array $args Args for rendering the views.
* @param array $params Args for rendering the views.
*
* @return void
*/
private function render_filev2( array $args = array() ): void {
$view = $args['view'] ?? '';
private function render_filev2( array $params = array() ): void {
$view = $params['view'] ?? '';
switch ( $view ) {
case 'list_files':
default:
$this->render_file_list_page();
$this->render_file_list_page( $params );
break;
case 'single_file':
WC_Admin_Status::status_logs_file();
@ -130,11 +130,12 @@ class PageController {
/**
* Render the file list view.
*
* @param array $params Args for rendering the views.
*
* @return void
*/
private function render_file_list_page(): void {
private function render_file_list_page( array $params = array() ): void {
$defaults = $this->get_query_param_defaults();
$params = $this->get_query_params();
?>
<h2>