{include file="$admingentemplates/admin_top.tpl"}
<script language="JavaScript" type="text/javascript" src="{$site_root}{$template_root}/js/classifieds.js"></script>
<div class="back">
    <a href="{$site_url}{$site_root}/admin/admin_modules.php">{$lang.button.back}</a>
</div>
<div class="cr"></div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$lang.datasource.razdel_name}</div>
<div class="cr">&nbsp;</div>
<div class="cr">&nbsp;</div>
<div class="help_text" style="display:block;">
    <div class="close_help">
        <img src="{$site_root}{$template_root}/images/close_help.png" alt="">
    </div>
    <div class="help_body">
        <span class="help_title">{$lang.help}:</span>{$lang.admin_help.ds_hint}
    </div>
</div>
<div class="cr">&nbsp;</div>
<ul class="tabs">
    <li>
        <a href="admin_classified.php">{$lang.admin_menu.cat_manager}</a>
    </li>
    <li>
        <a href="admin_form_blocks.php">{$lang.admin_menu.form_blocks}</a>
    </li>
    <li>
        <a href="admin_patterns.php">{$lang.admin_menu.patterns}</a>
    </li>
    <li>
        <a class="current">{$lang.admin_menu.ref_datasources}</a>
    </li>
</ul>
<div class="user_operation_line" style="height: 5px;"></div><br>
<div class="cr"></div>
<div id="tooltip" onclick="hideToolTip()" style="text-align:center; background-color: #FFFFFF; border: 1px dotted; text-align: {$default_left}; position:absolute; display:none; padding:5px;"></div>
{literal}
<script type="text/javascript">
$(function() {
$('#tool_tip_4 *').tooltip();
});
</script>
{/literal}

<div id="datasource_table_div">
<!-- ADD FORM -->
	<form method="post" action="{$form_save.action}"  enctype="multipart/form-data" name=add_form>
	{$form_save.hiddens}
	<table  cellSpacing="3" cellPadding="0" >
		<tr>
			<td align="right" class="main_header_text">
				&nbsp;{$lang.datasource.name}:&nbsp;
			</td>
			<td class="main_content_text" align="left"><input type="text" name="name" maxlength="30"></td>
			<td class="main_content_text" align="left">
				<a class="admin_button_major" onclick="javascript: document.add_form.submit();">{$lang.button.add}<span>&nbsp;</span></a>
			</td>
		</tr>
	</table>
	</form>
<!-- /ADD FORM -->

<!--DATASOURCES LIST-->
	<table border=0 cellspacing=0 cellpadding=0 width="100%">
{*		{if $links}
			<tr bgcolor="#ffffff">
				<td height="20" colspan=3 align="left"  class="main_content_text" >{$links}</td>
			</tr>
		{/if}*}
		<tr class="table_header">
			<td class="main_header_text" align="center" width="20">{$lang.datasource.number}</td>
			<td class="main_header_text" align="center">{$lang.datasource.datasource}</td>
			<td class="main_header_text" align="right" width="100">{$lang.button.action}</td>
		</tr>
		{foreach name=s from=$ds key=key item=item}
			<tr {if $smarty.foreach.s.iteration mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
				<td class="main_content_text" align="center">{$smarty.foreach.s.iteration}</td>
				<td class="main_content_text" align="center">
					<a href="{$item.editlink}">{if $item.type=='fixed'}{assign var=lang_ref value=$item.name}{$lang.admin_menu.$lang_ref}{else}{$item.name}{/if}</a>
				</td>
				<td class="main_content_text" align="center">
					{if $item.type!='fixed'}
{*						<a class="admin_button" onclick="javascript: if(confirm('{$lang.datasource.del_ds_cnf|escape:javascript}')) location.href='{$item.dellink}';">{$lang.button.delete}<span>&nbsp;</span></a>
*}							<div class="block_action fr" style="display: none;">
								<div class="action_del" style="display: block;">
									<img height="16" alt="" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.delete}');return false" src="{$site_root}{$template_root}/images/photo_delete.png" onclick="javascript: if(confirm('{$lang.datasource.del_ds_cnf|escape:javascript}')) location.href='{$item.dellink}';">
								</div>
							</div>
					{else}
						&nbsp;
					{/if}
				</td>
			</tr>
			{foreachelse}
			<tr height="40">
			<td class="main_error_text" align="left" colspan="4" bgcolor="#FFFFFF">{$lang.datasource.empty}</td>
			</tr>
		{/foreach}
{*		{if $links}
			<tr bgcolor="#ffffff">
				<td height="20"  colspan=3 align="left"  class="main_content_text" >{$links}</td>
			</tr>
		{/if}
		<tr class="table_header"><td colspan="3"></td></tr>*}
                    <tr class="table_header">
                        <td colspan="3">
                            &nbsp;&nbsp;
                            {if $links}
                            {foreach item=item from=$links.pages}
                                &nbsp;<a onclick="PageList('datasource_table_div', '{$item.link}');" class="page_link" {if $item.selected} style=" font-weight: bold; text-decoration: none;" {/if}>{$item.name}</a>&nbsp;
                            {/foreach}
                            {/if}
                            <div class="page_navigation">
                            {if $links.previous}
                                <a onclick="PageList('datasource_table_div', '{$links.previous}');">< {$lang.content.previous} {$per_page}</a>
                            {/if}
                            {if $links.next}
                                <a onclick="PageList('datasource_table_div', '{$links.next}');">{$lang.content.next} {$per_page} ></a>
                            {/if}
                            </div>
                        </td>
                    </tr>		
	</table>
</div>
<script type="text/javascript">
{literal}
		function showToolTip(e,text){
			if(document.all)e = event;
			var obj = document.getElementById('tooltip');
			obj.innerHTML = text;
			obj.style.display = 'block';
			var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
			if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0;
			var leftPos = e.clientX - $('#tooltip').width()-10;
			if(leftPos<0)leftPos = 0;
			obj.style.left = leftPos + 'px';
			obj.style.top = e.clientY - obj.offsetHeight -10 + st + 'px';
		}
		function hideToolTip(){
			document.getElementById('tooltip').style.display = 'none';
		}
{/literal}		
</script>

<!--/DATASOURCES LIST-->
{include file="$admingentemplates/admin_bottom.tpl"}