',
'header' => $this->html_header(),
'filter_bar' => $this->html_filter_bar(),
'quizzes' => $list_quiz,
'wrapper_end' => '
',
];
echo Template::combine_components( $tab );
}
public function html_header(): string {
$section = [
'wrapper' => '',
];
return Template::combine_components( $section );
}
public function html_filter_bar(): string {
$section = [
'wrapper_action' => '',
'edit' => $status !== PostModel::STATUS_TRASH ? sprintf(
'
',
esc_url( $edit_link ),
$edit_icon,
__( 'Edit', 'learnpress' )
) : '',
'action_expanded_button' => sprintf(
'
',
$more_actions_icon
),
'action_expanded_wrapper' => '
',
'action_expanded_duplicate' => sprintf( '%s', __( 'Are you sure?', 'learnpress' ), __( 'Are you sure you want to duplicate this quiz?', 'learnpress' ), __( 'Duplicate', 'learnpress' ) ),
'action_expanded_publish' => sprintf( '%s', __( 'Publish', 'learnpress' ) ),
'action_expanded_trash' => sprintf(
'%s',
$status === 'trash' ? ' style="display:none"' : '',
__( 'Trash', 'learnpress' )
),
'action_expanded_restore' => sprintf(
'%s',
$status !== 'trash' ? ' style="display:none"' : '',
__( 'Restore', 'learnpress' )
),
'action_expanded_delete' => sprintf( '%s', __( 'Delete', 'learnpress' ) ),
'action_expanded_wrapper_end' => '
',
'wrapper_end' => '
',
],
$quiz,
$settings
);
$cell_classes = [
'courses' => 'assigned',
'total_questions' => 'questions',
'quiz_status' => 'status',
];
$html_cells = [];
foreach ( $html_content as $key => $html ) {
$cell_class = $cell_classes[ $key ] ?? $key;
$html_cells[ $key ] = sprintf(
'