';
$reiter = array(
'bewertung' => __( 'Rating', '3task-review-box' ),
'inhalt' => __( 'Content', '3task-review-box' ),
'links' => __( 'Links and disclosure', '3task-review-box' ),
'google' => __( 'Google', '3task-review-box' ),
);
echo '
';
$erster = true;
foreach ( $reiter as $schluessel => $titel ) {
printf( '%4$s ', esc_attr( $schluessel ), $erster ? 'true' : 'false', $erster ? '0' : '-1', esc_html( $titel ) );
$erster = false;
}
echo '
';
// Reiter Bewertung.
echo '
';
echo '
' . esc_html__( 'Template', '3task-review-box' ) . ' ';
foreach ( ThreeRB_Templates::all() as $v ) {
printf( '%2$s ', esc_attr( $v['key'] ), esc_html( $v['name'] ) );
}
echo ' ' . esc_html__( 'Apply template', '3task-review-box' ) . ' ';
if ( current_user_can( 'manage_options' ) ) {
echo ' ' . esc_html__( 'Save these criteria as a template', '3task-review-box' ) . ' ';
}
echo '
';
echo '
';
if ( $block ) {
echo '
' . esc_html__( 'What is rated?', '3task-review-box' ) . ' ' . esc_html__( 'Name, score, short verdict and placement are set with the star at the top of the editor.', '3task-review-box' ) . '
';
} else {
self::text( 'threerb_q[name]', __( 'What is rated?', '3task-review-box' ), $box['item']['name'], 120 );
}
self::auswahl(
'threerb[scale]',
__( 'Scale', '3task-review-box' ),
$box['scale'],
array(
'p10' => __( '0 to 10 points', '3task-review-box' ),
's10' => __( '10 stars', '3task-review-box' ),
's5' => __( '5 stars', '3task-review-box' ),
'pct' => __( '0 to 100 percent', '3task-review-box' ),
)
);
self::auswahl(
'threerb[step]',
__( 'Steps', '3task-review-box' ),
(string) $box['step'],
array(
'0.1' => '0.1',
'0.5' => '0.5',
'1' => '1',
)
);
echo '
';
if ( ! $block ) {
self::text( 'threerb_q[score]', __( 'Score (without criteria)', '3task-review-box' ), null === $box['score'] ? '' : (string) $box['score'], 6 );
}
echo '
' . esc_html__( 'Criterion', '3task-review-box' ) . ' ' . esc_html__( 'Weight %', '3task-review-box' ) . ' ' . esc_html__( 'Score', '3task-review-box' ) . ' ' . esc_html__( 'Measured value', '3task-review-box' ) . ' ' . esc_html__( 'Reason (optional)', '3task-review-box' ) . ' ';
$zeilen = $box['criteria'];
$anzahl = min( 12, max( 4, count( $zeilen ) + 2 ) );
for ( $i = 0; $i < $anzahl; $i++ ) {
$k = isset( $zeilen[ $i ] ) ? $zeilen[ $i ] : array(
'label' => '',
'weight' => '',
'score' => '',
'measure' => '',
'note' => '',
);
/* translators: %d: row number. */
$nr = sprintf( __( 'Criterion %d', '3task-review-box' ), $i + 1 );
echo '';
printf( ' ', (int) $i, esc_attr( $k['label'] ), esc_attr( $nr ) );
printf( ' ', (int) $i, esc_attr( (string) $k['weight'] ), esc_attr( $nr . ': ' . __( 'weight', '3task-review-box' ) ) );
printf( ' ', (int) $i, esc_attr( null === $k['score'] ? '' : (string) $k['score'] ), esc_attr( $nr . ': ' . __( 'score', '3task-review-box' ) ) );
printf( ' ', (int) $i, esc_attr( $k['measure'] ), esc_attr( $nr . ': ' . __( 'measured value', '3task-review-box' ) ) );
printf( ' ', (int) $i, esc_attr( $k['note'] ), esc_attr( $nr . ': ' . __( 'reason', '3task-review-box' ) ) );
echo ' ';
}
echo '
' . esc_html__( 'Weights do not need to add up to 100, they count in proportion. With criteria the score calculates itself.', '3task-review-box' ) . '
';
$gesamt = ThreeRB_Score::total( $box );
if ( null !== $gesamt['value'] ) {
/* translators: %s: total score. */
echo '
' . esc_html( sprintf( __( 'Total score: %s', '3task-review-box' ), ThreeRB_Render::zahl( $gesamt['value'], $box ) ) ) . ( '' !== ThreeRB_Render::wort( $gesamt['share'] ) ? ' · ' . esc_html( ThreeRB_Render::wort( $gesamt['share'] ) ) : '' ) . '
';
}
echo '
';
self::text( 'threerb[override][value]', __( 'Set total score by hand (optional)', '3task-review-box' ), null === $box['override']['value'] ? '' : (string) $box['override']['value'], 6 );
self::text( 'threerb[override][reason]', __( 'Reason (required, at least 10 characters)', '3task-review-box' ), $box['override']['reason'], 200 );
echo '
';
// Reiter Inhalt.
echo '
';
self::flaeche( 'threerb[pros]', __( 'Strengths (one per line)', '3task-review-box' ), implode( "\n", $box['pros'] ) );
self::flaeche( 'threerb[cons]', __( 'Weaknesses (one per line)', '3task-review-box' ), implode( "\n", $box['cons'] ) );
echo '
';
self::flaeche( 'threerb[verdict]', __( 'Verdict', '3task-review-box' ), $box['verdict'] );
if ( ! $block ) {
self::text( 'threerb_q[summary]', __( 'Short verdict (up to 220 characters)', '3task-review-box' ), $box['summary'], 220 );
// Im Block-Editor stehen diese Häkchen am Stern, hier fehlten sie sonst ganz.
$orte = array(
'top' => __( 'At the top as a short verdict', '3task-review-box' ),
'bottom' => __( 'At the end as the full box', '3task-review-box' ),
'sidebar' => __( 'In the sidebar (widget)', '3task-review-box' ),
);
echo '
' . esc_html__( 'Where does the rating appear?', '3task-review-box' ) . ' ';
foreach ( $orte as $wo => $titel ) {
printf( ' %3$s ', esc_attr( $wo ), checked( ! empty( $box['place'][ $wo ] ), true, false ), esc_html( $titel ) );
}
echo '';
}
echo '
';
self::text( 'threerb[good_for]', __( 'Good for (comma separated)', '3task-review-box' ), implode( ', ', $box['good_for'] ), 250 );
self::text( 'threerb[bad_for]', __( 'Not for (comma separated)', '3task-review-box' ), implode( ', ', $box['bad_for'] ), 250 );
echo '
';
self::text( 'threerb[tested]', __( 'How we tested', '3task-review-box' ), $box['tested'], 300 );
$alternativen = array();
foreach ( $box['alternatives'] as $alt ) {
$alternativen[] = '' !== $alt['url'] ? $alt['label'] . ' | ' . $alt['url'] : $alt['label'];
}
self::flaeche( 'threerb[alternatives]', __( 'Alternatives (one per line, optionally “Name | address”, up to 5)', '3task-review-box' ), implode( "\n", $alternativen ) );
self::text( 'threerb[item][sub]', __( 'Subline, e.g. product category', '3task-review-box' ), $box['item']['sub'], 120 );
echo '
';
// Reiter Links und Hinweise.
echo '
';
echo '
' . esc_html__( 'Link text', '3task-review-box' ) . ' ' . esc_html__( 'Address', '3task-review-box' ) . ' ' . esc_html__( 'Main link', '3task-review-box' ) . ' ' . esc_html__( 'Affiliate', '3task-review-box' ) . ' ';
for ( $i = 0; $i < 5; $i++ ) {
$l = isset( $box['links'][ $i ] ) ? $box['links'][ $i ] : array(
'label' => '',
'url' => '',
'primary' => false,
'affiliate' => false,
);
printf( ' ', (int) $i, esc_attr( $l['label'] ), esc_attr__( 'Link text', '3task-review-box' ), esc_attr( $l['url'] ), esc_attr__( 'Address', '3task-review-box' ), checked( $l['primary'], true, false ), esc_attr__( 'Main link', '3task-review-box' ), checked( $l['affiliate'], true, false ), esc_attr__( 'Affiliate link', '3task-review-box' ) );
}
echo '
' . esc_html__( 'Affiliate links get rel="sponsored" automatically.', '3task-review-box' ) . '
';
echo '
' . esc_html__( 'Disclosure below the box', '3task-review-box' ) . ' ';
$arten = array(
'loan' => __( 'Review unit on loan', '3task-review-box' ),
'gift' => __( 'Review unit provided and kept', '3task-review-box' ),
'paid' => __( 'Paid partnership', '3task-review-box' ),
'affiliate' => __( 'Affiliate links', '3task-review-box' ),
);
foreach ( $arten as $art => $titel ) {
printf( ' %3$s ', esc_attr( $art ), checked( $box['disclosure'][ $art ], true, false ), esc_html( $titel ) );
}
echo '';
self::text( 'threerb[disclosure][text]', __( 'Own sentence (optional)', '3task-review-box' ), $box['disclosure']['text'], 200 );
echo '
';
// Reiter Google.
echo '
';
$typen = array(
'product' => __( 'Product', '3task-review-box' ),
'movie' => __( 'Movie', '3task-review-box' ),
'series' => __( 'TV series', '3task-review-box' ),
'season' => __( 'Season', '3task-review-box' ),
'episode' => __( 'Episode', '3task-review-box' ),
'game' => __( 'Video game', '3task-review-box' ),
'software' => __( 'Software or app', '3task-review-box' ),
'book' => __( 'Book', '3task-review-box' ),
'recipe' => __( 'Recipe', '3task-review-box' ),
'course' => __( 'Course', '3task-review-box' ),
'event' => __( 'Event', '3task-review-box' ),
'music' => __( 'Music recording', '3task-review-box' ),
'playlist' => __( 'Music playlist', '3task-review-box' ),
'local' => __( 'Local business (not your own)', '3task-review-box' ),
'organization' => __( 'Organization (not your own)', '3task-review-box' ),
'none' => __( 'No schema', '3task-review-box' ),
);
self::auswahl( 'threerb[item][type]', __( 'Type for Google', '3task-review-box' ), $box['item']['type'], $typen );
self::auswahl(
'threerb[display]',
__( 'Look', '3task-review-box' ),
$box['display'],
array(
'default' => __( 'As in settings', '3task-review-box' ),
'bars' => __( 'Bars', '3task-review-box' ),
'stars' => __( 'Stars', '3task-review-box' ),
'profile' => __( 'Profile', '3task-review-box' ),
)
);
self::auswahl(
'threerb[style]',
__( 'Style', '3task-review-box' ),
$box['style'],
array(
'default' => __( 'As in settings', '3task-review-box' ),
'theme' => __( 'Theme colours', '3task-review-box' ),
'night' => __( 'Night', '3task-review-box' ),
)
);
self::auswahl(
'threerb[heading]',
__( 'Heading level', '3task-review-box' ),
$box['heading'],
array(
'default' => __( 'As in settings', '3task-review-box' ),
'h2' => 'H2',
'h3' => 'H3',
'h4' => 'H4',
)
);
echo '
';
echo '
' . esc_html__( 'Output review schema for Google', '3task-review-box' ) . '
';
echo '
' . esc_html__( 'I sell this product myself (then no pros and cons markup, as Google requires)', '3task-review-box' ) . '
';
echo '
' . esc_html__( 'I review a business that is not my own', '3task-review-box' ) . '
';
echo '
';
self::text( 'threerb[item][url]', __( 'Official page of the item (optional)', '3task-review-box' ), $box['item']['url'], 300 );
self::text( 'threerb[item][date]', __( 'Event date (YYYY-MM-DD, events only)', '3task-review-box' ), $box['item']['date'], 10 );
echo '
';
echo '
' . esc_html__( 'Check', '3task-review-box' ) . ' ';
foreach ( self::checks( $post, $box ) as $c ) {
printf( ' %2$s ', esc_attr( $c[0] ), esc_html( $c[1] ) );
}
echo ' ';
echo '