<?php
includeContainer('_library_lib.php', 1);
setSessionLang();
$socInfo = getSocInfo();

$message = '';
if (!isModEnabled('eventorganization') || !isModEnabled('member') || !isModEnabled('don') || !isModEnabled('webportal')) {
    $message = $langs->trans("TEMPLATE_MODULES_NOTICE") ."<br><br>";
}


$item = $formSetup->newItem('WS_'.strtoupper($website->ref).'_' . 'USE_TEXT_LOGO')->setAsYesNo();
$item->nameText = $langs->trans("USE_TEXT_LOGO");

$item = $formSetup->newItem('WS_'.strtoupper($website->ref).'_' . 'CUSTOM_SLOGAN');
$item->nameText = $langs->trans("CUSTOM_SLOGAN");
$item->cssClass = 'minwidth500';

$item = $formSetup->newItem('WS_'.strtoupper($website->ref).'_' . 'CUSTOM_DESCRIPTION');
$item->nameText = $langs->trans("CUSTOM_DESCRIPTION");
$item->cssClass = 'minwidth500';

// Get available langs for the website
$TField = array();
$website_langs = getAvailableLangs();
$available_langs = $website_langs['langs'];
$langs_code_shortcode = $website_langs['langs_code_shortcode'];
foreach ($available_langs as $key => $value) {
    $TField[$key] = trim(explode('(', $langs->trans("Language_".$langs_code_shortcode[$key]))[0]);
}
$item = $formSetup->newItem('WS_'.strtoupper($website->ref).'_' . 'SUPPORTED_LANGS');
$item->nameText = $langs->trans("SUPPORTED_LANGS");
$item->setAsMultiSelect($TField);

$item = $formSetup->newItem('WS_'.strtoupper($website->ref).'_' . 'MAIN_COLOR');
$item->nameText = $langs->trans("MAIN_COLOR");
$item->cssClass = 'minwidth500';

$item = $formSetup->newItem('WS_'.strtoupper($website->ref).'_' . 'SECONDARY_COLOR');
$item->nameText = $langs->trans("SECONDARY_COLOR");
$item->cssClass = 'minwidth500';

if (isModEnabled('member')) {
    $formSetup->newItem('membersArea')->setAsTitle();
    
    $item = $formSetup->newItem('MEMBER_ENABLE_PUBLIC')->setAsYesNo();
    $item->nameText = $langs->trans("ENABLE_MEMBER_REGISTRATION_PAGE");
    
    $item = $formSetup->newItem('WS_'.strtoupper($website->ref).'_' . 'ENABLE_MEMBER_LIST_PAGE')->setAsYesNo();
    $item->nameText = $langs->trans("ENABLE_MEMBER_LIST_PAGE");
    
    if (isModEnabled('webportal')) {
        $item = $formSetup->newItem('WS_'.strtoupper($website->ref).'_' . 'ENABLE_MEMBER_AREA_PAGE')->setAsYesNo();
        $item->nameText = $langs->trans("ENABLE_MEMBER_AREA_PAGE");
    }
}

if (isModEnabled('eventorganization')) {
    $formSetup->newItem('eventsArea')->setAsTitle();
    $item = $formSetup->newItem('WS_'.strtoupper($website->ref).'_' . 'DISABLE_EVENTS_SECTION')->setAsYesNo();
    $item->nameText = $langs->trans("DISABLE_EVENTS_SECTION");
    
    $item = $formSetup->newItem('WS_'.strtoupper($website->ref).'_' . 'SHOW_EVENT_PARTICIPATE_LINK')->setAsYesNo();
    $item->nameText = $langs->trans("SHOW_EVENT_PARTICIPATE_LINK");
    
    $item = $formSetup->newItem('WS_'.strtoupper($website->ref).'_' . 'SHOW_EVENT_GOAL_RAISED_AMOUNTS')->setAsYesNo();
    $item->nameText = $langs->trans("SHOW_EVENT_GOAL_RAISED_AMOUNTS");
}

if (isModEnabled('don')) {
    $formSetup->newItem('DonationsArea')->setAsTitle();
    $item = $formSetup->newItem('DONATION_ENABLE_PUBLIC')->setAsYesNo();
    $item->nameText = $langs->trans("ENABLE_DONATION_PAGE");
    
    $item = $formSetup->newItem('DONATION_COUNTERS_ARE_PUBLIC')->setAsYesNo();
    $item->nameText = $langs->trans("DONATION_COUNTERS_ARE_PUBLIC");
}

?>
