<?php
/**
 * Panel 404
 */

thim_customizer()->add_section(
    array(
        'id'       => '404_page',
        'panel'    => 'page_title_bar',
        'priority' => 150,
        'title'    => esc_html__( '404 Page', 'course-builder' ),
    )
);

thim_customizer()->add_field(
    array(
        'label'    => esc_attr__( 'Select a layout page title', 'course-builder' ),
        'id'       => '404_page_title_layout',
        'type'     => 'radio-image',
        'section'  => '404_page',
        'priority' => 1,
        'choices'  => array(
            "layout-1" => THIM_URI . 'assets/images/page-title/layouts/layout-1.jpg',
            "layout-2" => THIM_URI . 'assets/images/page-title/layouts/layout-2.jpg',
            "layout-3" => THIM_URI . 'assets/images/page-title/layouts/layout-3.jpg',
        ),
        'default'  => 'layout-1',
    )
);

// Enable or Disable Breadcrumb
thim_customizer()->add_field(
    array(
        'id'       => '404_show_breadcrumb',
        'type'     => 'switch',
        'label'    => esc_html__( 'Show/Hide Breadcrumb', 'course-builder' ),
        'tooltip'  => esc_html__( 'Allows to show or hide breadcrumb on page title bar. ', 'course-builder' ),
        'section'  => '404_page',
        'default'  => 1,
        'priority' => 2,
        'choices'  => array(
            true  => esc_html__( 'On', 'course-builder' ),
            false => esc_html__( 'Off', 'course-builder' ),
        ),
    )
);

// Enable or Disable Page Title
thim_customizer()->add_field(
    array(
        'id'       => '404_page_title_show_text',
        'type'     => 'switch',
        'label'    => esc_html__( 'Show Page Title', 'course-builder' ),
        'tooltip'  => esc_html__( 'Allows to show or hide page title area.', 'course-builder' ),
        'section'  => '404_page',
        'default'  => 1,
        'priority' => 5,
        'choices'  => array(
            true  => esc_html__( 'On', 'course-builder' ),
            false => esc_html__( 'Off', 'course-builder' ),
        ),
    )
);

thim_customizer()->add_field(
    array(
        'id'        => '404_page_title_custom_title',
        'type'      => 'text',
        'label'     => esc_html__( 'Custom Title', 'course-builder' ),
        'tooltip'   => esc_html__( 'Allows to set custom page title.', 'course-builder' ),
        'section'   => '404_page',
        'priority'  => 6,
        'transport' => 'postMessage',
        'js_vars'   => array(
            array(
                'element'  => 'body.error404 .page-title .banner-description',
                'function' => 'html',
            ),
        )
    )
);

thim_customizer()->add_field(
    array(
        'id'        => '404_page_title_custom_description',
        'type'      => 'textarea',
        'label'     => esc_html__( 'Custom Description', 'course-builder' ),
        'tooltip'   => esc_html__( 'Allows to set custom page title description.', 'course-builder' ),
        'section'   => '404_page',
        'default'   => '<strong class="br">The best demo education </strong> Be successful with Course Builder theme.',
        'priority'  => 7,
        'transport' => 'postMessage',
        'js_vars'   => array(
            array(
                'element'  => 'body.error404 .page-title .banner-description',
                'function' => 'html',
            ),
        )
    )
);

// Upload Background Image
thim_customizer()->add_field(
    array(
        'id'       => 'page_title_404_background_image',
        'type'     => 'image',
        'label'    => esc_html__( 'Background Image', 'course-builder' ),
        'tooltip'  => esc_html__( 'Allows to set background image for page title area of shop page.', 'course-builder' ),
        'section'  => '404_page',
        'priority' => 50,
        'default'  => THIM_URI . "/assets/images/page-title/bg.jpg",
        'js_vars'  => array(
            array(
                'element'  => '.error404 .main-top',
                'function' => 'css',
                'property' => 'background-image',
            ),
        ),
    )
);