v' . esc_html(FORMLAYER_VERSION) . '
'; } static function tab_item($slug, $label, $icon){ $url = '#' . $slug; echo '' . wp_kses_post($icon) . '' . wp_kses_post($label) . ''; } static function forms_tab(){ $forms = get_posts([ 'post_type' => 'formlayer_form', 'posts_per_page' => -1, 'post_status' => 'any' ]); $count = is_array($forms) ? count($forms) : 0; echo '
+ ' . esc_html__('Add New Form', 'formlayer') . '
'; if(empty($forms)){ echo ''; } else { foreach ($forms as $form) { self::render_form_row($form); } } echo '
'.esc_html__('Name', 'formlayer') . ' '.esc_html__('Last Modified', 'formlayer') . ' '.esc_html__('Shortcode', 'formlayer') . ' '.esc_html__('Actions', 'formlayer') . '
' . esc_html__('No forms found', 'formlayer') . '

' . esc_html__('Create your first form to start collecting data.', 'formlayer') . '

'; } static function formbuilder_tab(){ echo '
'; } static function render_form_row($post){ $display_id = get_post_meta($post->ID, '_formlayer_display_id', true); if (!$display_id) { $counter = get_option('formlayer_id_counter', 0); $counter++; update_option('formlayer_id_counter', $counter); update_post_meta($post->ID, '_formlayer_display_id', $counter); $display_id = $counter; } $shortcode = '[formlayer id="' . $display_id . '"]'; $time = human_time_diff(get_the_modified_time('U', $post->ID), current_time('timestamp')) . ' ago'; echo '
' . esc_html(get_the_title($post->ID)) . '
' . esc_html($time) . ' ' . esc_html($shortcode) . '
'; } static function entries_tab(){ if (defined('FORMLAYER_PRO_VERSION')) { do_action('formlayer_render_entries_tab'); } else { self::pro_placeholder_page(); } } static function reports_tab(){ if(defined('FORMLAYER_PRO_VERSION')){ do_action('formlayer_render_reports_tab'); } else { self::pro_placeholder_page(); } } static function integrations_tab(){ if (defined('FORMLAYER_PRO_VERSION')) { do_action('formlayer_render_integrations'); } else { self::pro_placeholder_page(); } } static function pro_placeholder_page(){ echo '

' . esc_html__('This is a part of FormLayer Pro, so update/upgrade to pro to utilize this feature', 'formlayer') . '

'; } static function support_tab(){ echo '

' . esc_html__('Help & Support', 'formlayer') . '

' . esc_html__('You can contact the FormLayer team via email at ', 'formlayer') . 'support@formlayer.net ' . esc_html__('or through our Support Ticket System.', 'formlayer') . '

' . esc_html__('You can also check the documentation here:', 'formlayer') . ' https://formlayer.net/docs

'; } static function settings_tab(){ $settings = get_option('formlayer_settings', []); // Defaults $defaults = [ 'msg_success' => __('Thank you! Your form has been submitted successfully.', 'formlayer'), 'msg_error' => __('Something went wrong. Please try again.', 'formlayer'), 'msg_required' => __('This field is required.', 'formlayer'), 'msg_email' => __('Please enter a valid email address.', 'formlayer'), 'msg_url' => __('Please enter a valid URL.', 'formlayer'), 'msg_number' => __('Please enter a valid number.', 'formlayer'), 'msg_file_type' => __('This file type is not permitted.', 'formlayer'), 'msg_file_size' => __('The file is too large.', 'formlayer'), 'msg_terms' => __('You must accept the terms and conditions.', 'formlayer'), 'captcha_provider' => 'none', 'captcha_h_site_key' => '', 'captcha_h_secret_key' => '', 'captcha_h_theme' => 'light', 'captcha_t_site_key' => '', 'captcha_t_secret_key' => '', 'captcha_t_theme' => 'light', 'captcha_r_site_key' => '', 'captcha_r_secret_key' => '', 'captcha_r_theme' => 'light', ]; $settings = array_merge($defaults, $settings); echo'

' . esc_html__('Form Validation & Messages', 'formlayer') . '

' . esc_html__('Customize error and success messages for all forms.', 'formlayer') . '

' . esc_html__('Spam Protection (Captcha)', 'formlayer') . '

' . esc_html__('Configure and select your preferred captcha service to block bots.', 'formlayer') . '

hCaptcha
'; if(!defined('FORMLAYER_PRO_VERSION')){ echo''; } echo'Turnstile
reCAPTCHA

hCaptcha Configuration

' . esc_html__('hCaptcha is a free, privacy-focused alternative to Google reCAPTCHA. Visit hcaptcha.com to get your keys.', 'formlayer') . '

'; if(!defined('FORMLAYER_PRO_VERSION')){ echo'

'.esc_html__('Cloudflare Turnstile is Pro', 'formlayer').'

'.esc_html__('Enjoy the seamless, non-intrusive CAPTCHA experience of Cloudflare Turnstile by upgrading to FormLayer Pro.', 'formlayer').'

'.esc_html__('Get FormLayer Pro', 'formlayer').'
'; } else{ do_action('formlayer_render_turnstile_settings', $settings); } echo'
'; if(!defined('FORMLAYER_PRO_VERSION')){ echo'

'.esc_html__('Google reCAPTCHA is Pro', 'formlayer').'

'.esc_html__('Enjoy the legacy and advanced features of Google reCAPTCHA v2 and v3 by upgrading to FormLayer Pro.', 'formlayer').'

'.esc_html__('Get FormLayer Pro', 'formlayer').'
'; } else { do_action('formlayer_render_recaptcha_settings', $settings); } echo'

' . esc_html__('Configure your credentials above. You can then add a "Captcha" field to your individual forms and select which provider to use for that specific form.', 'formlayer') . '

'; } static function footer(){ echo '
'; // Close main and wrapper self::modals(); } static function modals(){ $settings = get_option('formlayer_settings', []); // Entry Detail Modal echo '
'; // Form Settings Modal echo '

' . esc_html__('Form Settings', 'formlayer') . '

  • ' . esc_html__('Email Notifications', 'formlayer') . '
  • ' . esc_html__('Form Confirmations', 'formlayer') . '
  • ' . esc_html__('Integrations', 'formlayer') . '
  • ' . esc_html__('Custom CSS', 'formlayer') . '

' . esc_html__('Email Notifications', 'formlayer') . '

' . esc_html__('Configure how you want to be notified when a form is submitted.', 'formlayer') . '

Available Merge Tags (Click to insert)
'; do_action('formlayer_render_modals'); } }