<div style="padding: 0 10px; margin-top: 20px;">
<?php
	if($viewMode == "normal" && !$isAdmin) {
		echo "<span>The available columns are configured by administrators. Please contact an administrator if changes are needed.</span>";
	}
	else if($viewMode == "normal") {
		echo "<p>Administrators can configure the options including the columns to add.</p>";
		echo "<a href=\"" . $baseUrl . "tools/add-domains.php?view=admin\"" . " class=\"btn btn-block btn-primary\">Switch to Admin</a>";
	}
	else {
		echo "<p class=\"label\">Admin Mode</p>";
		echo "<a href=\"" . $baseUrl . "tools/add-domains.php?view=normal\"" . " class=\"btn btn-block btn-primary\">Switch to Normal</a>";
	}
?>
</div>
		<div class="field-selection-panel">
            <div class="field-row">
                <label for="column_filter_mode">Column Filter</label>
                <select id="column_filter_mode"<?php echo $effectiveIsAdmin ? '' : ' disabled'; ?>>
                    <option value="custom_notes">Custom fields + Notes</option>
                    <option value="all"<?php echo $effectiveIsAdmin ? '' : ' hidden'; ?>>All editable fields</option>
                </select>
            </div>

            <h3>Field selection</h3>
            <p class="help-text">
                Select which editable domain fields you want to fill in for new domains.
            </p>
            <div id="columns-list" class="columns-list">
                Loading editable columns...
            </div>
            <div class="columns-list-note">
                Your selection will be saved for all users of this installation.
				<?php if ($effectiveIsAdmin): ?>
					&nbsp;Selected columns can be drag-dropped to change the order.
				<?php endif; ?>
            </div>

            <?php if ($effectiveIsAdmin): ?>
                <div class="config-actions" style="margin-top:15px;">
                    <p class="help-text">
                        When you are satisfied with the field configuration, click the button below to save it to the server. 
						Regular users (and admins in regular-user view) will automatically load this configuration.
                    </p>
                    <button type="button" class="btn btn-danger" id="export-config-btn">Save Configuration</button>
					<div id="config-save-status" class="submit-status-text"></div>
                </div>
            <?php endif; ?>
        </div>	