' . $section;
} else {
$link = make_pagelink($page_l,$section,$ank);
}
} else {
$link = make_pagelink($page_l,$page_name);
}
} else {
$link = make_pagelink($page_l,$page_name);
}
switch ( $opt_key ) {
case 'list':
$body[] = '' . $link . "\n";
break;
case 'table':
$body[] = ' | ' . $link . " |
\n";
break;
case 'line':
$body .= $link . ' ';
break;
}
}
if ($opt_key != 'line') $body = join($body);
if ($opt_key == 'list') {$body = '';} else
if ($opt_key == 'table') {$body = '';}
return $body;
}
function plugin_key_page_section_filter($page, $section, $ank, $source_key)
{
$page_source = get_source($page);
foreach ($page_source as $line_chk) {
if ( $source_key == 'section' ) {
if (preg_match('/^(\*{1,3})(.*?)\[#(.*?)\](.*?)$/m',$line_chk,$match_section) && $section !== '') {
if ( preg_match("/$section/", $match_section[2]) ) {
$ank = '#' . $match_section[3];
return $match_section[2];
}
}
} else {
if (preg_match('/^TITLE:(.*?)$/m',$line_chk,$match_section)) {
if ( preg_match("/$section/", $match_section[1]) ) {
$ank = '';
return $match_section[1];
}
}
}
}
return '';
}
?>