' . esc_html( $nav[ $key ][1] ) . '
'; } echo $html; // phpcs:ignore WordPress.Security.EscapeOutput -- the page's own escaped output. self::close(); } /** @return array Navigation: key => [ title, description, url, icon, capability ]. */ public static function nav() { $s = admin_url( 'admin.php?page=fwren-settings&tab=' ); $set = 'fwren_manage_settings'; $items = array( 'dashboard' => array( __( 'Dashboard', 'fieldwren' ), __( 'Overview, stats and quick start', 'fieldwren' ), admin_url( 'admin.php?page=fwren' ), 'home', 'fwren_view_entries' ), 'reports' => array( __( 'Reports', 'fieldwren' ), __( 'Funnels and survey answers per form', 'fieldwren' ), admin_url( 'admin.php?page=fwren-reports' ), 'chart', 'fwren_view_entries' ), 'general' => array( __( 'General', 'fieldwren' ), __( 'Proxy, retention, maps and data', 'fieldwren' ), $s . 'general', 'gear', $set ), 'captcha' => array( __( 'Spam protection', 'fieldwren' ), __( 'Turnstile, reCAPTCHA and hCaptcha keys', 'fieldwren' ), $s . 'captcha', 'shield', $set ), 'email' => array( __( 'Email', 'fieldwren' ), __( 'Sender, logo and email design', 'fieldwren' ), $s . 'email', 'mail', $set ), 'tracking' => array( __( 'Conversion tracking', 'fieldwren' ), __( 'GTM, GA4, Meta and LinkedIn events', 'fieldwren' ), $s . 'tracking', 'target', $set ), ); // Module tabs (integrations, payments…) keep their place in the menu. $known = array_keys( $items ); $extra = apply_filters( 'fwren/admin/global_tabs', array() ); $meta = array( 'integrations' => array( __( 'Connect CRMs, email tools and apps', 'fieldwren' ), 'plug' ), 'payments' => array( __( 'Gateways, test mode and webhooks', 'fieldwren' ), 'card' ), ); foreach ( (array) $extra as $id => $label ) { if ( in_array( $id, $known, true ) ) { continue; } $items[ $id ] = array( $label, $meta[ $id ][0] ?? __( 'Module settings', 'fieldwren' ), $s . $id, $meta[ $id ][1] ?? 'gear', $set ); if ( 'payments' === $id && class_exists( '\FWREN\Payments\Admin_Screens' ) ) { $items['coupons'] = array( __( 'Coupons', 'fieldwren' ), __( 'Discount codes for paid forms', 'fieldwren' ), admin_url( 'admin.php?page=fwren-coupons' ), 'tag', $set ); } } if ( class_exists( '\FWREN_BC\Kit' ) ) { $items['styles'] = array( __( 'Global styles', 'fieldwren' ), __( 'Colours and fonts every form uses', 'fieldwren' ), admin_url( 'admin.php?page=fwren-global-styles' ), 'palette', 'manage_options' ); } if ( class_exists( '\FWREN\Modules\Importer' ) ) { $items['tools'] = array( __( 'Import & export', 'fieldwren' ), __( 'Move forms, import from Fluent Forms', 'fieldwren' ), admin_url( 'admin.php?page=fwren-tools' ), 'download', 'fwren_manage_forms' ); } $items['logs'] = array( __( 'Activity log', 'fieldwren' ), __( 'Emails, integrations and payment events', 'fieldwren' ), admin_url( 'admin.php?page=fwren-logs' ), 'list', $set ); $items = apply_filters( 'fwren/admin/app_nav', $items ); return array_filter( $items, static function ( $n ) { return empty( $n[4] ) || current_user_can( $n[4] ); } ); } /** Open the shell. */ public static function open( $active, $title, $actions = '' ) { echo '' . esc_html__( 'Design in the block editor, add logic and payments, and follow every lead from view to entry.', 'fieldwren' ) . '
'; $pills = array( array( 'indigo', sprintf( /* translators: %d */ __( '%d templates', 'fieldwren' ), $tpl_count ) ), array( 'sky', sprintf( /* translators: %d */ __( '%d form blocks', 'fieldwren' ), $fields ) ), array( 'violet', __( 'Conditional logic', 'fieldwren' ) ), array( 'amber', __( 'Multi-step', 'fieldwren' ) ), array( 'emerald', sprintf( /* translators: %d */ __( '%d integrations', 'fieldwren' ), $ints ) ), array( 'rose', __( 'Payments', 'fieldwren' ) ), ); echo '| ' . esc_html__( 'Form', 'fieldwren' ) . ' | ' . esc_html__( 'Views', 'fieldwren' ) . ' | ' . esc_html__( 'Entries', 'fieldwren' ) . ' | ' . esc_html__( 'Conversion', 'fieldwren' ) . ' |
|---|---|---|---|
| ' . esc_html( $f[1] ? $f[1] : '#' . $f[0] ) . ' | ' . (int) $f[2] . ' | ' . (int) $f[4] . ' | ' . esc_html( $f[2] ? $c . '%' : '—' ) . ' |
' . esc_html( $t['description'] ) . '