?? GreyFile — Mystic File Browser

Current path: home/webdevt/www/demo2/wp-content/plugins/divi-contact-form-helper/d5/server/Admin/Pages/



?? Go up: /home/webdevt/www/demo2/wp-content/plugins/divi-contact-form-helper/d5/server/Admin

?? Viewing: ListContactForms.php

<?php

namespace KS_PAC_DCFH\Admin\Pages;

use KS_PAC_DCFH\Admin\Controllers\ContactFormsListTable;

if (!defined('ABSPATH')) {
    exit;
}

class ListContactForms
{
    public string $page;

    public object $contact_forms_list_table;

    public function load(): void
    {
        $this->page = isset($_GET['page']) ? sanitize_text_field($_GET['page']) : ''; // phpcs:ignore WordPress.Security.NonceVerification
        add_action('admin_menu', [$this, 'maybe_add_menu_item']);
    }

    public function maybe_add_menu_item(): void
    {
        $hook_suffix = add_submenu_page(
            'edit.php?post_type=pwh_dcfh',
            __('Contact Forms', 'divi-contact-form-helper'),
            __('Forms', 'divi-contact-form-helper'),
            'view_forms_pwh_dcfh',
            'contact_forms',
            [$this, 'display_form']
        );
        add_action("load-$hook_suffix", [$this, 'set_screen_options']);
    }

    public function set_screen_options(): void
    {
        $this->contact_forms_list_table = new ContactFormsListTable();
    }

    public function display_form(): void
    { ?>
        <div class="wrap" id="page-contact-forms-list">
            <h1 class="wp-heading-inline"><?php echo esc_html(get_admin_page_title()); ?></h1>
            <hr class="wp-header-end">
            <span class="spinner"></span>
            <form method="get" autocomplete="off">
                <?php
                $this->contact_forms_list_table->prepare_items();
                $this->contact_forms_list_table->display();
                ?>
                <input type="hidden" name="post_type" value="pwh_dcfh"/>
                <input type="hidden" name="page" value="<?php echo esc_attr($this->page); ?>"/>
                <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('bulk-action-'.$this->page); // phpcs:ignore
                ?>"/>
            </form>
        </div>
        <?php
    }
}


??

??