'af-translate', 'view' => $slug, 'type' => $type ), admin_url( 'admin.php' ) ); $return_url = add_query_arg( array( 'page' => 'af-translate' ), admin_url( 'admin.php' ) ); // Pull template context into view scope cleanly include plugin_dir_path( __FILE__ ) . 'views/project-dashboard.php'; } /** * Renders language initializing screen configuration setups. */ public static function render_new_language_screen( $slug, $type ) { if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'Security Exception: Insufficient operational privileges.', 'af-translate' ) ); } $slug = sanitize_key( $slug ); $type = sanitize_key( $type ); $summary = AF_Translate_Analyzer::get_component_summary( $slug, $type ); $pot_file_path = isset( $summary['pot_file'] ) && is_string( $summary['pot_file'] ) ? $summary['pot_file'] : ''; $clean_pot_name = ! empty( $pot_file_path ) ? basename( $pot_file_path ) : ''; $base_metrics = ( ! empty( $pot_file_path ) && self::validate_file_path_containment( $pot_file_path ) ) ? AF_Translate_Analyzer::analyze_po_file( $pot_file_path ) : array( 'total' => 0 ); $string_count = $base_metrics['total'] > 0 ? (int) $base_metrics['total'] : 0; $return_url = add_query_arg( array( 'page' => 'af-translate', 'view' => $slug, 'type' => $type ), admin_url( 'admin.php' ) ); include plugin_dir_path( __FILE__ ) . 'views/new-language.php'; } /** * Renders back-end mapping layouts. */ public static function render_setup_panel( $slug, $type ) { if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'Security Exception: Insufficient operational privileges.', 'af-translate' ) ); } $slug = sanitize_key( $slug ); $type = sanitize_key( $type ); $return_url = add_query_arg( array( 'page' => 'af-translate', 'view' => $slug, 'type' => $type ), admin_url( 'admin.php' ) ); include plugin_dir_path( __FILE__ ) . 'views/setup-panel.php'; } }