' . esc_html__( 'The control layer is not loaded.', 'ai-eshop-optimizer' ) . '
';
return;
}
$aieo_ctl_card = static function ( $anchor, $icon, $title, $description = '' ) {
return AIEO_DMM_UI::card(
array(
'anchor' => $anchor,
'icon' => $icon,
'title' => $title,
'description' => $description,
)
);
};
list( $aieo_ctl_open, $aieo_ctl_close ) = $aieo_ctl_card( 'controls-intro', '', __( 'One control layer', 'ai-eshop-optimizer' ), __( 'One control layer, shared by the admin screens and by customer surveys. A question declares what it means — a choice, a number, a scale, an order — and the surface decides how to draw it, so the same question can be a row of buttons on a phone and a slider on a desktop without the stored answer changing.', 'ai-eshop-optimizer' ) );
echo $aieo_ctl_open;
$aieo_ctl_why = __( 'This page stores nothing. Use it to check that every variant has a style, that every control can be operated from the keyboard alone, and that ordering works without dragging.', 'ai-eshop-optimizer' );
echo class_exists( '\Rooster\Admin\Guidance' ) ? \Rooster\Admin\Guidance::text( $aieo_ctl_why ) : '' . esc_html( $aieo_ctl_why ) . '
';
echo $aieo_ctl_close;
rooster_admin_band_open( array( 'cols' => 2 ) );
list( $aieo_ctl_open, $aieo_ctl_close ) = $aieo_ctl_card( 'controls-variants', 'stamp', __( 'Buttons and badges', 'ai-eshop-optimizer' ), __( 'Buttons carry intent — what pressing this does. Badges carry status — what this thing is. That is why a badge has success, warning and information and a button does not: a button is not a status.', 'ai-eshop-optimizer' ) );
echo $aieo_ctl_open;
?>
ucfirst( $aieo_cv ), 'variant' => $aieo_cv )
);
}
?>
__( 'Small', 'ai-eshop-optimizer' ), '' => __( 'Default', 'ai-eshop-optimizer' ), 'lg' => __( 'Large', 'ai-eshop-optimizer' ) ) as $aieo_cs => $aieo_cs_label ) {
echo '
'
. AIEO_Controls::btn( array( 'label' => $aieo_cs_label, 'variant' => 'primary', 'size' => $aieo_cs ) )
. '' . esc_html( '' === $aieo_cs ? 'size: default' : 'size: ' . $aieo_cs ) . '
';
}
?>
__( 'Unavailable', 'ai-eshop-optimizer' ), 'variant' => 'primary', 'disabled' => true, 'attrs' => ' aria-describedby="aieo-c-unavailable-reason"' ) );
echo '' . esc_html__( 'Disabled on purpose: this shows the unavailable look.', 'ai-eshop-optimizer' ) . '';
?>
danger', 'destructive' );
$aieo_ctl_retired_out = class_exists( '\Rooster\Admin\Guidance' )
? \Rooster\Admin\Guidance::text( sprintf( $aieo_ctl_retired, 'danger', 'destructive' ), 'guidance', array( 'html' => $aieo_ctl_retired_html ) )
: '' . $aieo_ctl_retired_html . '
';
echo $aieo_ctl_retired_out;
?>
__( 'How easy was it to find what you were looking for?', 'ai-eshop-optimizer' ),
'name' => 'aieo_demo_scale',
'min' => 1,
'max' => 5,
'low' => __( 'Very hard', 'ai-eshop-optimizer' ),
'high' => __( 'Very easy', 'ai-eshop-optimizer' ),
);
echo AIEO_Controls::scale( $aieo_c_scale );
$aieo_c_nps = $aieo_c_scale;
$aieo_c_nps['label'] = __( 'How likely are you to recommend us?', 'ai-eshop-optimizer' );
$aieo_c_nps['name'] = 'aieo_demo_nps';
$aieo_c_nps['max'] = 10;
$aieo_c_nps['min'] = 0;
$aieo_c_nps['low'] = __( 'Not at all likely', 'ai-eshop-optimizer' );
$aieo_c_nps['high'] = __( 'Extremely likely', 'ai-eshop-optimizer' );
$aieo_c_nps['widget'] = 'slider';
$aieo_c_nps_why = __( 'The read-out shows a dash until the slider is touched. A slider reports a number even when nobody has moved it, so submitting it directly would record an answer from everyone who skipped the question.', 'ai-eshop-optimizer' );
echo AIEO_Controls::scale( $aieo_c_nps );
echo \Rooster\Admin\Guidance::text( $aieo_c_nps_why, 'guidance', array( 'about' => $aieo_c_nps['label'], 'question' => __( 'Why a dash?', 'ai-eshop-optimizer' ) ) );
echo AIEO_Controls::rating(
array(
'label' => __( 'How would you rate the delivery?', 'ai-eshop-optimizer' ),
'name' => 'aieo_demo_rating',
'max' => 5,
)
);
echo \Rooster\Admin\Guidance::text( __( 'Stars are a scale with a picture on them. Each star carries its own spoken label, so the group is answerable by ear.', 'ai-eshop-optimizer' ), 'guidance', array( 'about' => __( 'How would you rate the delivery?', 'ai-eshop-optimizer' ), 'question' => __( 'Why spoken labels?', 'ai-eshop-optimizer' ) ) );
?>
__( 'How did you hear about us?', 'ai-eshop-optimizer' ),
'name' => 'aieo_demo_source',
'options' => array(
'search' => __( 'Search engine', 'ai-eshop-optimizer' ),
'friend' => array(
'label' => __( 'From someone I know', 'ai-eshop-optimizer' ),
'sub' => __( 'An option may carry a second line where the answer needs one.', 'ai-eshop-optimizer' ),
),
'social' => __( 'Social media', 'ai-eshop-optimizer' ),
'other' => __( 'Somewhere else', 'ai-eshop-optimizer' ),
),
)
);
echo AIEO_Controls::choice(
array(
'label' => __( 'Which of these do you buy for?', 'ai-eshop-optimizer' ),
'name' => 'aieo_demo_who',
'many' => true,
'inline' => true,
'options' => array(
'self' => __( 'Myself', 'ai-eshop-optimizer' ),
'family' => __( 'My family', 'ai-eshop-optimizer' ),
'professional' => __( 'My work', 'ai-eshop-optimizer' ),
'gift' => __( 'A gift', 'ai-eshop-optimizer' ),
),
)
);
echo \Rooster\Admin\Guidance::text( __( 'More than one answer is a different question from one answer, not the same question with a different control.', 'ai-eshop-optimizer' ), 'guidance', array( 'about' => __( 'Which of these do you buy for?', 'ai-eshop-optimizer' ), 'question' => __( 'Why its own question?', 'ai-eshop-optimizer' ) ) );
echo AIEO_Controls::select(
array(
'label' => __( 'Country', 'ai-eshop-optimizer' ),
'name' => 'aieo_demo_country',
'narrow' => true,
'placeholder' => __( 'Choose one', 'ai-eshop-optimizer' ),
'options' => array( 'gr' => 'Greece', 'gb' => 'United Kingdom', 'de' => 'Germany' ),
)
);
echo \Rooster\Admin\Guidance::text( __( 'The empty first option is what makes "not answered" reachable and keeps it distinct from the first real answer.', 'ai-eshop-optimizer' ), 'guidance', array( 'about' => __( 'Country', 'ai-eshop-optimizer' ), 'question' => __( 'Why an empty option?', 'ai-eshop-optimizer' ) ) );
?>
__( 'Put these in the order that matters most to you.', 'ai-eshop-optimizer' ),
'name' => 'aieo_demo_rank',
'options' => array(
'price' => __( 'Price', 'ai-eshop-optimizer' ),
'speed' => __( 'Delivery speed', 'ai-eshop-optimizer' ),
'range' => __( 'Range of products', 'ai-eshop-optimizer' ),
'support' => __( 'Help when something goes wrong', 'ai-eshop-optimizer' ),
),
)
);
echo \Rooster\Admin\Guidance::text( __( 'The order is submitted as one value. Every move is announced, because "it moved" without saying where is not enough to order a list.', 'ai-eshop-optimizer' ), 'guidance', array( 'about' => __( 'Put these in the order that matters most to you.', 'ai-eshop-optimizer' ), 'question' => __( 'Why one value?', 'ai-eshop-optimizer' ) ) );
?>
__( 'Order number', 'ai-eshop-optimizer' ),
'name' => 'aieo_demo_order',
'narrow' => true,
'placeholder' => __( 'For example 531980', 'ai-eshop-optimizer' ),
)
);
echo AIEO_Controls::input(
array(
'label' => __( 'Email address', 'ai-eshop-optimizer' ),
'name' => 'aieo_demo_email',
'type' => 'email',
'narrow' => true,
'required' => true,
'value' => 'not-an-address',
'error' => __( 'That does not look like an email address.', 'ai-eshop-optimizer' ),
)
);
echo AIEO_Controls::textarea(
array(
'label' => __( 'Anything else you would like to tell us?', 'ai-eshop-optimizer' ),
'name' => 'aieo_demo_comment',
'rows' => 4,
)
);
?>