<? I18N znc-webadmin ?>
<? INC Header.tmpl ?>

<form action="<? VAR URIPrefix TOP ?><? VAR ModPath TOP ?><? 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 ?>" />
		<input type="hidden" name="network" value="<? VAR Network ?>" />
		<? IF Edit ?><input type="hidden" name="name" value="<? VAR ChanName ?>" /><? ENDIF ?>

		<h3><? FORMAT "Channel Info" ?></h3>
		<div class="sectionbg">
			<div class="sectionbody">
				<? IF !Edit ?>
				<div class="subsection half">
					<div class="inputlabel"><label for="name"><? FORMAT "Channel Name:" ?></label></div>
					<input id="name" type="text" name="name" value=""
						   title="<? FORMAT "The channel name." ?>"/>
				</div>
				<? ENDIF ?>

				<div class="subsection">
					<div class="inputlabel"><label for="key"><? FORMAT "Key:" ?></label></div>
					<input id="key" type="text" name="key" value="<? VAR Key ?>" size="10"
						   title="<? FORMAT "The password of the channel, if there is one." ?>"/>
				</div>

				<div class="subsection">
					<div class="inputlabel"><label for="buffersize"><? FORMAT "Buffer size:" ?></label></div>
					<input id="buffersize" type="number" name="buffersize" value="<? VAR BufferSize ?>" size="10" min="0"
						   title="<? FORMAT "The buffer count." ?>"/>
				</div>

				<div class="subsection">
					<div class="inputlabel"><label for="defmodes"><? FORMAT "Default modes:" ?></label></div>
					<input id="defmodes" type="text" name="defmodes" value="<? VAR DefModes ?>" size="10"
						   title="<? FORMAT "The default modes of the channel." ?>"/>
				</div>

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

	<div class="section">
		<h3><? FORMAT "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"><? FORMAT "Save to config" ?></label>
				</span>
				<? LOOP OptionLoop ?>
				<span class="checkboxandlabel" title="<? VAR Tooltip ?>">
					<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 ESC= ?></label>
				</span>
				<? ENDLOOP ?>
				<div style="clear:both;"></div>
			</div>
		</div>
	</div>

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

	<div class="submitline">
		<? IF Edit ?>
		<input type="submit" name="submit_return" value="<? FORMAT "Save and return" ?>"/>
		<input type="submit" name="submit_continue" value="<? FORMAT "Save and continue" ?>"/>
		<? ELSE ?>
		<input type="submit" name="submit_return" value="<? FORMAT "Add Channel and return" ?>"/>
		<input type="submit" name="submit_continue" value="<? FORMAT "Add Channel and continue" ?>"/>
		<? ENDIF ?>
	</div>
</form>

<? INC Footer.tmpl ?>
