<?php
$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"] ?: array()) + array("_2b59ce9981d316b9c770f230e6e0" . "7752" => base64_decode("ZGFpbHk" . "="), "_44cd79b57c4d0eaf39cc6bfc6" . "8227f9b" => base64_decode("Li4vcHVibGlzaC" . "9jbGFzc2VzL3Np" . "dGVtYXBfcGtnLn" . "BocA=="), "_2066024" . "1cf71f38" . "b3bde8a9" . "2da19c2a" . "b" => base64_decode("U0VMRUNUIERJU1RJTkNUIHBtLmlkIEZST00gcHVibGlzaF9tZW51IHBtLCBwdWJsaXNoX21lbnVub2RlIHBtbiBXSEVSRSBwbW4ucGFnZV9pZD1pbnQ6aWQgQU5EIHBtLmlkPXBtbi" . "5tZW51X2lk"));
use Claromentis\Menu\MenuNode;
require_once $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_44cd79b57c4d0eaf39cc" . "6bfc68227f9b"];
class PublishSitemap
{
    
    
    
    
    protected $sitemap;
    public function __construct($_5d9dc4535307a25ed5ea3f94ec97c936)
    {
        $this->sitemap = new GoogleSitemap($_5d9dc4535307a25ed5ea3f94ec97c936);
    }
    
    
    
    
    
    
    
    public function CreateSitemap($_fd62bc4eaaf7d58dea9bada3e30443b9)
    {
        foreach ((array) $_fd62bc4eaaf7d58dea9bada3e30443b9 as $_9b504b5a55d5bda79f82bb3b204a1594) {
            if ($_5c59c380aa5c5e5f18f039ad7757fe97 = $this->CreateSitemapNodeByMenuNodeId($_9b504b5a55d5bda79f82bb3b204a1594)) {
                $this->sitemap->AppendNode($_5c59c380aa5c5e5f18f039ad7757fe97);
            }
        }
        return $this->sitemap;
    }
    
    
    
    
    
    
    
    protected function CreateSitemapNodeByMenuNodeId($id)
    {
        $item = new MenuNode();
        $item->Load($id);
        if ($item->type == \Claromentis\Menu\NodeType::FOLDER) {
            return false;
        }
        return new GoogleSitemapNode($item->GetURL(), new Date(PublishPage::GetLastModifiedDateById($item->page_id)), $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_2b59ce998" . "1d316b9c77" . "0f230e6e07" . "752"], 1);
    }
    
    
    
    
    
    
    
    
    public function FindMenuWithSitemapByPageId($id)
    {
        $db = \Claromentis\Core\Services::I()->GetDb();
        $_189840d11056515e52402d1412a0b6e4 = $db->query($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_20660241cf71f38b3bde8a92da19c" . "2ab"], $id);
        if (!$_189840d11056515e52402d1412a0b6e4->hasData()) {
            return false;
        }
        list($menu_id) = $_189840d11056515e52402d1412a0b6e4->fetchRow();
        return $menu_id;
    }
}