<?php
use MTC\Core\Setting;
?>
<tr>
    <td>
        <?=clean_page($module)?>
        <input type="hidden" name="settings[<?=$setting->id?>][key]" value="<?=clean_page($setting->key)?>" />
    </td>
    <td style="width:25%">
        <?=clean_page($setting->key)?>
        <br />
        <small><em><?=htmlentities($setting->description)?></em></small>
    </td>

    <td>
        <?=clean_page($setting->type)?>
    </td>

    <td>
        <textarea name="settings[<?=$setting->id?>][value]" style="width:90%" rows="1"><?=htmlentities($setting->value)?></textarea>
        <?php
        if (!empty($setting->value_original)) {
            $params = [
                'environment' => $_REQUEST['environment'],
                'action' => 'delete',
                'key' => $setting->key,
            ];
            ?>
            <br /><br />
            <small>
                <strong>Default:</strong>
                <?=Util::safe_truncate($setting->value_original, 30)?>
                <a href="?<?=http_build_query($params)?>" class="reset">(Reset)</a>
            </small>
            <?php
        }
        ?>
    </td>
    <td nowrap>
        <small>
        <?php
        if ($setting->updated_at !== null) {
            echo $setting->updated_at->format('c');
        }
        ?>
        </small>
    </td>
</tr>