Commit a16bb884 authored by vermeul's avatar vermeul

first attempt to include SMW Queries directly

parent 3e701523
......@@ -7,6 +7,11 @@
* @license GNU General Public Licence 2.0
*/
use SMW\ApplicationFactory;
#use SMWQuery;
#use SMWQueryProcessor;
#use SMWQueryResult;
class YATA {
public static $annotations = "";
//
......@@ -40,6 +45,29 @@ class YATA {
// Render the output of {{#annotask:}}
//
public static function annotation_query( $parser, $querystring) {
#$smw_querystring = "{{#ask: [[Has author::Swen Vermeul]]
# |?Has author
# |?Has population
# |?Has date
#}}
#";
#$printouts = array();
#$parameters = array();
##SMWQueryProcessor:addThisPrintout( $printouts, $parameters );
#$query = SMWQueryProcessor::createQuery(
# $smw_querystring,
# SMWQueryProcessor::getProcessedParams( $parameters, $printouts ),
# SMWQueryProcessor::SPECIAL_PAGE,
# '',
# $printouts
#);
#$query->setOption( SMWQuery::PROC_CONTEXT, 'API' );
#$result = ApplicationFactory::getInstance()->getStore()->getQueryResult( $query );
#var_dump($result);
#die;
$title = $parser->getTitle();
$wikiPage = new WikiPage( $title );
$queries_found = preg_match_all(
......@@ -146,6 +174,7 @@ class YATA {
)
);
$table = "";
if ($searches) {
$table .= "<b>Search for term:</b>";
foreach($searches as $search_string) {
......@@ -284,6 +313,10 @@ EOT;
// Render the output of {{#annotcat: list}}.
//
public static function annotation_categories( $parser, $method, $start_with=null ) {
#use Ask;
#print("hello!");
##print(Ask::getVersion());
#die;
if (! $method == "list") {
return "";
}
......@@ -1132,7 +1165,7 @@ EOT;
public static function onEditFilter($editor, $text, $section, &$error, $summary) {
}
// this is called after «Save changes»
// this is called after Save changes
// and after onEditFilter
public static function onArticlePrepareTextForEdit(&$wikiPage, &$popts) {
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment