<?php

/**
 * @var Mobicms\Render\Template\Template $this
 * @var array<string, mixed> $forum_config
 * @var string $form_action
 * @var string|null $error_message
 * @var string|null $success_message
 * @var string $csrf_token
 */

$this->layout('system::layout/default');
?>

<div style="max-width: 640px">
    <?php if (! empty($error_message)): ?>
        <div class="alert alert-danger shadow border-0"><?= $this->e($error_message) ?></div>
    <?php endif ?>
    <?php if (! empty($success_message)): ?>
        <div class="alert alert-success shadow border-0"><?= $this->e($success_message) ?></div>
    <?php endif ?>
    <form method="post" action="<?= $this->e($form_action) ?>">
        <input type="hidden" name="csrf_token" value="<?= $csrf_token ?>">
        <fieldset>
            <legend><?= __('Common settings') ?></legend>
            <div class="form-check">
                <input type="checkbox" class="form-check-input" name="file_counters" value="1" id="file_counters" <?= ($forum_config['file_counters'] ? 'checked="checked"' : '') ?>>
                <label class="form-check-label" for="file_counters"><?= __('Show file counters') ?></label>
            </div>
        </fieldset>
        <fieldset class="mt-3">
            <legend><?= __('SEO settings') ?></legend>
            <div class="form-group">
                <label for="forum_keywords"><?= __('Forum keywords') ?></label>
                <textarea name="forum_keywords" class="form-control" id="forum_keywords" cols="30" rows="2"><?= $this->e($forum_config['forum_keywords']) ?></textarea>
            </div>
            <div class="form-group">
                <label for="forum_description"><?= __('Forum description') ?></label>
                <textarea name="forum_description" class="form-control" id="forum_description" cols="30" rows="2"><?= $this->e($forum_config['forum_description']) ?></textarea>
            </div>
            <h3><?= __('Sections') ?></h3>
            <div class="form-group">
                <label for="section_keywords"><?= __('Section keywords') ?></label>
                <textarea name="section_keywords" class="form-control" id="section_keywords" cols="30" rows="2"><?= $this->e($forum_config['section_keywords']) ?></textarea>
                <div class="small text-muted"><?= __('Macros available: #name#, #description#') ?></div>
            </div>
            <div class="form-group">
                <label for="section_description"><?= __('Section description') ?></label>
                <textarea name="section_description" class="form-control" id="section_description" cols="30" rows="2"><?= $this->e($forum_config['section_description']) ?></textarea>
                <div class="small text-muted"><?= __('Macros available: #name#, #description#') ?></div>
            </div>
            <h3><?= __('Topics') ?></h3>
            <div class="form-group">
                <label for="topic_keywords"><?= __('Topic keywords') ?></label>
                <textarea name="topic_keywords" class="form-control" id="topic_keywords" cols="30" rows="2"><?= $this->e($forum_config['topic_keywords']) ?></textarea>
                <div class="small text-muted"><?= __('Macros available: #name#') ?></div>
            </div>
            <div class="form-group">
                <label for="topic_description"><?= __('Topic description') ?></label>
                <textarea name="topic_description" class="form-control" id="topic_description" cols="30" rows="2"><?= $this->e($forum_config['topic_description']) ?></textarea>
                <div class="small text-muted"><?= __('Macros available: #name#') ?></div>
            </div>
        </fieldset>
        <input type="submit" class="btn btn-primary mb-2" value="<?= __('Save') ?>"/>
    </form>
</div>
