Error: The Semantic Result Formats ' .
'extension requires Semantic MediaWiki to be ' .
'installed and enabled.
'
);
}
}
// Admin Links hook needs to be called in a delayed way so that it
// will always be called after SMW's Admin Links addition; as of
// SMW 1.9, SMW delays calling all its hook functions.
$GLOBALS['wgHooks']['AdminLinks'][] = 'SRFHooks::addToAdminLinks';
$GLOBALS['srfgScriptPath'] = ( $GLOBALS['wgExtensionAssetsPath'] === false ? $GLOBALS['wgScriptPath'] . '/extensions' : $GLOBALS['wgExtensionAssetsPath'] ) . '/SemanticResultFormats';
$formatClasses = [
// Assign the Boilerplate class to a format identifier
// 'boilerplate' => 'SRFBoilerplate',
'timeline' => 'SRFTimeline',
'eventline' => 'SRFTimeline',
'vcard' => 'SRF\vCard\vCardFileExportPrinter',
'icalendar' => 'SRF\iCalendar\iCalendarFileExportPrinter',
'bibtex' => 'SRF\BibTex\BibTexFileExportPrinter',
'calendar' => 'SRFCalendar',
'eventcalendar' => 'SRF\EventCalendar',
'outline' => 'SRF\Outline\OutlineResultPrinter',
'sum' => 'SRFMath',
'product' => 'SRFMath',
'average' => 'SRFMath',
'min' => 'SRFMath',
'max' => 'SRFMath',
'median' => 'SRFMath',
'exhibit' => 'SRFExhibit',
'googlebar' => 'SRFGoogleBar',
'googlepie' => 'SRFGooglePie',
'jitgraph' => 'SRFJitGraph',
'jqplotchart' => 'SRFjqPlotChart',
'jqplotseries' => 'SRFjqPlotSeries',
'graph' => 'SRF\Graph\GraphPrinter',
'process' => 'SRFProcess',
'gallery' => 'SRF\Gallery',
'tagcloud' => 'SRF\TagCloud',
'valuerank' => 'SRFValueRank',
'array' => 'SRFArray',
'hash' => 'SRFHash',
'd3chart' => 'SRFD3Chart',
'tree' => 'SRF\Formats\Tree\TreeResultPrinter',
'ultree' => 'SRF\Formats\Tree\TreeResultPrinter',
'oltree' => 'SRF\Formats\Tree\TreeResultPrinter',
'filtered' => 'SRF\Filtered\Filtered',
'latest' => 'SRFTime',
'earliest' => 'SRFTime',
'slideshow' => 'SRFSlideShow',
'timeseries' => 'SRFTimeseries',
'sparkline' => 'SRFSparkline',
'listwidget' => 'SRFListWidget',
'pagewidget' => 'SRFPageWidget',
'dygraphs' => 'SRFDygraphs',
'incoming' => 'SRFIncoming',
'media' => 'SRF\MediaPlayer',
'datatables' => 'SRF\DataTables',
'gantt' => 'SRF\Gantt\GanttPrinter'
];
$formatAliases = [
'tagcloud' => [ 'tag cloud' ],
'datatables' => [ 'datatable' ],
'valuerank' => [ 'value rank' ],
'd3chart' => [ 'd3 chart' ],
'timeseries' => [ 'time series' ],
'jqplotchart' => [ 'jqplot chart', 'jqplotpie', 'jqplotbar' ],
'jqplotseries' => [ 'jqplot series' ],
];
if ( class_exists( '\PhpOffice\PhpSpreadsheet\Spreadsheet' ) ) {
$formatClasses['spreadsheet'] = 'SRF\SpreadsheetPrinter';
$formatAliases['spreadsheet'] = [ 'excel' ];
}
foreach ( $GLOBALS['srfgFormats'] as $format ) {
if ( array_key_exists( $format, $formatClasses ) ) {
$GLOBALS['smwgResultFormats'][$format] = $formatClasses[$format];
if ( isset( $GLOBALS['smwgResultAliases'] ) && array_key_exists( $format, $formatAliases ) ) {
$GLOBALS['smwgResultAliases'][$format] = $formatAliases[$format];
}
}
}
}
/**
* @since 2.5
*
* @return string|null
*/
public static function getVersion() {
return SRF_VERSION;
}
}