{{admin_get_data_directories}}
{{admin_get_data_files}}
{{admin_get_asset_files}}
<div class="container">
	<div class="column_1">
		<div class="scroll">
			<div class="editor">
				#data/
			</div>			
			<ul>
				{{section name="i" loop=$directories_spool}}
					<li><a href="?section={{$directories_spool[i]}}">#data/{{$directories_spool[i]}}</a></li>
				{{/section}}
			</ul>
		</div>
	</div>
	<div class="column_2">
		<div class="scroll">
			{{if $mid == 'form'}}
				<div class="editor">
					#data/{{$section}}/{{$data}}
				</div>					
				<div class="editor">
					<input type="submit" value="back" onclick="location.href='?section={{$section}}&data={{$data}}&mid=defualt&right={{$right}}&key={{$key}}&asset={{$asset}}';" />
					<input type="submit" value="delete" onclick="location.href='?section={{$section}}&data={{$data}}&mid=confirm&right={{$right}}&key={{$key}}&asset={{$asset}}';" />
				</div>
				{{admin_get_form_fields}}
				<ul>
				{{section name="i" loop=$key_spool}}
					<li>
					{{$key_spool[i]}}
					<a class="field_preview" href="?section={{$section}}&data={{$data}}&mid=edit&right={{$right}}&key={{$smarty.section.i.index}}&asset={{$asset}}">
					{{$preview_spool[i]}}</a></li>
				{{/section}}
				</ul>
			{{elseif $mid == 'edit'}}
				{{admin_get_form_fields}}
				<div class="editor">
					#data/{{$section}}/{{$data}}
				</div>					
				<div class="editor">
					<input type="submit" value="back" onclick="location.href='?section={{$section}}&data={{$data}}&mid=form&right={{$right}}&key={{$key}}&asset={{$asset}}';" />
					<input type="submit" value="save" onclick="document.editor.submit()" />
					<input type="submit" value="p" onclick="insertAtCursor(document.getElementById('mytext'),'<p></p>')" />
					<input type="submit" value="b" onclick="insertAtCursor(document.getElementById('mytext'),'<strong></strong>')" />
					<input type="submit" value="i" onclick="insertAtCursor(document.getElementById('mytext'),'<i></i>')" />
					<input type="submit" value="|" onclick="insertAtCursor(document.getElementById('mytext'),'|')" />
					<input type="submit" value="link <<" onclick="insertAtCursor(document.getElementById('mytext'),'<a href=&quot;WEB_ADDRESS_HERE&quot;>LINK_TEXT_HERE</a>')" />
					<input type="submit" value="link >>" onclick="insertAtCursor(document.getElementById('mytext'),'<a href=&quot;WEB_ADDRESS_HERE&quot; target=&quot;_blank&quot;>LINK_TEXT_HERE</a>')" />
				</div>
				<form name="editor" action="?section={{$section}}&data={{$data}}&mid=save&right={{$right}}&key={{$key}}&key_name={{$key_spool[$key]}}&asset={{$asset}}" method="post" enctype="multipart/form-data">
<textarea name="{{$key_spool[$key]}}" id="mytext">
{{$value_spool[$key]}}
</textarea>
				</form>
			{{elseif $mid == 'save'}}
				<div class="editor">
					#data/{{$section}}/{{$data}}
				</div>
				{{admin_modify}}
				{{if $success == "true"}}
					<meta http-equiv="refresh" content="1;?section={{$section}}&data=&mid=default&right={{$right}}&key={{$key}}&asset={{$asset}}">
					<div class="editor">
						Good Nite!
					</div>			
				{{else}}
					<meta http-equiv="refresh" content="1;?section={{$section}}&data=&mid=default&right={{$right}}&key={{$key}}&asset={{$asset}}">
					<div class="editor">
						Oops!
					</div>			
				{{/if}}
			{{elseif $mid == 'new'}}
				<div class="editor">
					#data/{{$section}}/untitled
				</div>
				<div class="editor">
					<input type="submit" value="back" onclick="location.href='?section={{$section}}&data={{$data}}&mid=defualt&right={{$right}}&key={{$key}}&asset={{$asset}}';" />
					<form action="?section={{$section}}&data={{$data}}&mid=add&right={{$right}}&key={{$key}}&asset={{$asset}}" method="post" enctype="multipart/form-data">
						add: <input type="text" name="number" value="5" maxlength="3" size="4" />
						<input type="submit" value="go" />
					</form>
				</div>
			{{elseif $mid == 'add'}}
				<div class="editor">
					#data/{{$section}}/assets/{{$asset}}
				</div>				
				{{admin_add}}
				{{if $success == "true"}}
					<meta http-equiv="refresh" content="1;?section={{$section}}&data={{$data}}&mid=default&right=default&key={{$key}}&asset={{$asset}}">
					<div class="editor">
						Good Nite!
					</div>			
				{{else}}
					<meta http-equiv="refresh" content="1;?section={{$section}}&data={{$data}}&mid=default&right=default&key={{$key}}&asset={{$asset}}">
					<div class="editor">
						Oops! ({{$success}})
					</div>			
				{{/if}}				
			{{elseif $mid == 'confirm'}}
				<div class="editor">
					#data/{{$section}}/{{$data}}
				</div>
				<div class="editor">
					are you sure ?
					<input type="submit" value="no" onclick="location.href='?section={{$section}}&data={{$data}}&mid=default&right={{$right}}&key={{$key}}&asset={{$asset}}';" />
					<input type="submit" value="yes" onclick="location.href='?section={{$section}}&data={{$data}}&mid=delete&right={{$right}}&key={{$key}}&asset={{$asset}}';" />
				</div>	
			{{elseif $mid == 'delete'}}
				<div class="editor">
					#data/{{$section}}/{{$data}}
				</div>						
				{{admin_del}}
				{{if $success == "true"}}
					<meta http-equiv="refresh" content="1;?section={{$section}}&data={{$data}}&mid=default&right={{$right}}&key={{$key}}&asset={{$asset}}">
					<div class="editor">
						Good Nite!
					</div>			
				{{else}}
					<meta http-equiv="refresh" content="1;?section={{$section}}&data={{$data}}&mid=default&right={{$right}}&key={{$key}}&asset={{$asset}}">
					<div class="editor">
						Oops! ({{$success}})
					</div>			
				{{/if}}
			{{elseif $mid == 'schema_save'}}
				<div class="editor">
					#data/{{$section}}/schema
				</div>						
				{{admin_schema_save}}
				{{if $success == "true"}}
					<meta http-equiv="refresh" content="1;?section={{$section}}&data={{$data}}&mid=schema_editor&right={{$right}}&key={{$key}}&asset={{$asset}}">
					<div class="editor">
						Good Nite!
					</div>			
				{{else}}
					<meta http-equiv="refresh" content="1;?section={{$section}}&data={{$data}}&mid=default&right={{$right}}&key={{$key}}&asset={{$asset}}">
					<div class="editor">
						Oops! ({{$success}})
					</div>			
				{{/if}}				
			{{elseif $mid == 'schema_editor'}}
				<div class="editor">
					#data/{{$section}}/schema
				</div>
				<div class="editor">
					<input type="submit" value="back" onclick="location.href='?section={{$section}}&data={{$data}}&mid=default&right={{$right}}&key={{$key}}&asset={{$asset}}';" />
				</div>	
				{{admin_schema_spooler}}
				<form name="editor" action="?section={{$section}}&data={{$data}}&mid=schema_save&right={{$right}}&key={{$key}}&key_name={{$key_spool[$key]}}&asset={{$asset}}" method="post" enctype="multipart/form-data">
<textarea name="schema">
{{$schema}}
</textarea>
				</form>				
			{{else}}
			<div class="editor">
				#data/{{$section}}
			</div>
			<div class="editor">
				<input type="submit" value="add items" onclick="location.href='?section={{$section}}&data={{$data}}&mid=new&right={{$right}}&key={{$key}}&asset={{$asset}}';" />
				<input type="submit" value="schema" onclick="location.href='?section={{$section}}&data={{$data}}&mid=schema_editor&right={{$right}}&key={{$key}}&asset={{$asset}}';" />
			</div>					
			<ul>
				{{section name="i" loop=$data_spool}}
					<li><a href="?section={{$section}}&data={{$data_spool[i]}}&mid=form&right={{$right}}&key={{$key}}&asset={{$asset}}">{{$data_spool[i]}}</a></li>
				{{/section}}
			</ul>
			{{/if}}
		</div>
	</div>
	<div class="column_3">
		<div class="scroll">
			{{if $right == 'play'}}
				<div class="editor">
					#data/{{$section}}/assets/{{$asset}}
				</div>			
				<div class="editor">
					<input type="submit" value="back" onclick="location.href='?section={{$section}}&data={{$data}}&mid={{$mid}}&right=default&key={{$key}}&asset={{$asset}}';" />
					<input type="submit" value="delete" onclick="location.href='?section={{$section}}&data={{$data}}&mid={{$mid}}&right=confirm&key={{$key}}&asset={{$asset}}';" />
					<input class="filename" type="text" readonly="readonly" value="{{$asset}}" onclick="javascript:this.focus();this.select();" />			
				</div>
				{{if $asset_mime[$asset] == "gif" || "jpg" || "pjpg"}}
					<img src="../data/{{$section}}/assets/{{$asset}}" />
				{{/if}}
			{{elseif $right == 'upload'}}
				<div class="editor">
					#data/{{$section}}/assets/{{$post_file}}
				</div>			
				{{admin_upload}}
				{{if $success == "true"}}
					<meta http-equiv="refresh" content="1;?section={{$section}}&data={{$data}}&mid={{$mid}}&right=default&key={{$key}}&asset={{$asset}}">
					<div class="editor">
						Good Nite!
					</div>			
				{{else}}
					<meta http-equiv="refresh" content="1;?section={{$section}}&data={{$data}}&mid={{$mid}}&right=default&key={{$key}}&asset={{$asset}}">
					<div class="editor">
						Oops! ({{$success}})
					</div>			
				{{/if}}
			{{elseif $right == 'confirm'}}
				<div class="editor">
					#data/{{$section}}/assets/{{$asset}}
				</div>
				<div class="editor">
					are you sure ?
					<input type="submit" value="no" onclick="location.href='?section={{$section}}&data={{$data}}&mid={{$mid}}&right=play&key={{$key}}&asset={{$asset}}';" />
					<input type="submit" value="yes" onclick="location.href='?section={{$section}}&data={{$data}}&mid={{$mid}}&right=delete&key={{$key}}&asset={{$asset}}';" />
				</div>	
			{{elseif $right == 'delete'}}
				{{admin_del_asset}}
				{{if $success == "true"}}
					<meta http-equiv="refresh" content="1;?section={{$section}}&data={{$data}}&mid={{$mid}}&right=default&key={{$key}}&asset={{$asset}}">
					<div class="editor">
						#data/{{$section}}/assets/{{$asset}}
					</div>
					<div class="editor">
						Good Nite!
					</div>			
				{{else}}
					<meta http-equiv="refresh" content="1;?section={{$section}}&data={{$data}}&mid={{$mid}}&right=default&key={{$key}}&asset={{$asset}}">
					<div class="editor">
						Oops! ({{$success}})
					</div>			
				{{/if}}
			{{elseif $right == 'new'}}
				<div class="editor">
					#data/{{$section}}/assets/
				</div>			
				<div class="editor">
					<form action="?section={{$section}}&data={{$data}}&mid={{$mid}}&right=upload&key={{$key}}&asset={{$asset}}" method="post" enctype="multipart/form-data">
					add a file:&nbsp;
					<input type="file" name="file" /><input type="submit" value="go" />			
					</form>
				</div>				
			{{else}}
				<div class="editor">
					#data/{{$section}}/assets/
				</div>
				<div class="editor">
					<input type="submit" value="add new" onclick="location.href='?section={{$section}}&data={{$data}}&mid={{$mid}}&right=new&key={{$key}}&asset={{$asset}}';" />
				</div>			
				{{admin_get_asset_files}}
				{{section name="i" loop=$asset_spool}}
					<li><a href="?section={{$section}}&data={{$data}}&mid={{$mid}}&right=play&key={{$key}}&asset={{$asset_spool[i]}}">{{$asset_spool[i]}}</a></li>
				{{/section}}
			{{/if}}
		</div>
	</div>
</div>
