.
 */
use Alledia\OSMap\Helper\General;
use Alledia\OSMap\Sitemap\Item;
use Joomla\CMS\Language\Language;
defined('_JEXEC') or die();
/**
 * @var OSMapViewXml $this
 * @var string       $template
 * @var string       $layout
 * @var string       $layoutTemplate
 * @var Language     $lang
 * @var string       $filetofind
 */
$showExternalLinks = (int)$this->osmapParams->get('show_external_links', 0);
$ignoreDuplicates  = (int)$this->osmapParams->get('ignore_duplicated_uids', 1);
$debug             = $this->params->get('debug', 0) ? "\n" : '';
$printNodeCallback = function (Item $node) use ($showExternalLinks, $ignoreDuplicates, $debug) {
    $display = !$node->ignore
        && $node->published
        && (!$node->duplicate || !$ignoreDuplicates)
        && $node->visibleForRobots
        && $node->parentIsVisibleForRobots
        && $node->visibleForXML
        && trim($node->fullLink) != '';
    if ($display && !$node->isInternal) {
        // Show external links
        $display = $showExternalLinks === 1;
    }
    if (!$node->hasCompatibleLanguage()) {
        $display = false;
    }
    if (!$display) {
        return false;
    }
    echo $debug;
    echo '';
    echo 'fullLink . ']]>';
    if (!General::isEmptyDate($node->modified)) {
        echo '' . $node->modified . '';
    }
    echo '' . $node->changefreq . '';
    echo '' . $node->priority . '';
    echo '';
    echo $debug;
    return true;
};
echo $this->addStylesheet();
echo $debug . '' . $debug;
$this->sitemap->traverse($printNodeCallback);
echo '';