<?php /* Smarty version 2.6.26, created on 2020-06-25 13:10:58
         compiled from /home3/bargaip4/public_html/gevimmo/plugins/multiField/geo_box.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'end', '/home3/bargaip4/public_html/gevimmo/plugins/multiField/geo_box.tpl', 11, false),array('function', 'rlHook', '/home3/bargaip4/public_html/gevimmo/plugins/multiField/geo_box.tpl', 57, false),)), $this); ?>
<!-- Multi-Field Geo Filtering Box -->

<?php if ($this->_tpl_vars['config']['mf_geo_block_autocomplete'] && $this->_tpl_vars['geo_box_data']['levels_data'][0]): ?>
    <div class="mf-autocomplete kws-block">
        <input class="mf-autocomplete-input w-100" type="text" maxlength="64" placeholder="<?php echo $this->_tpl_vars['lang']['mf_geo_type_location']; ?>
" />
        <div class="mf-autocomplete-dropdown hide"></div>
    </div>

    <script class="fl-js-dynamic">
        var mf_script_loaded = false;
        var mf_current_key   = <?php if ($this->_tpl_vars['geo_filter_data']['location_keys']): ?>'<?php echo end($this->_tpl_vars['geo_filter_data']['location_keys']); ?>
'<?php else: ?>null<?php endif; ?>;

        rlPageInfo['Geo_filter'] = <?php if ($this->_tpl_vars['geo_filter_data']['is_location_url']): ?>true<?php else: ?>false<?php endif; ?>;

        <?php echo '
        $(function(){
            $(\'.mf-autocomplete-input\').on(\'focus keyup\', function(){
                if (!mf_script_loaded) {
                    flUtil.loadScript(rlConfig[\'plugins_url\'] + \'multiField/static/autocomplete.js\');
                    mf_script_loaded = true;
                }
            });
        });
        '; ?>

    </script>
<?php endif; ?>

<div class="gf-box list-view<?php if ($this->_tpl_vars['geo_box_data']['levels_data'][0]): ?> gf-has-levels<?php endif; ?>">
    <?php if ($this->_tpl_vars['geo_filter_data']['location']): ?>
        <ul class="list-unstyled gf-current">
            <?php $_from = $this->_tpl_vars['geo_filter_data']['location']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['item']):
?>
                <li>
                    <span class="hborder"></span>
                    <?php echo $this->_tpl_vars['item']['name']; ?>

                    <a title="<?php echo $this->_tpl_vars['item']['name']; ?>
"
                        <?php if ($this->_tpl_vars['geo_filter_data']['is_location_url']): ?>
                            href="<?php echo $this->_tpl_vars['item']['Parent_link']; ?>
"
                        <?php else: ?>
                            href="javascript://" class="gf-ajax" data-path="<?php echo $this->_tpl_vars['item']['Parent_path']; ?>
"
                        <?php endif; ?>><img class="remove" src="<?php echo $this->_tpl_vars['rlTplBase']; ?>
img/blank.gif" />
                    </a>
                </li>
            <?php endforeach; endif; unset($_from); ?>
        </ul>
    <?php endif; ?>
    
    <?php $this->assign('gf_col_class', 'col-lg-6 col-md-12 col-sm-3'); ?>

    <?php if ($this->_tpl_vars['block']['Side'] == 'top' || $this->_tpl_vars['block']['Side'] == 'middle' || $this->_tpl_vars['block']['Side'] == 'bottom'): ?>
        <?php if ($this->_tpl_vars['side_bar_exists']): ?>
            <?php $this->assign('gf_col_class', 'col-lg-3 col-md-4 col-sm-3'); ?>
        <?php else: ?>
            <?php $this->assign('gf_col_class', 'col-lg-2 col-md-3 col-sm-3'); ?>
        <?php endif; ?>
    <?php endif; ?>

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


    <?php if ($this->_tpl_vars['geo_box_data']['levels_data'][0]): ?>
    <div class="gf-container">
        <ul class="list-unstyled row">
            <?php $this->assign('level_data', $this->_tpl_vars['geo_box_data']['levels_data'][0]); ?>
            <?php $_from = $this->_tpl_vars['level_data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item']):
?>
                <li class="<?php echo $this->_tpl_vars['gf_col_class']; ?>
">
                    <a title="<?php echo $this->_tpl_vars['item']['name']; ?>
"
                        <?php if ($this->_tpl_vars['geo_filter_data']['is_location_url']): ?>
                            href="<?php echo $this->_tpl_vars['item']['Link']; ?>
"
                        <?php else: ?>
                            href="javascript://" class="gf-ajax"
                        <?php endif; ?>
                       data-path="<?php echo $this->_tpl_vars['item']['Path']; ?>
" data-key="<?php echo $this->_tpl_vars['item']['Key']; ?>
"><?php echo $this->_tpl_vars['item']['name']; ?>
</a>
                </li>
            <?php endforeach; endif; unset($_from); ?>
        </ul>
    </div>
    <?php elseif (! $this->_tpl_vars['geo_filter_data']['location']): ?>
        <?php echo $this->_tpl_vars['lang']['mf_geo_box_default']; ?>

    <?php endif; ?>
</div>

<?php if ($this->_tpl_vars['level_data']): ?>
<script class="fl-js-dynamic">
<?php echo '

$(function(){
    $(\'.gf-box .gf-container\').mCustomScrollbar();
});

'; ?>

</script>
<?php endif; ?>

<script class="fl-js-dynamic">
<?php echo '

$(\'.gf-box,.mf-autocomplete-dropdown\').on(\'click\', \'a.gf-ajax\', function(){
    flUtil.ajax({
        mode: \'mfApplyLocation\',
        item: $(this).data(\'path\'),
        key: $(this).data(\'key\')
    }, function(response, status) {
        if (status == \'success\' && response.status == \'OK\') {
            if (location.href.indexOf(\'?reset_location\') > 0) {
                location.href = location.href.replace(\'?reset_location\', \'\');
            } else {
                location.reload();
            }
        } else {
            printMessage(\'error\', lang[\'system_error\']);
        }
    });
});

'; ?>

</script>
<!-- Multi-Field Geo Filtering Box end -->