Index: trunk/extensions/SemanticResultFormats/Outline/SRF_Outline.php |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | protected $mOutlineProperties = array(); |
85 | 85 | protected $mInnerFormat = ''; |
86 | 86 | |
87 | | - protected function handleParameters( $params, $outputmode ) { |
| 87 | + protected function handleParameters( array $params, $outputmode ) { |
88 | 88 | parent::handleParameters( $params, $outputmode ); |
89 | 89 | $this->mOutlineProperties = $params['outlineproperties']; |
90 | 90 | } |
Index: trunk/extensions/SemanticResultFormats/Math/SRF_Math.php |
— | — | @@ -81,9 +81,9 @@ |
82 | 82 | |
83 | 83 | while ( $row = $res->getNext() ) { |
84 | 84 | foreach( $row as /* SMWResultArray */ $resultArray ) { |
85 | | - while ( ( $dataValue = efSRFGetNextDV( $resultArray ) ) !== false ) { |
86 | | - self::addNumbersForDataValue( $dataValue, $numbers ); |
87 | | - } |
| 85 | + foreach ( $resultArray->getContent() as /* SMWDataItem */ $dataItem ) { |
| 86 | + self::addNumbersForDataItem( $dataItem, $numbers ); |
| 87 | + } |
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
— | — | @@ -91,34 +91,6 @@ |
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
95 | | - * Gets a list of all numbers contained in a datavalue. |
96 | | - * |
97 | | - * @since 1.6 |
98 | | - * |
99 | | - * @param SMWDataValue $dataValue |
100 | | - * @param array $numbers |
101 | | - */ |
102 | | - public static function addNumbersForDataValue( SMWDataValue $dataValue, array &$numbers ) { |
103 | | - // Make use of instanceof instead of getTypeId so that deriving classes will get handled as well. |
104 | | - if ( $dataValue instanceof SMWNumberValue ) { |
105 | | - // getDataItem was introduced in SMW 1.6, getValueKey was deprecated in the same version. |
106 | | - if ( method_exists( $dataValue, 'getDataItem' ) ) { |
107 | | - self::addNumbersForDataItem( $dataValue->getDataItem(), $numbers ); |
108 | | - } else { |
109 | | - $numbers[] = $dataValue->getValueKey(); |
110 | | - } |
111 | | - // Support for records (SMWRecordValue) using code added in SMW 1.6. |
112 | | - } elseif ( $dataValue instanceof SMWRecordValue && method_exists( $dataValue, 'getDataItem' ) ) { |
113 | | - self::addNumbersForDataItem( $dataValue->getDataItem(), $numbers ); |
114 | | - // Support for SMWNAryValue, which was removed in SMW 1.6. |
115 | | - } elseif ( $dataValue instanceof SMWNAryValue ) { |
116 | | - foreach ( $dataValue->getDVs() as $dataValue ) { |
117 | | - self::addNumbersForDataValue( $dataValue, $numbers ); |
118 | | - } |
119 | | - } |
120 | | - } |
121 | | - |
122 | | - /** |
123 | 95 | * Gets a list of all numbers contained in a dataitem. |
124 | 96 | * |
125 | 97 | * @since 1.6 |
— | — | @@ -145,9 +117,13 @@ |
146 | 118 | * @see SMWResultPrinter::getParameters() |
147 | 119 | */ |
148 | 120 | public function getParameters() { |
149 | | - return array( |
150 | | - array( 'name' => 'limit', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_limit' ) ), |
151 | | - ); |
| 121 | + $params = parent::getParameters(); |
| 122 | + |
| 123 | + $params['limit'] = new Parameter( 'limit', Parameter::TYPE_INTEGER ); |
| 124 | + $params['limit']->setMessage( 'srf_paramdesc_limit' ); |
| 125 | + $params['limit']->setDefault( 1000 ); |
| 126 | + |
| 127 | + return $params; |
152 | 128 | } |
153 | 129 | |
154 | 130 | } |