<?php
use TourOperatorPro\Factory as FactoryAlias;
use TourOperatorPro\Html\TourOperatorProHtmlFrontend as TourOperatorProHtmlFrontendAlias;
use TourOperatorProBlock\block_top_destination\block_top_destination_helper;
use TourOperatorProFrontend\app\helpers\ConfigHelper as ConfigHelperAlias;
$doc= FactoryAlias::getDocument();
require_once __DIR__.DS."block_top_destination_helper.php";
TourOperatorProHtmlFrontendAlias::load_jquery_library('owlcarousel2');
$page_tour_detail= ConfigHelperAlias::get_page_tour_detail();
if($page_tour_detail) {
    $this->page_tour_detail = get_page_link($page_tour_detail);
}else{
    $this->page_tour_detail="";
}

$params=$this->item->params;
$limit=$params->get('limit',0);
$layout=$params->get('layout',0);
$list_destination=block_top_destination_helper::getList_destination($limit);


$layout = $this->item->params->get('layout', 'default');
$plugin_name=TOUROPERATORPRO_PLUGIN_NAME;
$template_path=get_template_directory();
$block_name= basename(__DIR__);
$layout_name="tmpl/$layout.php";
$template1_path="$template_path/$plugin_name/frontend/blocks/$block_name/$layout_name";
$template2_path= __DIR__ . "/tmpl/$layout.php";
if(file_exists($template1_path)){
    require $template1_path;
}else{
    require $template2_path;
}
?>