' . esc_html__( 'The survey subsystem is not loaded.', 'ai-eshop-optimizer' ) . '
'; return; } $aieo_qn_blueprints = isset( $blueprints ) ? (array) $blueprints : array(); $aieo_qn_health = isset( $health ) ? (array) $health : array(); $aieo_qn_surfaces = isset( $surfaces ) ? (array) $surfaces : array(); $aieo_qn_worklist = isset( $worklist ) ? (array) $worklist : array(); $aieo_qn_hooks = isset( $hooks ) ? (array) $hooks : array(); $aieo_qn_statuses = isset( $statuses ) ? (array) $statuses : array(); $aieo_qn_pages = isset( $pages ) ? (array) $pages : array(); $aieo_qn_problem_tone = static function ( array $rows ) { foreach ( $rows as $aieo_qn_i => $aieo_qn_row ) { if ( is_array( $aieo_qn_row ) ) { $rows[ $aieo_qn_i ]['problem_tone'] = '' !== trim( (string) ( $aieo_qn_row['problem'] ?? '' ) ) ? 'danger' : ''; } } return $rows; }; $aieo_qn_health = $aieo_qn_problem_tone( $aieo_qn_health ); $aieo_qn_surfaces = $aieo_qn_problem_tone( $aieo_qn_surfaces ); ?> 'aieo-card-questionnaires-placement', 'title' => __( 'Where each survey appears', 'ai-eshop-optimizer' ), 'description' => __( 'Everything is off until you switch it on here. A survey needs two things: somewhere on the site to be shown, and a page of its own to land on when it is sent by email. The second one is what a link in a message points at, and without it nothing can be sent at all.', 'ai-eshop-optimizer' ) . ' ' . __( 'Once per order is on by default and should stay on. A confirmation page gets reloaded, returned to from an email and opened on a second device, and each of those is another chance to answer the same survey twice.', 'ai-eshop-optimizer' ), 'cols' => 3, ) ); foreach ( $aieo_qn_blueprints as $aieo_qn_bp ) : $aieo_qn_slug = str_replace( '_', '-', sanitize_key( (string) $aieo_qn_bp['id'] ) ); $aieo_qn_form = 'aieo-card-questionnaires-placement-' . $aieo_qn_slug . '-form'; $aieo_qn_id = (string) $aieo_qn_bp['id']; list( $aieo_qn_open, $aieo_qn_close ) = AIEO_DMM_UI::card( array( 'anchor' => 'questionnaires-placement-' . $aieo_qn_slug, 'title' => (string) $aieo_qn_bp['label'], 'description' => '' !== (string) ( $aieo_qn_bp['description'] ?? '' ) ? (string) $aieo_qn_bp['description'] : __( 'Where this survey is shown, how it looks there, and the page its email link opens.', 'ai-eshop-optimizer' ), 'tools' => '' . esc_html( $aieo_qn_bp['id'] ) . '',
'footer' => class_exists( '\Rooster\Admin\States' ) ? \Rooster\Admin\States::save_button( $aieo_qn_form ) : '',
)
);
echo $aieo_qn_open;
ob_start();
?>
__( 'Nowhere on the site', 'ai-eshop-optimizer' ) ) + $aieo_qn_hooks;
$aieo_qn_page_opts = array( '0' => __( 'None, so nothing can be sent', 'ai-eshop-optimizer' ) );
foreach ( $aieo_qn_pages as $aieo_qn_pid => $aieo_qn_pt ) {
$aieo_qn_page_opts[ (string) (int) $aieo_qn_pid ] = $aieo_qn_pt;
}
$aieo_qn_blank = 'aieo-qn-blank-' . $aieo_qn_id;
$aieo_qn_sizes = array();
foreach ( array(
array( 'secsize', 'section_size', __( 'Section heading size (px)', 'ai-eshop-optimizer' ), 19 ),
array( 'qsize', 'question_size', __( 'Question size (px)', 'ai-eshop-optimizer' ), 16 ),
array( 'optsize', 'option_size', __( 'Answer options size (px)', 'ai-eshop-optimizer' ), 15 ),
array( 'helpsize', 'help_size', __( 'Explanations size (px)', 'ai-eshop-optimizer' ), 14 ),
) as $aieo_qn_sz ) {
$aieo_qn_sid = 'aieo-qn-' . $aieo_qn_sz[0] . '-' . $aieo_qn_id;
$aieo_qn_sizes[] = array(
'label' => $aieo_qn_sz[2],
'id' => $aieo_qn_sid,
'control' => \Rooster\Admin\Ui::input( $aieo_qn_sz[1], $aieo_qn_bp[ $aieo_qn_sz[1] ] > 0 ? (string) (int) $aieo_qn_bp[ $aieo_qn_sz[1] ] : '', array( 'id' => $aieo_qn_sid, 'type' => 'number', 'xs' => true, 'class' => 'aieo-qn-' . $aieo_qn_sz[0], 'min' => 10, 'max' => 48, 'step' => 1, 'placeholder' => (string) (int) $aieo_qn_sz[3] ) ),
);
}
$aieo_qn_status_boxes = '';
foreach ( $aieo_qn_statuses as $aieo_qn_sk => $aieo_qn_sl ) {
$aieo_qn_status_boxes .= '';
}
echo '