' . esc_html__( 'Error: Dashboard view file not found.', '24tt-unrestricted-forms' ) . '

'; } } /** * Callback to render the "All Forms" page. * @since 1.0.0 * @return void */ public function render_forms_page() { if ( ! current_user_can( 'manage_tt24_forms' ) ) { wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', '24tt-unrestricted-forms' ) ); } $view_file = TT24_FORMS_ADMIN_PATH . 'views/view-forms.php'; if ( file_exists( $view_file ) ) { require_once $view_file; } else { echo '

' . esc_html__( 'Error: Forms view file not found.', '24tt-unrestricted-forms' ) . '

'; } } /** * Callback to render the Drag-and-Drop Builder page. * @since 1.0.0 * @return void */ public function render_builder_page() { if ( ! current_user_can( 'manage_tt24_forms' ) ) { wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', '24tt-unrestricted-forms' ) ); } $view_file = TT24_FORMS_ADMIN_PATH . 'views/view-builder.php'; if ( file_exists( $view_file ) ) { require_once $view_file; } else { echo '

' . esc_html__( 'Error: Builder view file not found.', '24tt-unrestricted-forms' ) . '

'; } } /** * Callback to render the Entries view page. * @since 1.0.0 * @return void */ public function render_entries_page() { if ( ! current_user_can( 'view_tt24_entries' ) ) { wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', '24tt-unrestricted-forms' ) ); } $view_file = TT24_FORMS_ADMIN_PATH . 'views/view-entries.php'; if ( file_exists( $view_file ) ) { require_once $view_file; } else { echo '

' . esc_html__( 'Error: Entries view file not found.', '24tt-unrestricted-forms' ) . '

'; } } } // Instantiate and initialize the class securely $tt24_admin_menu = new TT24_Admin_Menu(); $tt24_admin_menu->init();