<?php
// File: packages/zab_site/Configuration/SiteConfiguration/Overrides/site.php

$GLOBALS['SiteConfiguration']['site']['columns']['favicon'] = [
    'label' => 'Favicon',
    'config' => [
        'type' => 'input',
        'renderType' => 'inputLink',
        'fieldControl' => [
            'linkPopup' => [
                'options' => [
                    'blindLinkOptions' => 'page,url,mail,spec',
                    'blindLinkFields' => 'class,params,target,title',
                    'allowedExtensions' => 'ico,png,svg,webp',
                ],
            ],
        ],
    ],
];

$GLOBALS['SiteConfiguration']['site']['columns']['logo'] = [
    'label' => 'Site Logo',
    'config' => [
        'type' => 'input',
        'renderType' => 'inputLink',
        'fieldControl' => [
            'linkPopup' => [
                'options' => [
                    // Restrict to file selection only
                    'blindLinkOptions' => 'page,url,mail,spec',
                    'blindLinkFields' => 'class,params,target,title',
                    'allowedExtensions' => 'jpg,jpeg,png,svg,webp',
                ],
            ],
        ],
    ],
];

$GLOBALS['SiteConfiguration']['site']['columns']['address'] = [
    'label' => 'Address / Company Info',
    'config' => [
        'type' => 'text',
        'enableRichtext' => true,
        # Use the default configuration or a custom one like 'minimal'
        'richtextConfiguration' => 'default',
        'cols' => 40,
        'rows' => 5,
    ],
];

$GLOBALS['SiteConfiguration']['site']['columns']['notFoundPageId'] = [
    'label' => '404 Page ID',
    'config' => [
        'type' => 'number',
        'default' => 0,
    ],
];

$GLOBALS['SiteConfiguration']['site']['columns']['quickCheckPageId'] = [
    'label' => 'Quick Check Page ID (Set starting point page for link pages)',
    'config' => [
        'type' => 'number',
        'default' => 0,
    ],
];

// Add the fields to the 'General' tab or create a new one
$GLOBALS['SiteConfiguration']['site']['types']['0']['showitem'] .= ',--div--;Global Settings,favicon,logo,address,notFoundPageId,quickCheckPageId';



// Per-language fields
$GLOBALS['SiteConfiguration']['site_language']['columns']['header_bar_visible'] = [
    'label' => 'Show Alert Bar',
    'config' => [
        'type' => 'check',
        'renderType' => 'checkboxToggle',
        'default' => 0,
    ],
];

$GLOBALS['SiteConfiguration']['site_language']['columns']['header_bar_start_date'] = [
    'label' => 'Alert Bar Start Date',
    'config' => [
        'type' => 'datetime',
        'format' => 'datetime',
        'default' => 0,
    ],
];

$GLOBALS['SiteConfiguration']['site_language']['columns']['header_bar_end_date'] = [
    'label' => 'Alert Bar End Date',
    'config' => [
        'type' => 'datetime',
        'format' => 'datetime',
        'default' => 0,
    ],
];

$GLOBALS['SiteConfiguration']['site_language']['palettes']['header_bar_opt'] = [
    'showitem' => 'header_bar_visible, header_bar_start_date, header_bar_end_date'
];

$GLOBALS['SiteConfiguration']['site_language']['columns']['header_bar_text'] = [
    'label' => 'Alert Bar Text',
    'config' => [
        'type' => 'input',
        'size' => 100,
        // 'type' => 'text',
        // 'cols' => 40,
        // 'rows' => 5,
    ],
];

$GLOBALS['SiteConfiguration']['site_language']['columns']['header_btn_link'] = [
    'label' => 'Add Button (ex: url for login)',
    'config' => [
        'type' => 'input',
        'renderType' => 'inputLink',
        'fieldControl' => [
            'linkPopup' => [
                'options' => [
                    'blindLinkOptions' => 'file,folder,mail,spec,telephone',
                    'blindLinkFields' => 'class,params,target',
                ],
            ],
        ],
    ],
];

$GLOBALS['SiteConfiguration']['site_language']['columns']['header_most_searched'] = [
    'label' => 'Words Most Searched for the box search (one per line)',
    'config' => [
        'type' => 'text',
        'cols' => 40,
        'rows' => 6,
    ],
];

$GLOBALS['SiteConfiguration']['site_language']['types']['1']['showitem'] .= ',--div--;Header,--palette--;;header_bar_opt,header_bar_text,header_btn_link,header_most_searched';


