' . '' . '' . '' . esc_html( $title . ' — ' . $store ) . '' . self::stylesheet() . '
' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- the tag WordPress prints for our registered stylesheet. . '

' . esc_html( $store ) . '

' . '

' . esc_html( $title ) . '

' . $body // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- callers pass escaped HTML. . '
'; if ( apply_filters( 'agentadapt_http_exit', true ) ) { exit; } throw new AgentAdapt_Http_Sent(); } /** * The agent's identity block: logo, name, and the domain it publishes, * with the domain emphasised (Guides: the agent chooses its own name, so * the domain is what the customer can trust). * * @param array $agent Resolved agent. */ public static function agent_block( array $agent ): string { $domain = (string) wp_parse_url( (string) $agent['client_id'], PHP_URL_HOST ); $name = '' !== (string) $agent['name'] ? (string) $agent['name'] : $domain; $logo = '' !== (string) $agent['logo_uri'] ? '' : ''; return '
' . $logo . '
' . esc_html( $name ) . '
' /* translators: %s: the agent's domain */ . '' . esc_html( sprintf( __( 'published at %s', 'agent-adapt' ), $domain ) ) . '
'; } /** * Checkbox list of scopes, all ticked, each in plain words. * * @param string[] $scopes Scopes requested. */ public static function scope_checkboxes( array $scopes ): string { $desc = AgentAdapt_Signin::descriptions(); $out = '
' . esc_html__( 'It is asking to:', 'agent-adapt' ) . ''; foreach ( $scopes as $s ) { $out .= ''; } return $out . '
'; } /** * Hidden inputs. * * @param array $fields Name → value. */ public static function hidden( array $fields ): string { $out = ''; foreach ( $fields as $k => $v ) { $out .= ''; } return $out; } /** * Who is signed in, with a way to switch. * * @param string $return URL to come back to after logging out and in again. */ public static function account_line( string $return ): string { $user = wp_get_current_user(); return ''; } /** * The pages' stylesheet (assets/css/pages.css), enqueued and printed by * WordPress: the tag wp_print_styles() writes for it. */ private static function stylesheet(): string { wp_enqueue_style( 'agentadapt-pages', AGENTADAPT_PLUGIN_URL . 'assets/css/pages.css', array(), AGENTADAPT_VERSION ); ob_start(); wp_print_styles( array( 'agentadapt-pages' ) ); return (string) ob_get_clean(); } }