<?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/deeplinks/deeplinks.js'); ?>
<?php echo $this->headScript(); ?>

<div id="seotoaster" class="admindeeplinks" >
<div class="close_window" onclick="parent.tb_remove();"></div>
    
<div id="deeplinks-errors" class="errors" style="display:none;">
	<ul>
    <li id="anchor-exists-error" class="error">This anchor alredy exists.</li>
    <li id="anchor-regex-error" class="error">Anchor field must contain only letters and cant' be less than 3 charachters.</li>
    <li id="anchor-empty-error" class="error">Anchor text field can't be empty.</li>
    <li id="selectpage-empty-error" class="error">Select page url for deeplink.</li>
    <li id="page-empty-error" class="error">Url field must contain certain page.</li>
    <li id="invalid-url-error" class="error">Url field must contain correct url address.</li>
    <li id="empty-url-error" class="error">Url field can't be empty.</li>
	</ul>
</div>

<div id="deeplinks-success" class="success" style="display:none;">
   <ul>
    <li id="deeplink-added">Deeplink was added.</li>
    <li id="deeplink-edited">Deeplink was updated.</li>
   </ul>

</div>

<?php echo $this->form; ?>

<ul class="ultable" style="margin-top:20px;margin-bottom:40px;">
	<li style="width:300px;">{%Anchor Text%}</li>
	<li style="width:300px;text-align:center;">{%URL%}</li>
    <li style="width:50px;">{%Rel%}</li>
    <li style="width:50px;">{%Dest%}</li>
	<li style="width:50px;">{%Del%}</li>
</ul>

<div id="managedeeplist" style="margin-left:10px;height:290px;clear:both;overflow-y:auto;overflow-x:hidden;">
<div id ="mandeeplcontainer" class="mandeeplcontainer">
<?php if(isset($this->deeplinks) && !empty($this->deeplinks)):
    foreach ($this->deeplinks as $deeplink): ?>
	<div class="mandeepl" style="clear:both;" id="mandeepl-<?php echo $deeplink['id'];?>">
		<div class="mandeepname"><a onclick="fiilDeeplinkForm('<?php echo $deeplink['id'];?>');" title="Edit this deeplink" href="javascript:void(0);"><?php echo RCMS_Tools_Tools::divideStringOnParts(urldecode($deeplink['name'])); ?></a></div>
    <div class="mandeepu"><a title="Jump to URL" href="<?php echo $deeplink['url'];?>" target="_blank"><?php echo RCMS_Tools_Tools::divideStringOnParts(urldecode($deeplink['url'])); ?></a></div>
    <div class="mandeepthree">
    	<span><?php echo ($deeplink['nofollow']==1?"NF":"F"); ?></span>
    	<span><?php echo ucfirst($deeplink['type']); ?></span>
     	<span><img onclick="deleteDeeplink('<?php echo $deeplink['id']; ?>');" src="<?php echo $this->websiteUrl; ?>system/images/ico_delete.gif" title="Delete this deeplink" alt="ico-delete" style="cursor: pointer;"/></span>
    </div>
    <p style="clear:both;"></p>
   </div>
<?php endforeach; endif; ?>
</div></div>
<input type="hidden" id="hid-main-wsurl" name="hid-main-wsurl" value="<?php echo $this->websiteUrl; ?>" />
</div>