<?php

    return [
        "type"           => "misc",
        "model"          => App\Models\Misc::class,
        "label"          => "Misc",
        "label_singular" => "Misc",
        "group"          => "none",
        "order"          => FALSE,
        "fields"         => [
            [
                "name"          => "title",
                "label"         => "Reference Title",
                "type"          => "textBox",
                "maxLength"     => 150,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|max:150",
                "inList"        => TRUE,
                "search"        => FALSE,
                "sort"          => TRUE
            ],
            [
                "name" => "top_up_button",
                "label" => "Top Up Button",
                "type" => "link",
                "multiLanguage" => true,
                "required" => false,
                "maxLabel" => 30,
                "objectTypes" => ["page"]
            ],
            [
                "name" => "login_button",
                "label" => "Login Button",
                "type" => "link",
                "multiLanguage" => true,
                "required" => false,
                "maxLabel" => 30,
                "objectTypes" => ["page"]
            ],
            [
                "name"          => "contact_email",
                "label"         => "Contact form E-mail",
                "type"          => "textBox",
                "maxLength"     => 255,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|email|max:255"
            ],
            [
                "name"          => "cookies_message",
                "label"         => "Cookies notice message",
                "type"          => "textBox",
                "maxLength"     => 200,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|max:200"
            ],
            [
                "name"          => "cookies_accept",
                "label"         => "Cookies notice accept button label",
                "type"          => "textBox",
                "maxLength"     => 30,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|max:30"
            ],
            [
                "name" => "cookies_cta1",
                "label" => "Cookies notice privacy link",
                "type" => "link",
                "multiLanguage" => true,
                "required" => false,
                "maxLabel" => 30,
                "objectTypes" => ["page"]
            ],
            [
                "name"          => "price_type",
                "label"         => "Price Type",
                "type"          => "selectBox",
                "list"          => [
                    "normal"      => "Normal",
                    "discount"    => "Promo",
                ],
                "defaultValue"  => "normal",
                "preValidation" => "trim",
                "validation"    => "",
                "placement"     => "sidebar"
            ],
            [
                "name"          => "discount",
                "label"         => "Discount Label",
                "type"          => "textBox",
                "maxLength"     => 20,
                "multiLanguage" => FALSE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:5|required_if:price_type,discount",
                "inList"        => FALSE,
                "search"        => FALSE,
                "sort"          => FALSE,
                "placement"     => "sidebar",
                "parent"        => [
                    "name"   => "price_type",
                    "values" => [
                        "discount"
                    ]
                ],
                "info" => "eg: -50%"
            ],
            [
                "name"          => "discount_text",
                "label"         => "Discount Price badge text",
                "type"          => "textArea",
                "maxLength"     => 200,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:200",
                "inList"        => FALSE,
                "search"        => FALSE,
                "sort"          => FALSE,
                "placement"     => "sidebar",
                "parent"        => [
                    "name"   => "price_type",
                    "values" => [
                        "discount"
                    ]
                ],
            ],
            [
                "name"          => "price_tag",
                "label"         => "Price tag label",
                "type"          => "textBox",
                "maxLength"     => 20,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:20",
                "inList"        => FALSE,
                "search"        => FALSE,
                "sort"          => FALSE,
                "placement"     => "sidebar",
                "parent"        => [
                    "name"   => "price_type",
                    "values" => [
                        "discount"
                    ]
                ],
            ],
            [
                "name"          => "price",
                "label"         => "Standard Price",
                "type"          => "textBox",
                "maxLength"     => 10,
                "multiLanguage" => FALSE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:10|required_if:price_type,normal,discount",
                "placement"     => "sidebar",
                "parent"        => [
                    "name"   => "price_type",
                    "values" => [
                        "normal",
                        "discount"
                    ]
                ],
            ],
            [
                "name"          => "discount_price",
                "label"         => "Discounted Price",
                "type"          => "textBox",
                "maxLength"     => 5,
                "multiLanguage" => FALSE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:10|required_if:price_type,discount",
                "placement"     => "sidebar",
                "parent"        => [
                    "name"   => "price_type",
                    "values" => [
                        "discount"
                    ]
                ],
            ],
            [
                "name"          => "roaming_options_label",
                "label"         => "Data Roaming Options Label",
                "type"          => "textBox",
                "maxLength"     => 50,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:50",
                "inList"        => FALSE,
                "search"        => FALSE,
                "sort"          => FALSE,
                "placement"     => "sidebar"
            ],
        ],
        "actions"        => [
            "edit", "insert", "delete"
        ]
    ];
