/** * Returns the definitions of all parameters supported by the specified format. * * @since 1.8 * * @param string $format * * @return array of IParamDefinition */ public static function getFormatParameters($format) { SMWParamFormat::resolveFormatAliases($format); if (array_key_exists($format, $GLOBALS['smwgResultFormats'])) { return ParamDefinition::getCleanDefinitions(SMWQueryProcessor::getResultPrinter($format)->getParamDefinitions(SMWQueryProcessor::getParameters())); } else { return array(); } }
/** * Determines the format from an array of parameters, and returns it. * * @deprecated since 1.6.2, removal in 1.8 * * @param array $params * * @return string */ protected static function getResultFormat(array $params) { $format = 'auto'; if (array_key_exists('format', $params)) { global $smwgResultFormats; $format = strtolower(trim($params['format'])); if (!array_key_exists($format, $smwgResultFormats)) { $isAlias = SMWParamFormat::resolveFormatAliases($format); if (!$isAlias) { $format = 'auto'; // If it is an unknown format, defaults to list/table again } } } return $format; }