/** * @see SMWResultPrinter::getParamDefinitions * * @since 1.8 * * @param $definitions array of IParamDefinition * * @return array of IParamDefinition|array */ public function getParamDefinitions(array $definitions) { $params = parent::getParamDefinitions($definitions); $params['class'] = array('name' => 'class', 'message' => 'srf-paramdesc-class', 'default' => ''); $params['listtype'] = array('name' => 'listtype', 'message' => 'srf-paramdesc-listtype', 'values' => array('unordered', 'ordered'), 'default' => 'unordered'); $params['widget'] = array('name' => 'widget', 'message' => 'srf-paramdesc-widget', 'values' => array('alphabet', 'menu', 'pagination'), 'default' => 'alphabet'); $params['pageitems'] = array('type' => 'integer', 'name' => 'pageitems', 'message' => 'srf-paramdesc-pageitems', 'default' => 5); return $params; }
/** * @see SMWResultPrinter::getParamDefinitions * * @since 1.8 * * @param $definitions array of IParamDefinition * * @return array of IParamDefinition|array */ public function getParamDefinitions(array $definitions) { $params = parent::getParamDefinitions($definitions); $params['parent'] = array('default' => '', 'message' => 'srf-paramdesc-parent'); return $params; }
/** * Handles Ajax call * @param integer $pageId * @param type $template * @param type $printrequests * @return type */ public static function handleGetResult($pageId, $template, $printrequests) { $title = Title::newFromID($pageId)->getPrefixedText(); $rp = new SMWListResultPrinter('template', true); $paramDefinitions = ParamDefinition::getCleanDefinitions($rp->getParamDefinitions(array())); $params = array(); /** * @param IParamDefinition $def */ foreach ($paramDefinitions as $def) { $params[$def->getName()] = $def->getDefault(); } $params = array_merge($params, array('format' => 'template', 'template' => $template, 'mainlabel' => '', 'sort' => '', 'order' => '', 'intro' => null, 'outro' => null, 'searchlabel' => null, 'link' => null, 'default' => null, 'headers' => null, 'introtemplate' => '', 'outrotemplate' => '')); $params = SMWQueryProcessor::getProcessedParams($params, array()); $p = json_decode($printrequests, true); $extraprintouts = array(); foreach ($p as $key => $prData) { // if printout mode is PRINT_PROP if ($prData[0] == SMWPrintRequest::PRINT_PROP) { // create property from property key $data = SMWPropertyValue::makeUserProperty($prData[2]); } else { $data = null; } // create printrequest from request mode, label, property name, output format, parameters $extraprintouts[] = new SMWPrintRequest($prData[0], $prData[1], $data, $prData[3], $prData[4]); } return SMWQueryProcessor::getResultFromQueryString('[[' . $title . ']]', $params, $extraprintouts, SMW_OUTPUT_HTML, SMWQueryProcessor::INLINE_QUERY); }
/** * @see SMWResultPrinter::getParamDefinitions * * @since 1.8 * * @param $definitions array of IParamDefinition * * @return array of IParamDefinition|array */ public function getParamDefinitions(array $definitions) { $params = parent::getParamDefinitions($definitions); $params['parent'] = array('default' => '', 'message' => 'srf-paramdesc-parent'); $params['root'] = array('default' => '', 'message' => 'srf-paramdesc-root'); $params['start level'] = array('default' => 1, 'message' => 'srf-paramdesc-startlevel', 'type' => 'integer'); return $params; }
public function getParameters() { $params = array_merge(parent::getParameters(), parent::textDisplayParameters()); $params['parent'] = new Parameter('parent'); $params['parent']->setMessage('srf-paramdesc-parent'); $params['parent']->setDefault(''); return $params; }