Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/fck/fck_eh.php
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | |||||
{ | { | ||||
$event->status = kEvent::erSTOP; | $event->status = kEvent::erSTOP; | ||||
/** @var CategoryHelper $category_helper */ | /** @var CategoryHelper $category_helper */ | ||||
$category_helper = $this->Application->recallObject('CategoryHelper'); | $category_helper = $this->Application->recallObject('CategoryHelper'); | ||||
$pages = $category_helper->getStructureTreeAsOptions(); | $pages = $category_helper->getStructureTreeAsOptions(); | ||||
$sql = 'SELECT NamedParentPath, CategoryId | $sql = 'SELECT LOWER(NamedParentPath), CategoryId | ||||
FROM ' . TABLE_PREFIX . 'Categories | FROM ' . TABLE_PREFIX . 'Categories | ||||
WHERE CategoryId IN (' . implode(',', array_keys($pages)) . ')'; | WHERE CategoryId IN (' . implode(',', array_keys($pages)) . ')'; | ||||
$templates = $this->Conn->GetCol($sql, 'CategoryId'); | $templates = $this->Conn->GetCol($sql, 'CategoryId'); | ||||
$templates[$this->Application->getBaseCategory()] .= '/Index'; // "Content" category will act as "Home Page" | // "Content" category will act as "Home Page". | ||||
$templates[$this->Application->getBaseCategory()] .= '/'; | |||||
$res = '<?xml version="1.0" encoding="' . CHARSET . '" ?>' . "\n"; | $res = '<?xml version="1.0" encoding="' . CHARSET . '" ?>' . "\n"; | ||||
$res .= '<CmsPages>' . "\n"; | $res .= '<CmsPages>' . "\n"; | ||||
$url_params = array('pass' => 'm'); | |||||
if ( $this->Application->ConfigValue('UseModRewrite') ) { | |||||
$url_params['__MOD_REWRITE__'] = 1; | |||||
} | |||||
$base_url = rtrim($this->Application->BaseURL(), '/'); | |||||
foreach ($pages as $id => $title) { | foreach ( $pages as $id => $title ) { | ||||
$template = $templates[$id]; | $template = $templates[$id]; | ||||
$page_path = preg_replace('/^Content\//i', '', strtolower($template).'.html'); | |||||
$real_url = $this->Application->HREF($template, '_FRONT_END_', $url_params, 'index.php'); | |||||
$page_path = str_replace($base_url, '', $real_url); | |||||
$title = $title . ' (' . $page_path . ')'; | $title = $title . ' (' . $page_path . ')'; | ||||
$real_url = $this->Application->HREF($template, '_FRONT_END_', array('pass' => 'm'), 'index.php'); | |||||
$res .= '<CmsPage real_url="' . kUtil::escape($real_url, kUtil::ESCAPE_HTML) . '" path="@@' . $id . '@@" title="' . kUtil::escape($title, kUtil::ESCAPE_HTML) . '" st_id="' . $id . '" serverpath="" />' . "\n"; | $res .= sprintf( | ||||
'<CmsPage real_url="%1$s" path="@@%2$d@@" title="%3$s" st_id="%2$d" serverpath="" />' . "\n", | |||||
kUtil::escape($real_url, kUtil::ESCAPE_HTML), | |||||
$id, | |||||
kUtil::escape($title, kUtil::ESCAPE_HTML) | |||||
); | |||||
} | } | ||||
$res.= "</CmsPages>"; | $res .= '</CmsPages>'; | ||||
$this->CreateXmlHeader(); | $this->CreateXmlHeader(); | ||||
echo $res; | echo $res; | ||||
} | } | ||||
function OnRenameFile($event) | function OnRenameFile($event) | ||||
{ | { | ||||
$event->status = kEvent::erSTOP; | $event->status = kEvent::erSTOP; | ||||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |