function renderBibtex($input, $id, $parser)
{
    $output = "";
    $b = new BibTex($input, $parser);
    $output .= $b->html($id);
    return $output;
}
function renderBibtex($input, $id, $parser, $prefix)
{
    $b = new BibTex($input, $parser);
    return $b->html($id, $prefix);
}
Example #3
0
function renderBibtex($input, $argv = 0)
{
    global $wfBibtexTypes;
    global $wbib_usejavascript;
    global $bibtexArray;
    global $wgScriptPath;
    $output = "";
    // if nothing is put into bibtex markups then warn people
    // and display help message
    if (count($bibtexArray) == 0 && $wbib_usejavascript) {
        $output .= '<script language="javascript" src="' . $wgScriptPath . '/extensions/BibTex/bibtex.js"></script>' . "\n";
    }
    if (preg_match('/^\\s*$/', $input)) {
        $output .= wfMsg('bibtex_empty') . "\n";
        $output .= displayBibtexTypes();
        $output .= wfMsg('bibtex_help_type') . "\n";
        return $output;
    }
    // display help message when clicking on preview button
    if (strtolower(trim($input)) == '@help') {
        $output .= displayBibtexTypes();
        $output .= wfMsg('bibtex_help_type') . "\n";
        return $output;
    }
    // display field help for entries according to selected entry
    foreach ($wfBibtexTypes as $type) {
        if (strtolower(trim($input)) == '@' . $type) {
            $output .= wfMsg('bibtex_help_entry', $type);
            $output .= displayBibtexEntry($type);
            return $output;
        }
    }
    // if nothing of the conditions above, juste display the bibtex entry.
    $b = new BibTex($input);
    $output .= $b->html();
    return $output;
}