<?php /* Smarty version 2.6.26, created on 2017-04-06 05:53:21
         compiled from controllers/home.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'rlHook', 'controllers/home.tpl', 3, false),array('modifier', 'cat', 'controllers/home.tpl', 10, false),array('modifier', 'count', 'controllers/home.tpl', 59, false),array('modifier', 'escape', 'controllers/home.tpl', 62, false),)), $this); ?>
<!-- home tpl -->

<?php echo rlHook::load(array('name' => 'apTplHomeBeforeBlocks'), $this);?>


<table class="home_grag_drop" cellpadding="0" cellspacing="0">
<tr>
	<td valign="top" class="column1">
		<div class="sortable">
			<?php $_from = $this->_tpl_vars['ap_blocks']['column1']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['block']):
?>
				<?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, 'homeDragDrop_block.tpl') : smarty_modifier_cat($_tmp, 'homeDragDrop_block.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			<?php endforeach; endif; unset($_from); ?>
		</div>
	</td>
	<td class="vspace"></td>
	<td valign="top" class="column2">
		<div class="sortable">
			<?php $_from = $this->_tpl_vars['ap_blocks']['column2']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['block']):
?>
				<?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, 'homeDragDrop_block.tpl') : smarty_modifier_cat($_tmp, 'homeDragDrop_block.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			<?php endforeach; endif; unset($_from); ?>
		</div>
	</td>
</tr>

<tr>
	<td colspan="3" valign="top" class="column3">
		<div class="sortable">
			<?php $_from = $this->_tpl_vars['ap_blocks']['column3']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['block']):
?>
				<?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, 'homeDragDrop_block.tpl') : smarty_modifier_cat($_tmp, 'homeDragDrop_block.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			<?php endforeach; endif; unset($_from); ?>
		</div>
	</td>
</tr>

<tr>
	<td valign="top" class="column4">
		<div class="sortable">
			<?php $_from = $this->_tpl_vars['ap_blocks']['column4']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['block']):
?>
				<?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, 'homeDragDrop_block.tpl') : smarty_modifier_cat($_tmp, 'homeDragDrop_block.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			<?php endforeach; endif; unset($_from); ?>
		</div>
	</td>
	<td class="vspace"></td>
	<td valign="top" class="column5">
		<div class="sortable">
			<?php $_from = $this->_tpl_vars['ap_blocks']['column5']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['block']):
?>
				<?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, 'homeDragDrop_block.tpl') : smarty_modifier_cat($_tmp, 'homeDragDrop_block.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			<?php endforeach; endif; unset($_from); ?>
		</div>
	</td>
</tr>
</table>

<?php echo rlHook::load(array('name' => 'apTplHomeAfterBlocks'), $this);?>


<div class="hide" id="tmp_dom_blocks_store"></div>

<script type="text/javascript">
var notifications = '';
<?php if (count($this->_tpl_vars['notifications']) > 1): ?>
	notifications += '<ul>';
	<?php $_from = $this->_tpl_vars['notifications']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['notification']):
?>
		notifications += '<li style="list-style:initial"><?php echo ((is_array($_tmp=$this->_tpl_vars['notification'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'quotes') : smarty_modifier_escape($_tmp, 'quotes')); ?>
</li>';
	<?php endforeach; endif; unset($_from); ?>
	notifications += '</ul>';
<?php elseif ($this->_tpl_vars['notifications']): ?>
	notifications += '<?php echo ((is_array($_tmp=$this->_tpl_vars['notifications']['0'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'quotes') : smarty_modifier_escape($_tmp, 'quotes')); ?>
';
<?php endif; ?>

//<![CDATA[
<?php echo '

$(document).ready(function(){
	$(\'.home_grag_drop div.sortable\').sortable({
		placeholder: \'ui-state-highlight\',
		connectWith: \'.sortable\',
		handle: \'.move\',
		cursor: \'move\',
		forcePlaceholderSize: true,
		helper: \'clone\',
		opacity: 0.4,
		stop: function(event, ui){
			var column = $(ui.item).parent().parent().attr(\'class\');
			var items = \'\';
			var key = $(ui.item).attr(\'id\').split(\':\')[1];
			
			$(ui.item).parent().find(\'div.block\').each(function(){
				items += $(this).attr(\'id\').split(\':\')[1] +\'|\'+ $(this).index() +\',\';
			});
			
			items = items != \'\' ? rtrim(items, \',\') : items;
			
			/* save new arrangement */
			createCookie(\'ap_arrangement_\'+column, items, 365);

			/* fix all other entries */
			for ( var i=1; i<=5; i++ )
			{
				if ( column != \'column\'+i )
				{
					var cookie_line = readCookie(\'ap_arrangement_column\'+i);
					if ( cookie_line && cookie_line.indexOf(key) >= 0 )
					{
						var exp_line = cookie_line.split(\',\');
						
						for ( var j=0; j<exp_line.length; j++ )
						{
							var found_index = exp_line[j].indexOf(key);
							if ( found_index >= 0 )
							{
								exp_line.splice(j, 1);
							}
						}
						
						eraseCookie(\'ap_arrangement_column\'+i);
						if ( exp_line.length > 0 )
						{
							createCookie(\'ap_arrangement_column\'+i, exp_line.join(\',\'), 365);
						}
					}
				}
			}
		}
	}).disableSelection();

    if (notifications) {
        printMessage(\'alert\', notifications )
    }
});

'; ?>

//]]>
</script>

<?php echo rlHook::load(array('name' => 'apTplHomeBottom'), $this);?>


<!-- home tpl end -->