<? $this->load->view( $this->aSystemVar['template_viewer_root'] . 'admin/_header') ?>
	<div class="bigCaption">Add Custom Filed</div>

		<div id="custom_fields">

			<?= form_open('admin/customfield/save') ?>

			<table cellpadding="5" cellspacing="0" border="0" width="100%" summary="">
				<tr>
					<td class="key">
						Category:
						<div class="example">all subcategories will be affected</div>
					</td>
                    <td class="inputs">
						<select name="CategoryId">
							<option value="0">all categories</option>
							<? foreach ( $data['CategoryList'] as $aCategory ) : ?>
								<?= '<option value="' . $aCategory['Id'] . '" >' . $aCategory['Title'] . '</option>' ?>
							<? endforeach ?>
						</select>
					</td>
					<td>

					</td>
				</tr>
			
				<tr>
					<td class="key">
						Field name/title presented to the user:
					</td>
                    <td class="inputs">
                    	<input name="title" value="" type="text" />
					</td>
					<td>

					</td>
				</tr>
				<tr>
					<td class="key">
						Field id:
						<div class="example">allowed characters: alphanumeric, -(dash), _(underscore).</div>
					</td>
                    <td class="inputs">
                    	<input name="basename" type="text" value="" />
					</td>
                    <td>

					</td>
				</tr>

                <tr>
					<td class="key">
						Field type:
					</td>
                    <td class="inputs">
                        <select name="field_type" onChange="javascript: var vals=document.getElementById('field_values'); if ('radio'==this.value || 'check'==this.value || 'select'==this.value){vals.style.display='block';}else{vals.style.display='none';}">
							<option value="num">Numbers</option>
							<option value="tfield">Simple string</option>
							<option value="textarea">Textarea</option>
							<option value="radio">Radio buttons</option>
							<option value="check">Check buttons</option>
							<option value="select">Dropdown box</option>
						</select>
					</td>
                    <td>

					</td>
				</tr>
                <tr>
					<td class="key">
						Display field:
					</td>
                    <td class="inputs">
                        <label><input name="display" value="1" checked="checked" type="radio">Yes</label>
						<label><input name="display" value="0" type="radio">No</label>
					</td>
                    <td>

					</td>
				</tr>
                <tr>
					<td class="key">
						Field mode:
					</td>
                    <td class="inputs">
                        <div>
                        	<label>
							<input class="radio" name="mode" value="simple" checked="checked" type="radio" />
							The user is able to see and change this field.
							</label>
						</div>
						<div>
							<label>
							<input class="radio" name="mode" value="req" type="radio" />
							This is required field.
							</label>
						</div>
						<div>
							<label>
							<input class="radio" name="mode" value="adm" type="radio" />
							Hidden field: only administrators are able to see/fill out this field.
							</label>
						</div>
					</td>
                    <td>

					</td>
				</tr>

			</table>
            <div id="field_values" style="display:none;margin:10px;padding:5px;">
						<b>Values:</b>
						<br />
						<i>
						Set of values should be separated by newline. ( press "enter" after each value ;-)
						</i>
						<br />
						<textarea name="values" rows="5" cols="80"></textarea>
					</div>
<!--
					<div style="margin:10px;padding:5px;">
						<b>Field id:</b>
						<br />
						<input name="basename" type="text" value="">
					</div>

					<div style="margin:10px;padding:5px;">
						<b>Field type:</b>
						<br />
						<select name="field_type" onChange="javascript: var vals=document.getElementById('field_values'); if ('radio'==this.value || 'check'==this.value || 'select'==this.value){vals.style.display='block';}else{vals.style.display='none';}">
							<option value="num">Numbers</option>
							<option value="tfield">Single text field</option>
							<option value="textarea">Textarea</option>
							<option value="radio">Radio buttons</option>
							<option value="check">Check buttons</option>
							<option value="select">Dropdown box</option>
						</select>
					</div>

					<div style="margin:10px;padding:5px;">
						<b>Display field:</b>
						<br />
						<i>
						Setting this to 'no' will hide the field from site pages.
						</i>
						<br />
						<label><input name="display" value="1" checked="checked" type="radio">Yes</label>
						<label><input name="display" value="0" type="radio">No</label>
					</div>


					<div style="margin:10px;padding:5px;">
						<b>Field Mode:</b>
						<div>
							<input class="radio" name="mode" value="simple" checked="checked" type="radio">
							<i>
							The user is able to see and change this field.
							</i>
						</div>
						<div>
							<input class="radio" name="mode" value="req" type="radio">
							<i>
							This is required field.
							</i>
						</div>

						<div>
							<input class="radio" name="mode" value="adm" type="radio">
							<i>
							Hidden field: only administrators and moderators are able to see/fill out this field.
							</i>
						</div>
					</div>


					<div style="margin:10px;padding:5px;">
						<b>Field name/title presented to the user:</b>
						<br />
						<input name="title" value="" type="text">
					</div>

					<div id="field_values" style="display:none;margin:10px;padding:5px;">
						<b>Values:</b>
						<br />
						<i>
						Set of values should be sepatated by newline. ( press "enter" after each value ;-)
						</i>
						<br />
						<textarea name="values" rows="5" cols="80"></textarea>
					</div>
-->
					<div style="margin:10px;padding:5px;">
						<input type="submit" name="go" value="go" />
					</div>

			<?= form_close() ?>

		</div>

<? $this->load->view( $this->aSystemVar['template_viewer_root'] . 'admin/_footer') ?>