*/
function p_dokubook_xhtml($wp) {
$data = p_wiki_xhtml($wp,'',false);
if(auth_quickaclcheck($wp) >= AUTH_EDIT) {
$data .= '' . html_btn('secedit',$wp,'',array('do'=>'edit','rev'=>'','post')) . '
';
}
// strip TOC
$data = preg_replace('/.*?(<\/div>\n<\/div>)/s', '', $data);
// replace headline ids for XHTML compliance
$data = preg_replace('/(
.*?<\/a><\/h.*?>)/','\1sb_\2\3sb_\4\5', $data);
return ($data);
}
/**
* Renders the Index
*
* copy of html_index located in /inc/html.php
*
* @author Andreas Gohr
* @author Michael Klier
*/
function p_index_xhtml($ns) {
require_once(DOKU_INC.'inc/search.php');
global $conf;
global $ID;
$dir = $conf['datadir'];
$ns = cleanID($ns);
#fixme use appropriate function
if(empty($ns)){
$ns = dirname(str_replace(':','/',$ID));
if($ns == '.') $ns ='';
}
$ns = utf8_encodeFN(str_replace(':','/',$ns));
// only extract headline
preg_match('/.*?<\/h1>/', p_locale_xhtml('index'), $match);
print $match[0];
$data = array();
search($data,$conf['datadir'],'search_index',array('ns' => $ns));
print '
' . DOKU_LF;
print html_buildlist($data,'idx','html_list_index','html_li_index');
print '
' . DOKU_LF;
}
// vim:ts=2:sw=2:enc=utf-8: