1 | <?php |
||
44 | 2 | $params[] = [ |
|
45 | 'name' => 'template', |
||
46 | 'message' => 'smw-paramdesc-template', |
||
47 | 'default' => '', |
||
48 | ]; |
||
49 | |||
50 | 2 | $params[] = [ |
|
51 | 'name' => 'userparam', |
||
52 | 'message' => 'smw-paramdesc-userparam', |
||
53 | 'default' => '', |
||
54 | ]; |
||
55 | |||
56 | 2 | $params[] = [ |
|
57 | 'name' => 'named args', |
||
58 | 'type' => 'boolean', |
||
59 | 'message' => 'smw-paramdesc-named_args', |
||
60 | 'default' => true, |
||
61 | ]; |
||
62 | |||
63 | 2 | return $params; |
|
64 | } |
||
65 | |||
66 | /** |
||
67 | * @see ResultPrinter::getResultText |
||
68 | * |
||
69 | * {@inheritDoc} |
||
70 | */ |
||
71 | 2 | protected function getResultText( SMWQueryResult $res, $outputMode ) { |
|
72 | |||
73 | // for each result row, create an array of the row itself |
||
74 | // and all its sorted-on fields, and add it to the initial |
||
75 | // 'tree' |
||
76 | 2 | $outlineTree = new OutlineTree(); |
|
77 | 2 | while ( $row = $res->getNext() ) { |
|
78 | 2 | $outlineItem = new OutlineItem( $row ); |
|
79 | |||
80 | 2 | foreach ( $row as $field ) { |
|
81 | 2 | $field_name = $field->getPrintRequest()->getText( SMW_OUTPUT_HTML ); |
|
82 | |||
83 | 2 | if ( in_array( $field_name, $this->params['outlineproperties'] ) ) { |
|
84 | 2 | while ( ( $object = $field->getNextDataValue() ) !== false ) { |
|
85 | 2 | $field_val = $object->getLongWikiText( $this->getLinker() ); |
|
86 | 2 | $outlineItem->addFieldValue( $field_name, $field_val ); |
|
87 | } |
||
127 |