request['mode']) {
$this->ajax_die('invalid mode (empty)');
}
$map = new TorrentPier\Sitemap();
$html = '';
switch ($mode) {
case 'create':
$map->createSitemap();
if (is_file(SITEMAP_DIR . '/sitemap.xml')) {
$html .= $lang['SITEMAP_CREATED'] . ': ' . bb_date(TIMENOW, $bb_cfg['post_date_format']) . ' ' . $lang['SITEMAP_AVAILABLE'] . ': ' . make_url('sitemap/sitemap.xml') . '';
} else {
$html .= $lang['SITEMAP_NOT_CREATED'];
}
break;
default:
$this->ajax_die("Invalid mode: $mode");
}
$this->response['html'] = $html;
$this->response['mode'] = $mode;