<?php
/**
 * Gamification Settings
 *
 * CSF settings section for Points, Badges & Achievements.
 *
 * @package Forumax
 * @since   2.3.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

CSF::createSection(
	$prefix,
	array(
		'title'  => __( 'Gamification', 'forumax' ),
		'icon'   => 'dashicons dashicons-awards',
		'fields' => array(

			// Main Toggle.
			array(
				'type'    => 'subheading',
				'content' => __( 'Badges, Achievements & Points', 'forumax' ),
			),

			array(
				'id'       => 'frmx_gamification_enabled',
				'type'     => 'switcher',
				'title'    => __( 'Enable Gamification', 'forumax' ),
				'subtitle' => __( 'Enable the points, badges and achievements system for your forum.', 'forumax' ),
				'default'  => false,
				'class'    => 'st-promax-notice',
			),

			// Points Configuration.
			array(
				'type'       => 'subheading',
				'content'    => __( 'Points Configuration', 'forumax' ),
				'dependency' => array( 'frmx_gamification_enabled', '==', true ),
			),

			array(
				'id'         => 'frmx_points_new_topic',
				'type'       => 'spinner',
				'title'      => __( 'New Topic Points', 'forumax' ),
				'subtitle'   => __( 'Points awarded when a user creates a new topic.', 'forumax' ),
				'default'    => 10,
				'min'        => 0,
				'max'        => 100,
				'step'       => 1,
				'dependency' => array( 'frmx_gamification_enabled', '==', true ),
				'class'      => 'st-promax-notice',
			),

			array(
				'id'         => 'frmx_points_new_reply',
				'type'       => 'spinner',
				'title'      => __( 'New Reply Points', 'forumax' ),
				'subtitle'   => __( 'Points awarded when a user posts a reply.', 'forumax' ),
				'default'    => 5,
				'min'        => 0,
				'max'        => 100,
				'step'       => 1,
				'dependency' => array( 'frmx_gamification_enabled', '==', true ),
				'class'      => 'st-promax-notice',
			),

			array(
				'id'         => 'frmx_points_received_vote',
				'type'       => 'spinner',
				'title'      => __( 'Received Vote Points', 'forumax' ),
				'subtitle'   => __( 'Points awarded when a user receives an upvote.', 'forumax' ),
				'default'    => 2,
				'min'        => 0,
				'max'        => 50,
				'step'       => 1,
				'dependency' => array( 'frmx_gamification_enabled', '==', true ),
				'class'      => 'st-promax-notice',
			),

			array(
				'id'         => 'frmx_points_topic_solved',
				'type'       => 'spinner',
				'title'      => __( 'Topic Solved Points', 'forumax' ),
				'subtitle'   => __( 'Points awarded when a topic is marked as solved.', 'forumax' ),
				'default'    => 15,
				'min'        => 0,
				'max'        => 100,
				'step'       => 1,
				'dependency' => array( 'frmx_gamification_enabled', '==', true ),
				'class'      => 'st-promax-notice',
			),

			array(
				'id'         => 'frmx_points_best_answer',
				'type'       => 'spinner',
				'title'      => __( 'Best Answer Points', 'forumax' ),
				'subtitle'   => __( 'Points awarded when a reply is selected as the best answer.', 'forumax' ),
				'default'    => 20,
				'min'        => 0,
				'max'        => 100,
				'step'       => 1,
				'dependency' => array( 'frmx_gamification_enabled', '==', true ),
				'class'      => 'st-promax-notice',
			),

			array(
				'id'         => 'frmx_points_received_fav',
				'type'       => 'spinner',
				'title'      => __( 'Received Favorite Points', 'forumax' ),
				'subtitle'   => __( 'Points awarded when a user favorites your topic.', 'forumax' ),
				'default'    => 1,
				'min'        => 0,
				'max'        => 50,
				'step'       => 1,
				'dependency' => array( 'frmx_gamification_enabled', '==', true ),
				'class'      => 'st-promax-notice',
			),

			array(
				'id'         => 'frmx_points_daily_login',
				'type'       => 'spinner',
				'title'      => __( 'Daily Login Points', 'forumax' ),
				'subtitle'   => __( 'Points awarded once per day when a user logs in.', 'forumax' ),
				'default'    => 1,
				'min'        => 0,
				'max'        => 50,
				'step'       => 1,
				'dependency' => array( 'frmx_gamification_enabled', '==', true ),
				'class'      => 'st-promax-notice',
			),

			// Display Settings.
			array(
				'type'       => 'subheading',
				'content'    => __( 'Display Settings', 'forumax' ),
				'dependency' => array( 'frmx_gamification_enabled', '==', true ),
			),

			array(
				'id'         => 'frmx_show_badges_profile',
				'type'       => 'switcher',
				'title'      => __( 'Show on User Profile', 'forumax' ),
				'subtitle'   => __( 'Display points, level and badges on the Forumax user profile page.', 'forumax' ),
				'default'    => true,
				'dependency' => array( 'frmx_gamification_enabled', '==', true ),
				'class'      => 'st-promax-notice',
			),
		),
	)
);
