<?php require '../public/system/headers/headers.php';?>
<?php echo $this->headLink()->appendStylesheet($this->websiteUrl . 'system/css/seotoaster.css'); ?>
<?php echo $this->headLink()->appendStylesheet($this->websiteUrl . 'system/js/thickbox/thickbox.css'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl .'system/js/jquery/jquery.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/thickbox/thickbox.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl .'system/js/system.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl .'system/js/php.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl .'system/js/listpages/listpages.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl .'system/js/jquery/plugins/editable/akeditable.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl .'system/js/jquery/plugins/dragndrop/jquicustommin.js'); ?>
<?php echo $this->headScript(); ?>

<div id="seotoaster" class="adminorderpages">
	<input type="hidden" id="hid-ws-url" value="<?php echo $this->websiteUrl; ?>"/>
	<div id="admineditwhat">{%Organize pages%}</div>
	<div class="close_window" onclick="parent.tb_remove();"></div>
	<!-- =======  ORDERING SYSTEM LEGEND ================== -->
	<div id="orderlegend"><span id="ordercatname">{%Navigation Display%}</span><span id="orderh1">{%H1 Title Text%}</span><span id="orderpagekeywords">{%Keywords%}</span></div>

	<div class="adminpagelist">
		<!-- =======  ORDERING SYSTEM ================== -->
		<h2>{%MAIN MENU%} &nbsp;&nbsp; <input style="vertical-align:middel;" type="checkbox" name="checkMainMenu" id="checkMainMenu" onclick="checkAllMainMenu();"/>{% Check all? %}</h2>
		<?php foreach ($this->pages as $page): ?>
		<div id="<?php echo $page['id']; ?>" class="category-item">
			<div><span class="ordercathand"><img src="<?php echo $this->websiteUrl; ?>/system/images/icon_drag.png" width="16" height="16" /></span><span class="ordercatname"><?php echo $page['navigationTitle']; ?></span><span class="ordercath1" id="edit-h1-<?php echo $page['id']; ?>" onclick="editH1(this.id, '<?php echo $this->websiteUrl; ?>', <?php echo $page['id']; ?>)"><?php echo $page['h1']; ?></span><span class="orderpagekeywords" id="edit-key-<?php echo $page['id']; ?>" onclick="editKeywords(this.id, '<?php echo $this->websiteUrl; ?>', <?php echo $page['id']; ?>)"><?php echo $page['keywords']; ?></span><span class="show-hide">{show/hide}</div>
			<ul>
					<?php if(isset($page['pages']) && $page['pages']): ?>
						<?php foreach ($page['pages'] as $subPage): ?>
				<li id="<?php echo $subPage['id']; ?>" class="page" title="<?php echo $subPage['menu']; ?>">
					<span class="orderpagehand"><img src="<?php echo $this->websiteUrl; ?>/system/images/drag_icon.gif" width="16" height="16" /></span>
					<?php if($this->homePageId!=$subPage['id']){?>
					<span><input style="margin-top:3px;" type="checkbox" id="page-<?php echo $subPage['id']; ?>" name="<?php echo $subPage['id']; ?>" /> </span>
					<?php }else{ ?>
					<span style="width:15px;">&nbsp;</span>
					<?php }?>
					<span class="orderpagename"><a href="<?php echo $this->websiteUrl; ?>sys/backend_page/editpage/pageId/<?php echo $subPage['id']; ?>"><?php echo $subPage['navigationTitle']; ?></a></span><span class="orderpageh1" id="edit-h1-<?php echo $subPage['id']; ?>" onclick="editH1(this.id, '<?php echo $this->websiteUrl; ?>', <?php echo $subPage['id']; ?>)"><?php echo $subPage['h1']; ?></span><span class="orderpagekeywords" id="edit-key-<?php echo $subPage['id']; ?>" onclick="editKeywords(this.id, '<?php echo $this->websiteUrl; ?>', <?php echo $subPage['id']; ?>)"><?php echo $subPage['keywords']; ?></span>
				</li>
						<?php endforeach; ?>
					<?php endif; ?>
			</ul>
		</div>
		<?php endforeach; ?>
		<h2>{%STATIC MENU%}&nbsp;&nbsp; <input style="vertical-align:middel;" type="checkbox" name="checkStaticMenu" id="checkStaticMenu" onclick="checkAllStaticMenu();"/>{% Check all? %}</h2>
		<div id="staticMenuCheck" style="background: #ddd">
			<ul class="stat-pages">
				<?php if($this->staticPages): ?>
					<?php foreach ($this->staticPages as $statPage): ?>
				<li id="<?php echo $statPage['id']; ?>" class="statpage" title="<?php echo $statPage['menu']; ?>">
					<span class="orderpagehand"><img src="<?php echo $this->websiteUrl; ?>/system/images/drag_icon.gif" width="16" height="16" /></span>
					<?php if($this->homePageId!=$statPage['id']){?>
					<span><input style="margin-top:3px;" type="checkbox" id="page-<?php echo $statPage['id']; ?>" name="<?php echo $statPage['id']; ?>" /> </span>
					<?php }else{ ?>
					<span style="width:15px;">&nbsp;</span>
					<?php }?>
					<span class="orderpagename"><a href="<?php echo $this->websiteUrl; ?>sys/backend_page/editpage/pageId/<?php echo $statPage['id']; ?>"><?php echo $statPage['navigationTitle']; ?></a></span><span class="orderpageh1" id="stat-edit-h1-<?php echo $statPage['id']; ?>" onclick="editH1(this.id, '<?php echo $this->websiteUrl; ?>', <?php echo $statPage['id']; ?>)"><?php echo $statPage['h1']; ?></span><span class="orderpagekeywords" id="stat-edit-key-<?php echo $statPage['id']; ?>" onclick="editKeywords(this.id, '<?php echo $this->websiteUrl; ?>', <?php echo $statPage['id']; ?>)"><?php echo $statPage['keywords']; ?></span>
				</li>
					<?php endforeach; ?>
				<?php endif; ?>
			</ul>
		</div>
		<h2>{%NO MENU%} &nbsp;&nbsp; <input style="vertical-align:middel;" type="checkbox" name="checkNoCategory" id="checkNoCategory" onclick="checkNoCategoryMenu();"/>{% Check all? %}</h2>
		<div id="noCategory"  style="background: #ddd">
			<ul class="no-menu" style="min-height: 20px;">
				<?php if($this->nomenuPages): ?>
					<?php foreach ($this->nomenuPages as $nomenuPage): ?>
				<li id="<?php echo $nomenuPage['id']; ?>" class="nomenupage" title="<?php echo $nomenuPage['menu']; ?>">
					<span class="orderpagehand"><img src="<?php echo $this->websiteUrl; ?>/system/images/drag_icon.gif" width="16" height="16" /></span>
					<?php if($this->homePageId!=$nomenuPage['id']){?>
					<span><input style="margin-top:3px;" type="checkbox" id="page-<?php echo $nomenuPage['id']; ?>" name="<?php echo $nomenuPage['id']; ?>" /> </span>
					<?php }else{ ?>
					<span style="width:15px;">&nbsp;</span>
					<?php }?>
					<span class="orderpagename"><a href="<?php echo $this->websiteUrl; ?>sys/backend_page/editpage/pageId/<?php echo $nomenuPage['id']; ?>"><?php echo $nomenuPage['navigationTitle']; ?></a></span><span class="orderpageh1" id="nomenu-edit-h1-<?php echo $nomenuPage['id']; ?>" onclick="editH1(this.id, '<?php echo $this->websiteUrl; ?>', <?php echo $nomenuPage['id']; ?>)"><?php echo $nomenuPage['h1']; ?></span><span class="orderpagekeywords" id="nomenu-edit-key-<?php echo $nomenuPage['id']; ?>" onclick="editKeywords(this.id, '<?php echo $this->websiteUrl; ?>', <?php echo $nomenuPage['id']; ?>)"><?php echo $nomenuPage['keywords']; ?></span>
				</li>
					<?php endforeach; ?>
				<?php endif; ?>
			</ul>
		</div>
	</div>
	<input name="editcsssubmit" type="submit" value="{%Save%}" class="formsubmit" id="listsave"/>
	<button class="formsubmit" style="font-size:10px;" name="organazeActions" id="organazeActions" onclick="deletePages();">{%Delete selected%}</button>
	<input type="hidden" id="hid-main-wsurl" name="hid-main-wsurl" value="<?php echo $this->websiteUrl; ?>" />
</div>