Файл: system/controllers/sitemap/actions/index.php
Строк: 22
<?php
class actionSitemapIndex extends cmsAction{
public function run($page = 'sitemap'){
if(!$page){
cmsCore::error404();
}
if(!preg_match('/^([a-z0-9_]*)$/', $page)){
cmsCore::error404();
}
$file_path = $this->cms_config->root_path.'cache/static/sitemaps/'.$page.'.json';
if(!is_readable($file_path)){
cmsCore::error404();
}
$this->cms_template->addBreadcrumb(LANG_SITEMAP_HTML);
$this->cms_template->setPageTitle(LANG_SITEMAP_HTML);
$this->cms_template->addHead('<meta name="robots" content="noindex, follow, noarchive">');
return $this->cms_template->render('index', array(
'show_back' => ($page !== 'sitemap'),
'items' => json_decode(file_get_contents($file_path), true)
));
}
}