<?php /* Smarty version 2.6.26, created on 2017-04-06 08:08:43
         compiled from /home3/bargaip4/public_html/gevimmo/plugins/multiField/admin/multi_formats.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'cat', '/home3/bargaip4/public_html/gevimmo/plugins/multiField/admin/multi_formats.tpl', 24, false),array('modifier', 'count', '/home3/bargaip4/public_html/gevimmo/plugins/multiField/admin/multi_formats.tpl', 174, false),array('modifier', 'strtolower', '/home3/bargaip4/public_html/gevimmo/plugins/multiField/admin/multi_formats.tpl', 364, false),)), $this); ?>
<link href="<?php echo @RL_PLUGINS_URL; ?>
multiField/static/aStyle.css" type="text/css" rel="stylesheet" />

<!-- navigation bar -->
<div id="nav_bar">
	<?php if ($this->_tpl_vars['aRights'][$this->_tpl_vars['cKey']]['add']): ?>
		<?php if (! $_GET['action'] && ! $_GET['parent']): ?>
			<a href="<?php echo $this->_tpl_vars['rlBaseC']; ?>
action=add" class="button_bar"><span class="left"></span><span class="center_add"><?php echo $this->_tpl_vars['lang']['mf_add_item']; ?>
</span><span class="right"></span></a>
		<?php elseif ($_GET['parent']): ?>
			<a onclick="$('#search').slideDown();$('#new_item').slideUp('fast');$('#edit_item').slideUp('fast');" href="javascript:void(0)" class="button_bar"><span class="left"></span><span class="center_search"><?php echo $this->_tpl_vars['lang']['search']; ?>
</span><span class="right"></span></a>
			<a href="javascript:void(0)" onclick="show('new_item');$('#edit_item').slideUp('fast');$('#related_fields').slideUp('fast');$('#search').slideUp('fast')" class="button_bar"><span class="left"></span><span class="center_add"><?php echo $this->_tpl_vars['lang']['add_item']; ?>
</span><span class="right"></span></a>
			<a href="javascript:void(0)" onclick="show('related_fields');$('#new_item').slideUp('fast');$('#edit_item').slideUp('fast');$('#search').slideUp('fast');<?php if ($this->_tpl_vars['geo_filter']): ?>$('#load_cont').slideUp('fast');<?php endif; ?>" class="button_bar"><span class="left"></span><span class="center_list"><?php echo $this->_tpl_vars['lang']['mf_related_fields']; ?>
</span><span class="right"></span></a>
			<a href="javascript:void(0)" id="load_button" class="button_bar"><span class="left"></span><span class="center_import"><?php echo $this->_tpl_vars['lang']['mf_import_flsource']; ?>
</span><span class="right"></span></a>
		<?php elseif ($_GET['action'] == 'edit'): ?>
			<a href="<?php echo $this->_tpl_vars['rlBaseC']; ?>
parent=<?php echo $_GET['item']; ?>
" class="button_bar"><span class="left"></span><span class="center_build"><?php echo $this->_tpl_vars['lang']['mf_manage_items']; ?>
</span><span class="right"></span></a>
		<?php endif; ?>		
	<?php endif; ?>

	<?php if ($_GET['action'] == 'add'): ?>
		<a href="<?php echo $this->_tpl_vars['rlBase']; ?>
index.php?controller=<?php echo $_GET['controller']; ?>
" class="button_bar"><span class="left"></span><span class="center_list"><?php echo $this->_tpl_vars['lang']['mf_formats_list']; ?>
</span><span class="right"></span></a>
	<?php endif; ?>
</div>
<!-- navigation bar end -->

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=@RL_PLUGINS)) ? $this->_run_mod_handler('cat', true, $_tmp, 'multiField') : smarty_modifier_cat($_tmp, 'multiField')))) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'admin') : smarty_modifier_cat($_tmp, 'admin')))) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'import_interface.tpl') : smarty_modifier_cat($_tmp, 'import_interface.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<!-- load from server -->
<div id="load_cont" class="hide" style="margin-top:15px">
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'm_block_start.tpl') : smarty_modifier_cat($_tmp, 'm_block_start.tpl')), 'smarty_include_vars' => array('key' => 'fl_load','loading' => 1,'fixed' => 0,'navigation' => false)));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
		<div class="white block_loading" style="height:57px" id="flsource_container"></div>
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'm_block_end.tpl') : smarty_modifier_cat($_tmp, 'm_block_end.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
</div>
<!-- load from server end -->

<?php if ($_GET['parent']): ?>

	<!-- search -->
	<div id="search" class="hide">
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'm_block_start.tpl') : smarty_modifier_cat($_tmp, 'm_block_start.tpl')), 'smarty_include_vars' => array('block_caption' => $this->_tpl_vars['lang']['search'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
	
	<form method="post" onsubmit="return false;" id="search_form" action="">
		<table class="form">
		<tr>
			<td class="name"><?php echo $this->_tpl_vars['lang']['mf_name']; ?>
</td>
			<td class="field">
				<input type="text" id="search_name" />
			</td>
		</tr>
		<tr>
			<td></td>
			<td class="field">
				<input type="submit" class="button" value="<?php echo $this->_tpl_vars['lang']['search']; ?>
" id="search_button" />
				<input type="button" class="button" value="<?php echo $this->_tpl_vars['lang']['reset']; ?>
" id="reset_search_button" />
			
				<a class="cancel" href="javascript:void(0)" onclick="$('#search').slideUp('fast')"><?php echo $this->_tpl_vars['lang']['cancel']; ?>
</a>
			</td>
		</tr>
		
		</table>
	</form>
	
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'm_block_end.tpl') : smarty_modifier_cat($_tmp, 'm_block_end.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
	</div>
	
	<script type="text/javascript">
	var remote_filters = new Array();
	<?php echo '
	
	var search = new Array();
	var cookie_filters = new Array();

	$(document).ready(function(){
		
		if ( readCookie(\'mf_sc\') || remote_filters.length > 0 )
		{
			$(\'#search\').show();
			cookie_filters = remote_filters.length > 0 ? remote_filters : readCookie(\'mf_sc\').split(\',\');

			for (var i in cookie_filters)
			{
				if ( typeof(cookie_filters[i]) == \'string\' )
				{
					var item = cookie_filters[i].split(\'||\');
					if ( item[0] != \'undefined\' && item[0] != \'\' )
					{													
						$(\'#search_\'+item[0].toLowerCase()).selectOptions(item[1]);					
					}
				}
			}
		}
		
		$(\'#search_form\').submit(function(){
			createCookie(\'tags_pn\', 0, 1);
			search = new Array();
			search.push( new Array(\'action\', \'search\') );
			search.push( new Array(\'Name\', $(\'#search_name\').val()) );
			search.push( new Array(\'Parent\', \''; ?>
<?php echo $_GET['parent']; ?>
<?php echo '\') );

			var save_search = new Array();
			for(var i in search)
			{
				if ( search[i][1] != \'\' && typeof(search[i][1]) != \'undefined\'  )
				{
					save_search.push(search[i][0]+\'||\'+search[i][1]);
				}
			}
			createCookie(\'mf_sc\', save_search, 1);
			
			itemsGrid.filters = search;
			itemsGrid.reload();
		});
		
		$(\'#reset_search_button\').click(function(){
			eraseCookie(\'mf_sc\');
			itemsGrid.reset();
			
			$("#search select option[value=\'\']").attr(\'selected\', true);
			$("#search input[type=text]").val(\'\');
			$("#search input").each(function(){
				if ( $(this).attr(\'type\') == \'radio\' )
				{
					$(this).attr(\'checked\', false);
				}
			});
		});
		
	});
	
	'; ?>

	</script>
	<!-- search end -->
<?php endif; ?>

<?php if ($_GET['action']): ?>

	<?php $this->assign('sPost', $_POST); ?>
	<!-- add/edit -->
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'm_block_start.tpl') : smarty_modifier_cat($_tmp, 'm_block_start.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
	<form action="<?php echo $this->_tpl_vars['rlBaseC']; ?>
action=<?php if ($_GET['action'] == 'add'): ?>add<?php elseif ($_GET['action'] == 'edit'): ?>edit&amp;item=<?php echo $_GET['item']; ?>
<?php endif; ?>" method="post">
		<input type="hidden" name="submit" value="1" />
		<?php if ($_GET['action'] == 'edit'): ?>
			<input type="hidden" name="fromPost" value="1" />
		<?php endif; ?>

		<?php if ($_GET['action'] != 'edit'): ?>
			<table class="form">
			<tr>
				<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['mf_type']; ?>
</td>
				<td class="field">
					<?php if ($this->_tpl_vars['sPost']['type'] == 'new'): ?>
						<?php $this->assign('type_new', 'checked="checked"'); ?>
					<?php elseif ($this->_tpl_vars['sPost']['type'] == 'ex'): ?>
						<?php $this->assign('type_ex', 'checked="checked"'); ?>
					<?php else: ?>
						<?php $this->assign('type_new', 'checked="checked"'); ?>
					<?php endif; ?>
					<label><input <?php echo $this->_tpl_vars['type_new']; ?>
 class="lang_add" type="radio" name="type" value="new" /> <?php echo $this->_tpl_vars['lang']['mf_type_new']; ?>
</label>
					<label><input <?php echo $this->_tpl_vars['type_ex']; ?>
 class="lang_add" type="radio" name="type" value="ex" /> <?php echo $this->_tpl_vars['lang']['mf_type_ex']; ?>
</label>
				</td>
			</tr>
			</table>
		<?php endif; ?>

		<div id="new_format_cont">
			<table class="form">
			<tr>
				<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['key']; ?>
</td>
				<td class="field">
					<input <?php if ($_GET['action'] == 'edit'): ?>readonly="readonly"<?php endif; ?> class="<?php if ($_GET['action'] == 'edit'): ?>disabled<?php endif; ?>" name="key" type="text" style="width: 150px;" value="<?php echo $this->_tpl_vars['sPost']['key']; ?>
" maxlength="30" />
				</td>
			</tr>
			<tr>
				<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['mf_name']; ?>
</td>
				<td class="field">
					<?php if (count($this->_tpl_vars['allLangs']) > 1): ?>
						<ul class="tabs">
							<?php $_from = $this->_tpl_vars['allLangs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['langF'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['langF']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['language']):
        $this->_foreach['langF']['iteration']++;
?>
							<li lang="<?php echo $this->_tpl_vars['language']['Code']; ?>
" <?php if (($this->_foreach['langF']['iteration'] <= 1)): ?>class="active"<?php endif; ?>><?php echo $this->_tpl_vars['language']['name']; ?>
</li>
							<?php endforeach; endif; unset($_from); ?>
						</ul>
					<?php endif; ?>
					
					<?php $_from = $this->_tpl_vars['allLangs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['langF'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['langF']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['language']):
        $this->_foreach['langF']['iteration']++;
?>
						<?php if (count($this->_tpl_vars['allLangs']) > 1): ?>
							<div class="tab_area<?php if (! ($this->_foreach['langF']['iteration'] <= 1)): ?> hide<?php endif; ?> <?php echo $this->_tpl_vars['language']['Code']; ?>
">
						<?php endif; ?>
						<input type="text" name="name[<?php echo $this->_tpl_vars['language']['Code']; ?>
]" value="<?php echo $this->_tpl_vars['sPost']['name'][$this->_tpl_vars['language']['Code']]; ?>
" style="width: 250px;" maxlength="50" />
						<?php if (count($this->_tpl_vars['allLangs']) > 1): ?>
							<span class="field_description_noicon"><?php echo $this->_tpl_vars['lang']['name']; ?>
 (<b><?php echo $this->_tpl_vars['language']['name']; ?>
</b>)</span></div>
						<?php endif; ?>
					<?php endforeach; endif; unset($_from); ?>
				</td>
			</tr>
			<tr>
				<td class="name"><?php echo $this->_tpl_vars['lang']['mf_order_type']; ?>
</td>
				<td class="field">
					<select name="order_type">
						<option value="alphabetic" <?php if ($this->_tpl_vars['sPost']['order_type'] == 'alphabetic'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['alphabetic_order']; ?>
</option>
						<option value="position" <?php if ($this->_tpl_vars['sPost']['order_type'] == 'position'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['position_order']; ?>
</option>
					</select>
				</td>
			</tr>
			</table>
		</div>

		<div id="data_entries_cont">
			<table class="form">	
			<tr>
				<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['mf_data_entry']; ?>
</td>
				<td class="field">
					<select name="data_entry" <?php if ($_GET['action'] == 'edit'): ?>disabled="disabled"<?php endif; ?>>
						<option value="0"><?php echo $this->_tpl_vars['lang']['select']; ?>
</option>
						<?php $_from = $this->_tpl_vars['data_entries']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item']):
?>
							<option <?php if ($_POST['data_format'] == $this->_tpl_vars['item']['Key']): ?>selected="selected"<?php endif; ?> value="<?php echo $this->_tpl_vars['item']['Key']; ?>
"><?php echo $this->_tpl_vars['item']['name']; ?>
</option>
						<?php endforeach; endif; unset($_from); ?>
					</select>
				</td>
			</tr>
			</table>
		</div>

		<table class="form">
		<tr>
			<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['mf_geofilter']; ?>
</td>
			<td class="field">
				<?php if ($this->_tpl_vars['sPost']['geo_filter'] == '1'): ?>
					<?php $this->assign('geofilter_yes', 'checked="checked"'); ?>
				<?php elseif ($this->_tpl_vars['sPost']['geo_filter'] == '0'): ?>
					<?php $this->assign('geofilter_no', 'checked="checked"'); ?>
				<?php else: ?>
					<?php $this->assign('geofilter_no', 'checked="checked"'); ?>
				<?php endif; ?>

				<label><input <?php echo $this->_tpl_vars['geofilter_yes']; ?>
 <?php if ($this->_tpl_vars['geo_disabled']): ?>disabled="disabled"<?php endif; ?> class="lang_add" type="radio" name="geo_filter" value="1" /> <?php echo $this->_tpl_vars['lang']['enabled']; ?>
</label>
				<label><input <?php echo $this->_tpl_vars['geofilter_no']; ?>
 <?php if ($this->_tpl_vars['geo_disabled']): ?>disabled="disabled"<?php endif; ?> class="lang_add" type="radio" name="geo_filter" value="0" /> <?php echo $this->_tpl_vars['lang']['disabled']; ?>
</label>
				
			</td>
		</tr>
		<tr>
			<td class="name"><?php echo $this->_tpl_vars['lang']['status']; ?>
</td>
			<td class="field">
				<select name="status">
					<option value="active" <?php if ($this->_tpl_vars['sPost']['status'] == 'active'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['active']; ?>
</option>
					<option value="approval" <?php if ($this->_tpl_vars['sPost']['status'] == 'approval'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['approval']; ?>
</option>
				</select>
			</td>
		</tr>
		<tr>
			<td></td>
			<td class="field">
				<input type="submit" value="<?php if ($_GET['action'] == 'edit'): ?><?php echo $this->_tpl_vars['lang']['edit']; ?>
<?php else: ?><?php echo $this->_tpl_vars['lang']['add']; ?>
<?php endif; ?>" />
			</td>
		</tr>
		</table>
	</form>
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'm_block_end.tpl') : smarty_modifier_cat($_tmp, 'm_block_end.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
	<!-- add end -->
	<script type="text/javascript">
		<?php echo '
		$(document).ready(function(){
			$(\'input[name=type]\').change(function(){
				typesChangeHandler();
			});

			'; ?>


							typesChangeHandler();
						<?php echo '
		});
		var typesChangeHandler = function(){
			if( $(\'input[name=type]:checked\').val() == \'ex\')
			{
				$(\'#new_format_cont\').slideUp();
				$(\'#data_entries_cont\').slideDown();
			}else
			{
				$(\'#new_format_cont\').slideDown();
				$(\'#data_entries_cont\').slideUp();
			}
		};
		'; ?>

	</script>
<?php else: ?>
	<!-- add new item -->
	<div id="new_item" class="hide">
		<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'm_block_start.tpl') : smarty_modifier_cat($_tmp, 'm_block_start.tpl')), 'smarty_include_vars' => array('block_caption' => $this->_tpl_vars['lang']['add_item'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
		<form onsubmit="addItem();$('input[name=item_submit]').val('<?php echo $this->_tpl_vars['lang']['loading']; ?>
');return false;" action="" method="post">
		<table class="form">
		<tr>
			<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['key']; ?>
</td>
			<td class="field"><span class="field_description_noicon" style="padding:0"><?php echo $_GET['parent']; ?>
_</span>
				<input type="text" id="ni_key" style="width: 200px;" maxlength="60" />
			</td>
		</tr>

		<?php if ($this->_tpl_vars['geo_filter']): ?>
			<tr>
				<td class="name"><?php echo $this->_tpl_vars['lang']['mf_path']; ?>
</td>
	
				<td class="field"><span class="field_description_noicon" style="padding:0"><?php echo @RL_URL_HOME; ?>
<?php if ($this->_tpl_vars['parent_path']): ?><?php echo $this->_tpl_vars['parent_path']; ?>
/<?php endif; ?></span>
					<input type="text" id="ni_path" style="width: 200px;" maxlength="60" />
				</td>
			</tr>
		<?php endif; ?>

		<tr>
			<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['value']; ?>
</td>
			<td class="field">
				<?php if (count($this->_tpl_vars['allLangs']) > 1): ?>
					<ul class="tabs">
						<?php $_from = $this->_tpl_vars['allLangs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['langF'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['langF']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['language']):
        $this->_foreach['langF']['iteration']++;
?>
						<li lang="<?php echo $this->_tpl_vars['language']['Code']; ?>
" <?php if (($this->_foreach['langF']['iteration'] <= 1)): ?>class="active"<?php endif; ?>><?php echo $this->_tpl_vars['language']['name']; ?>
</li>
						<?php endforeach; endif; unset($_from); ?>
					</ul>
				<?php endif; ?>
				
				<?php $_from = $this->_tpl_vars['allLangs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['langF'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['langF']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['language']):
        $this->_foreach['langF']['iteration']++;
?>
					<?php if (count($this->_tpl_vars['allLangs']) > 1): ?><div class="tab_area<?php if (! ($this->_foreach['langF']['iteration'] <= 1)): ?> hide<?php endif; ?> <?php echo $this->_tpl_vars['language']['Code']; ?>
"><?php endif; ?>
					<input id="ni_<?php echo $this->_tpl_vars['language']['Code']; ?>
" type="text" style="width: 250px;" />
					<?php if (count($this->_tpl_vars['allLangs']) > 1): ?>
						<span class="field_description_noicon"><?php echo $this->_tpl_vars['lang']['name']; ?>
 (<b><?php echo $this->_tpl_vars['language']['name']; ?>
</b>)</span>
					</div>
					<?php endif; ?>
				<?php endforeach; endif; unset($_from); ?>
			</td>
		</tr>
		
		<tr>
			<td class="name"><?php echo $this->_tpl_vars['lang']['status']; ?>
</td>
			<td class="field">
				<select id="ni_status">
					<option value="active" <?php if ($this->_tpl_vars['sPost']['status'] == 'active'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['active']; ?>
</option>
					<option value="approval" <?php if ($this->_tpl_vars['sPost']['status'] == 'approval'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['approval']; ?>
</option>
				</select>
			</td>
		</tr>

		<tr>
			<td></td>
			<td class="field">
				<input type="submit" name="item_submit" value="<?php echo $this->_tpl_vars['lang']['add']; ?>
" />
				<a onclick="$('#new_item').slideUp('normal')" href="javascript:void(0)" class="cancel"><?php echo $this->_tpl_vars['lang']['close']; ?>
</a>
			</td>
		</tr>
		</table>
		</form>
		<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'm_block_end.tpl') : smarty_modifier_cat($_tmp, 'm_block_end.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
	</div>

	<!-- related fields list -->
	<div id="related_fields" class="hide">
		<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'm_block_start.tpl') : smarty_modifier_cat($_tmp, 'm_block_start.tpl')), 'smarty_include_vars' => array('block_caption' => $this->_tpl_vars['lang']['mf_related_fields'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
		<table class="form">
		<tr>
			<td class="name" style="width:215px"><?php echo $this->_tpl_vars['lang']['mf_related_listing_fields']; ?>
</td>
			<td class="field">
				<?php $_from = $this->_tpl_vars['related_listing_fields']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['field']):
?>
					<div>
						<?php echo $this->_tpl_vars['lang']['name']; ?>
: <b><?php echo $this->_tpl_vars['field']['name']; ?>
 / </b>
						<?php echo $this->_tpl_vars['lang']['key']; ?>
: <b><?php echo $this->_tpl_vars['field']['Key']; ?>
 / </b>
						<a href="index.php?controller=listing_fields&action=edit&field=<?php echo $this->_tpl_vars['field']['Key']; ?>
" target="_blank"><?php echo ((is_array($_tmp=$this->_tpl_vars['lang']['edit'])) ? $this->_run_mod_handler('strtolower', true, $_tmp) : strtolower($_tmp)); ?>
</a>
					</div>
				<?php endforeach; else: ?>
					<span class="field_description_noicon"><?php echo $this->_tpl_vars['lang']['mf_no_related_fields']; ?>
</span>
				<?php endif; unset($_from); ?>
			</td>
		</tr>
		<tr>
			<td class="name"><?php echo $this->_tpl_vars['lang']['mf_related_account_fields']; ?>
</td>
			<td class="field">
				<?php $_from = $this->_tpl_vars['related_account_fields']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['field']):
?>
					<div>
						<?php echo $this->_tpl_vars['lang']['name']; ?>
: <b><?php echo $this->_tpl_vars['field']['name']; ?>
 / </b>
						<?php echo $this->_tpl_vars['lang']['key']; ?>
: <b><?php echo $this->_tpl_vars['field']['Key']; ?>
 / </b>
						<a href="index.php?controller=account_fields&action=edit&field=<?php echo $this->_tpl_vars['field']['Key']; ?>
" target="_blank" style="margin-left:5px"><?php echo ((is_array($_tmp=$this->_tpl_vars['lang']['edit'])) ? $this->_run_mod_handler('strtolower', true, $_tmp) : strtolower($_tmp)); ?>
</a>
					</div>
				<?php endforeach; else: ?>
					<span class="field_description_noicon"><?php echo $this->_tpl_vars['lang']['mf_no_related_fields']; ?>
</span>
				<?php endif; unset($_from); ?>
			</td>
		</tr>
		</table>
		<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'm_block_end.tpl') : smarty_modifier_cat($_tmp, 'm_block_end.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
	</div>

	<!-- edit item -->
	<div id="edit_item" class="hide">
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'm_block_start.tpl') : smarty_modifier_cat($_tmp, 'm_block_start.tpl')), 'smarty_include_vars' => array('block_caption' => $this->_tpl_vars['lang']['edit_item'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
		<div id="prepare_edit_area">
			<div id="ei_loading" class="open_load" style="margin: 6px 0 0 10px;"><?php echo $this->_tpl_vars['lang']['preparing']; ?>
</div>
		</div>
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'm_block_end.tpl') : smarty_modifier_cat($_tmp, 'm_block_end.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
	</div>
	<!-- edit item end -->

	<?php echo '
	<script type="text/javascript">
	var addItem = function(){
	'; ?>

		var names = new Array();

		<?php $_from = $this->_tpl_vars['allLangs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['languages']):
?>
		names['<?php echo $this->_tpl_vars['languages']['Code']; ?>
'] = $('#ni_<?php echo $this->_tpl_vars['languages']['Code']; ?>
').val();
		<?php endforeach; endif; unset($_from); ?>

		xajax_addItem( $('#ni_key').val(), names, $('#ni_status').val(), '<?php echo $_GET['parent']; ?>
'<?php if ($this->_tpl_vars['geo_filter']): ?>, $('#ni_path').val()<?php endif; ?>);
	<?php echo '
	}
	</script>
	'; ?>

	
	<?php echo '
	<script type="text/javascript">
	var editItem = function(key){
	'; ?>

		var names = new Array();
	
		<?php $_from = $this->_tpl_vars['allLangs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['languages']):
?>
		names['<?php echo $this->_tpl_vars['languages']['Code']; ?>
'] = $('#ei_<?php echo $this->_tpl_vars['languages']['Code']; ?>
').val();
		<?php endforeach; endif; unset($_from); ?>

		xajax_editItem(key, names, $('#ei_status').val(), '<?php echo $_GET['parent']; ?>
'<?php if ($this->_tpl_vars['geo_filter']): ?>, $('#ei_path').val()<?php endif; ?>);
	<?php echo '
	}
	</script>
	'; ?>

	<!-- add new item end -->

	<!-- multi formats grid -->
	<div id="grid"></div>
	<script type="text/javascript">//<![CDATA[
	<?php if ($_GET['parent']): ?>
		var itemsGrid;
		var parent = '<?php echo $_GET['parent']; ?>
';
		
		<?php echo '
		$(document).ready(function(){			
			'; ?>
<?php if (! $this->_tpl_vars['level'] || $this->_tpl_vars['parent_default']): ?><?php echo '
				Ext.grid.defaultColumn = function(config){
				    Ext.apply(this, config);
				    if(!this.id){
					this.id = Ext.id();
				    }
				    this.renderer = this.renderer.createDelegate(this);
				};

				Ext.grid.defaultColumn.prototype = {
				    init : function(grid){
					this.grid = grid;
					this.grid.on(\'render\', function(){
					    var view = this.grid.getView();
					    view.mainBody.on(\'mousedown\', this.onMouseDown, this);
					}, this);
				    },
				    onMouseDown : function(e, t){
					if( t.className && t.className.indexOf(\'x-grid3-cc-\'+this.id) != -1 )
					{
					    e.stopEvent();
					    var index = this.grid.getView().findRowIndex(t);
					    var record = this.grid.store.getAt(index);
					    record.set(this.dataIndex, !record.data[this.dataIndex]);
							Ext.Ajax.request({
								waitMsg: \'Saving changes...\',
								url: rlPlugins + \'multiField/admin/multi_formats.inc.php?q=ext\',
								method: \'GET\',
								params:
								{
									action: \'update\',
									id: record.id,
									field: this.dataIndex,
									value: record.data[this.dataIndex]
								},
								failure: function()
								{
									Ext.MessageBox.alert(\'Error saving changes...\');
								},
								success: function()
								{
									itemsGrid.store.commitChanges();
									itemsGrid.reload();
								}
							});
					}
				    },
				    renderer : function(v, p, record){
					p.css += \' x-grid3-check-col-td\'; 	
						return \'<div ext:qtip="\'+lang[\'ext_set_default\']+\'" class="x-grid3-check-col\'+(v?\'-on\':\'\')+\' x-grid3-cc-\'+this.id+\'">&#160;</div>\';
				    }
				};
				var defaultColumn = new Ext.grid.defaultColumn({
					header: lang[\'ext_default\'],
					dataIndex: \'Default\',
					width: 60,
					fixed: true
				});
			'; ?>
<?php endif; ?><?php echo '
			itemsGrid = new gridObj({
				key: \'data_items\',
				id: \'grid\',
				ajaxUrl: rlPlugins + \'multiField/admin/multi_formats.inc.php?q=ext&parent=\'+parent,
				defaultSortField: \'name\',
				remoteSortable: true,
				title: lang[\'ext_multi_formats_manager\'],
				fields: [
					{name: \'ID\', mapping: \'ID\', type: \'int\'},
					{name: \'name\', mapping: \'name\', type: \'string\'},
					{name: \'Position\', mapping: \'Position\', type: \'int\'},
					{name: \'Status\', mapping: \'Status\'},
					{name: \'Key\', mapping: \'Key\'},
					{name: \'Icons\', mapping: \'Icons\'},
					'; ?>
<?php if (! $this->_tpl_vars['level']): ?><?php echo '
					{name: \'Default\', mapping: \'Default\'}
					'; ?>
<?php endif; ?><?php echo '
				],
				columns: [
					{
						header: lang[\'ext_name\'],
						dataIndex: \'name\',
						width: 40,
						id: \'rlExt_item_bold\'
					},
					'; ?>
<?php if ($this->_tpl_vars['order_type'] == 'position'): ?><?php echo '{
						header: lang[\'ext_position\'],
						dataIndex: \'Position\',
						width: 70,
						fixed: true,
						editor: new Ext.form.NumberField({
							allowBlank: false,
							allowDecimals: false
						}),
						renderer: function(val){
							return \'<span ext:qtip="\'+lang[\'ext_click_to_edit\']+\'">\'+val+\'</span>\';
						}
					},'; ?>
<?php endif; ?><?php echo '
					'; ?>
<?php if (! $this->_tpl_vars['level']): ?><?php echo '
						defaultColumn,
					'; ?>
<?php endif; ?><?php echo '
					{
						header: lang[\'ext_status\'],
						dataIndex: \'Status\',
						width: 80,
						fixed: true,
						editor: new Ext.form.ComboBox({
							store: [
								[\'active\', lang[\'ext_active\']],
								[\'approval\', lang[\'ext_approval\']]
							],
							displayField: \'value\',
							valueField: \'key\',
							typeAhead: true,
							mode: \'local\',
							triggerAction: \'all\',
							selectOnFocus:true
						})
					},{
						header: lang[\'ext_actions\'],
						width: 70,
						fixed: true,
						dataIndex: \'Key\',
						sortable: false,
						renderer: function(val, obj, row){
							var out = "<center>";
							var splitter = false;
							var format_key = row.data.Key;

							var manage_href = rlUrlHome+"index.php?controller="+controller+"&amp;parent="+format_key;	
							out += "<a href="+manage_href+" ><img class=\'manage\' ext:qtip=\'"+lang[\'ext_manage\']+"\' src=\'"+rlUrlHome+"img/blank.gif\' /></a>";
							out += "<img class=\'edit\' ext:qtip=\'"+lang[\'ext_edit\']+"\' src=\'"+rlUrlHome+"img/blank.gif\' onClick=\'xajax_prepareEdit(\\""+val+"\\", \\""+format_key+"\\");$(\\"#edit_item\\").slideDown(\\"normal\\");$(\\"#new_item\\").slideUp(\\"fast\\");$(\\"#ei_loading\\").fadeIn(\\"fast\\")\' />";
							out += "<img class=\'remove\' ext:qtip=\'"+lang[\'ext_delete\']+"\' src=\'"+rlUrlHome+"img/blank.gif\' onClick=\'rlConfirm( \\""+lang[\'ext_notice_delete_item\']+"\\", \\"xajax_deleteItem\\", \\""+val+"\\", \\"section_load\\" )\' />";
							out += "</center>";
							
							return out;
						}
					}
				]
			});

			'; ?>
<?php if (! $this->_tpl_vars['level']): ?><?php echo '
				itemsGrid.plugins.push(defaultColumn);
			'; ?>
<?php endif; ?><?php echo '

			itemsGrid.init();
			grid.push(itemsGrid.grid);
		});
		'; ?>

	<?php else: ?>
		<?php echo '
		
		var multiFieldGrid;
		
		$(document).ready(function(){
			
			multiFieldGrid = new gridObj({
				key: \'multi_formats\',
				id: \'grid\',
				ajaxUrl: rlPlugins + \'multiField/admin/multi_formats.inc.php?q=ext\',
				defaultSortField: \'name\',
				title: lang[\'ext_multi_formats_manager\'],
				fields: [
					{name: \'ID\', mapping: \'ID\', type: \'int\'},
					{name: \'name\', mapping: \'name\', type: \'string\'},
					{name: \'Position\', mapping: \'Position\', type: \'int\'},
					{name: \'Status\', mapping: \'Status\'},
					{name: \'Key\', mapping: \'Key\'}
				],
				columns: [{
						header: lang[\'ext_name\'],
						dataIndex: \'name\',
						id: \'rlExt_item_bold\',
						width: 40
					},{
						header: lang[\'ext_status\'],
						dataIndex: \'Status\',
						width: 10,
						editor: new Ext.form.ComboBox({
							store: [
								[\'active\', lang[\'ext_active\']],
								[\'approval\', lang[\'ext_approval\']]
							],
							displayField: \'value\',
							valueField: \'key\',
							typeAhead: true,
							mode: \'local\',
							triggerAction: \'all\',
							selectOnFocus:true
						}),
						renderer: function(val){
							return \'<span ext:qtip="\'+lang[\'ext_click_to_edit\']+\'">\'+val+\'</span>\';
						}
					},{
						header: lang[\'ext_actions\'],
						width: 90,
						fixed: true,
						dataIndex: \'ID\',
						sortable: false,
						renderer: function(val, obj, row){
							var out = "<center>";
							var splitter = false;
							var format_key = row.data.Key;

							var manage_href = rlUrlHome+"index.php?controller="+controller+"&amp;parent="+format_key;	
							out += "<a href="+manage_href+" ><img class=\'manage\' ext:qtip=\'"+lang[\'ext_manage\']+"\' src=\'"+rlUrlHome+"img/blank.gif\' /></a>";
							out += "<a href="+rlUrlHome+"index.php?controller="+controller+"&action=edit&amp;item="+format_key+"><img class=\'edit\' ext:qtip=\'"+lang[\'ext_edit\']+"\' src=\'"+rlUrlHome+"img/blank.gif\' /></a>";
							out += "<img class=\'remove\' ext:qtip=\'"+lang[\'ext_delete\']+"\' src=\'"+rlUrlHome+"img/blank.gif\' onClick=\'rlConfirm( \\""+lang[\'ext_notice_delete_format\']+"\\", \\"xajax_deleteFormat\\", \\""+format_key+"\\", \\"section_load\\" )\' />";
							out += "</center>";
							
							return out;
						}
					}
				]
			});
			
			multiFieldGrid.init();
			grid.push(multiFieldGrid.grid);
			
		});
		'; ?>

	<?php endif; ?>

	<?php if ($_GET['parent']): ?>
	<?php echo '
		function handleSourceActs()
		{
			$(\'#import_button\').click(function(){
				$(this).val(\''; ?>
<?php echo $this->_tpl_vars['lang']['loading']; ?>
<?php echo '\');

				var values = \'\';
				$(\'div.td_div input:checked\').each(function(){
					values += $(this).val()+",";
				});
				xajax_importSource( values, $(\'input[name=table]\').val(), $(\'input#ignore_one:checked\').val() );
			});

			$(\'div.td_div input\').click(function(){
				if( $(\'div.td_div input:checked\').length  == 1 )
				{
					$(\'#checked_one_hint\').fadeIn();
				}else
				{
					$(\'#checked_one_hint\').fadeOut();
				}
			});
		}
		$(document).ready(function(){
			$.ajaxSetup({ cache: false });
		});
	'; ?>

	<?php endif; ?>
	//]]>
	</script>
<?php endif; ?>

<script type="text/javascript">
<?php echo '
	$(\'#load_button\').click(function(){
		if( $(\'#load_cont\').css(\'display\') == \'none\' )
		{
			xajax_listSources(\'{$smarty.get.parent}\');
		}
		show(\'load_cont\');
		$(\'#edit_item\').slideUp(\'fast\');
		$(\'#new_item\').slideUp(\'fast\');
		$(\'#related_fields\').slideUp(\'fast\');
	});
'; ?>

</script>

<script type="text/javascript" src="<?php echo @RL_PLUGINS_URL; ?>
multiField/static/lib.js"></script>

<!-- importing -->
<script type="text/javascript">//<![CDATA[[
	importExport.phrases['completed'] = "<?php echo $this->_tpl_vars['lang']['mf_import_completed']; ?>
";
	importExport.config['per_run'] = <?php echo $this->_tpl_vars['config']['mf_import_per_run']; ?>
;
//]]>
</script>

