function bt_r_tag($barr = NULL, $args = NULL)
{
    global $wgScriptPath;
    // load Style class implementing call.type
    $no = 1;
    $out = "";
    $sty = "default";
    $sty_src = "sty/" . $sty . ".php";
    if (isset($args["style"])) {
        $sty = bt_str($args["style"]);
        $sty_src = "sty/" . $sty . ".php";
    }
    $dirname = dirname(__FILE__);
    // basic access check
    if (!is_readable($dirname . "/" . $sty_src)) {
        return wfMsg("style_error") . ": " . $sty_src;
    }
    // hook general css
    $bibtech_css = "Bibtech.css";
    $bibtech_sty_css = "sty/" . $sty . ".css";
    if (!is_readable($dirname . "/" . $bibtech_css)) {
        return wfMsg("style_error") . " " . $bibtech_css;
    } else {
        $__url = $wgScriptPath . "/extensions/Bibtech/" . $bibtech_css;
        $out .= '<link rel="stylesheet" type="text/css" href="' . $__url . '" />' . "\n";
    }
    // hook style css
    if (is_readable($dirname . "/" . $bibtech_sty_css)) {
        $__url = $wgScriptPath . "/extensions/Bibtech/" . $bibtech_sty_css;
        $out .= '<link rel="stylesheet" type="text/css" href="' . $__url . '" />' . "\n";
    }
    // begin styling
    require_once $sty_src;
    // EXECUTE {begin.bib}
    $out .= bt_r_tag_begin($args);
    if ($barr == NULL) {
        $out .= bt_r_frm_err(wfMsg("internal_err"));
    } else {
        // ITERATE {call.type$}
        foreach ($barr as $ckey => $arr) {
            $ckey = bt_str($ckey);
            $out .= bt_r_entry_begin($ckey, $arr, $args);
            $out .= bt_r_entry($ckey, $arr, $args);
            $out .= bt_r_entry_end($ckey, $arr, $args);
        }
    }
    // EXECUTE {end.bib}
    $out .= bt_r_tag_end($args);
    // finish styling
    return $out;
}
예제 #2
0
function bt_r_entry_missing($arr)
{
    return bt_r_frm_err(wfMsg("missing") . ": " . $arr["ckey"]);
}