'
. ''
. ''
. '';
return 'data:image/svg+xml;base64,' . base64_encode( $svg );
}
public function add_menu() {
add_menu_page(
__( 'Adventura', 'adventura-interactive-advent-calendar' ),
__( 'Adventura', 'adventura-interactive-advent-calendar' ),
'manage_options',
self::SLUG,
array( $this, 'render_page' ),
$this->menu_icon(),
26
);
// Rename the auto-generated first submenu entry to "Übersicht".
add_submenu_page(
self::SLUG,
__( 'Übersicht', 'adventura-interactive-advent-calendar' ),
__( 'Übersicht', 'adventura-interactive-advent-calendar' ),
'manage_options',
self::SLUG,
array( $this, 'render_page' )
);
}
public function assets( $hook ) {
// Load the admin stylesheet on every Adventskalender screen.
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only screen detection for enqueueing assets; no state change.
$post_type = isset( $_GET['post_type'] ) ? sanitize_key( wp_unslash( $_GET['post_type'] ) ) : '';
if ( false !== strpos( (string) $hook, self::SLUG )
|| false !== strpos( (string) $hook, 'advk-' )
|| ADVK_Doors_CPT::POST_TYPE === $post_type ) {
wp_enqueue_style( 'advk-admin', ADVK_URL . 'assets/css/admin.css', array(), ADVK_VERSION );
}
}
public function render_page() {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
$stats = ADVK_Entries::stats();
$per_day = $stats['per_day'];
$max = max( 1, max( $per_day ) );
$kpis = array(
array(
'value' => number_format_i18n( $stats['total'] ),
'label' => __( 'Teilnahmen', 'adventura-interactive-advent-calendar' ),
/* translators: %s: number of unique e-mail addresses. */
'sub' => sprintf( __( '%s eindeutige E-Mails', 'adventura-interactive-advent-calendar' ), number_format_i18n( $stats['unique_emails'] ) ),
'accent' => '#b4452e',
'icon' => 'groups',
),
array(
'value' => number_format_i18n( $stats['full_correct'] ),
'label' => __( 'Alles richtig', 'adventura-interactive-advent-calendar' ),
/* translators: %d: hit rate as a percentage value. */
'sub' => sprintf( __( 'Trefferquote %d%%', 'adventura-interactive-advent-calendar' ), $stats['hit_rate'] ),
'accent' => '#2f6b4f',
'icon' => 'yes-alt',
),
array(
'value' => number_format_i18n( $stats['winners'] ),
'label' => __( 'Gewinner', 'adventura-interactive-advent-calendar' ),
'sub' => __( 'als Gewinner markiert', 'adventura-interactive-advent-calendar' ),
'accent' => '#caa24a',
'icon' => 'awards',
),
array(
'value' => (string) ADVK_Data::today_day(),
'label' => __( 'Heutiges Türchen', 'adventura-interactive-advent-calendar' ),
'sub' => ADVK_Data::today_day() ? __( 'aktiv', 'adventura-interactive-advent-calendar' ) : __( 'außerhalb Dezember', 'adventura-interactive-advent-calendar' ),
'accent' => '#3a6ea5',
'icon' => 'calendar-alt',
),
);
?>
' . esc_html( number_format_i18n( $stats['total'] ) ) . ''
);
?>
|
|
|
|
| first_name . ' ' . $r->last_name ) ); ?> |
email ); ?> |
code ); ?> |
invites ) ); ?> |