Esempio n. 1
0
 function successMsg($message)
 {
     global $wgOut;
     $successHtml = RDFIOUtils::formatSuccessMessageHTML("Success!", $message);
     $wgOut->addHTML($successHtml);
 }
Esempio n. 2
0
    function showImportedTriples($importedTriples)
    {
        $output = "";
        $style_css = <<<EOD
\t    \t    table .rdfio- th {
\t    \t        font-weight: bold;
\t    \t        padding: 2px 4px;
\t    \t    }
\t    \t    table.rdfio-table td,
\t    \t    table.rdfio-table th {
\t    \t        font-size: 11px;
\t    \t    }
EOD;
        $output .= "<style>{$style_css}</style>";
        //$wgOut->addInlineStyle($style_css);
        $output .= RDFIOUtils::formatSuccessMessageHTML("Success!", "Successfully imported the triples shown below!");
        $output .= "<table class=\"wikitable sortable rdfio-table\"><tbody><tr><th>Subject</th><th>Predicate</th><th>Object</th></tr>";
        foreach ($importedTriples as $triple) {
            $s = $triple['s'];
            $p = $triple['p'];
            $o = $triple['o'];
            if (RDFIOUtils::isURI($s)) {
                $s = "<a href=\"{$s}\">{$s}</a>";
            }
            if (RDFIOUtils::isURI($p)) {
                $p = "<a href=\"{$p}\">{$p}</a>";
            }
            if (RDFIOUtils::isURI($o)) {
                $o = "<a href=\"{$o}\">{$o}</a>";
            }
            $output .= "<tr><td>{$s}</td><td>{$p}</td><td>{$o}</td></tr>";
        }
        $output .= "</tbody></table>";
        return $output;
    }