<? INC Header.tmpl ?>

<form action="<? IF Edit ?>editchan<? ELSE ?>addchan<? ENDIF ?>" method="post">
	<? INC _csrf_check.tmpl ?>
	<div class="section">
		<input type="hidden" name="submitted" value="1" />
		<input type="hidden" name="user" value="<? VAR User ?>" />
		<? IF Edit ?><input type="hidden" name="name" value="<? VAR ChanName ?>" /><? ENDIF ?>

		<h3>Channel Info</h3>
		<div class="sectionbg">
			<div class="sectionbody">
				<? IF !Edit ?>
				<div class="subsection half">
					<div class="inputlabel">Channel Name:</div>
					<div><input type="text" name="name" value="" /></div>
					<br /><span class="info">If the channel has a key and you want to save the key, type: #CHAN KEY</span>
				</div>
				<? ENDIF ?>

				<div class="subsection">
					<div class="inputlabel">Buffer Count:</div>
					<div><input type="text" name="buffercount" value="<? VAR BufferCount ?>" size="10" /></div>
				</div>

				<div class="subsection">
					<div class="inputlabel">Default Modes:</div>
					<div><input type="text" name="defmodes" value="<? VAR DefModes ?>" size="10" /></div>
				</div>

			</div>
		</div>
	</div>

	<div class="section">
		<h3>Flags</h3>
		<div class="sectionbg">
			<div class="sectionbody lotsofcheckboxes">
				<span class="checkboxandlabel">
					<input type="checkbox" name="save" id="save" value="true"<? IF InConfig ?> checked="checked"<? ENDIF ?> />
					<label for="save">Save to config</label>
				</span>
				<? LOOP OptionLoop ?>
				<span class="checkboxandlabel">
					<input type="checkbox" name="<? VAR Name ?>" id="opt_<? VAR Name ?>" value="true"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> />
					<label for="opt_<? VAR Name ?>"><? VAR DisplayName ?></label>
				</span>
				<? ENDLOOP ?>
				<div style="clear:both;"></div>
			</div>
		</div>
	</div>

	<? LOOP EmbeddedModuleLoop ?>
		<? IF Embed ?>
		<div class="section">
			<h3>Module <? VAR ModName ?></h3>
			<? INC *Embed ?>
		</div>
		<? ENDIF ?>
	<? ENDLOOP ?>

	<div class="submitline">
		<input type="submit" value="<? IF Edit ?>Save<? ELSE ?>Add Channel<? ENDIF ?>" />
	</div>
</form>

<? INC Footer.tmpl ?>
