Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValue.php |
— | — | @@ -410,31 +410,7 @@ |
411 | 411 | |
412 | 412 | if ( count( $list ) == 3 ) { // Initial comparator found ($list[0] should be empty). |
413 | 413 | $value = $list[2]; |
414 | | - |
415 | | - switch ( $list[1] ) { |
416 | | - case '<': |
417 | | - $comparator = $smwStrictComparators ? SMW_CMP_LESS : SMW_CMP_LEQ; |
418 | | - break; |
419 | | - case '>': |
420 | | - $comparator = $smwStrictComparators ? SMW_CMP_GRTR : SMW_CMP_GEQ; |
421 | | - break; |
422 | | - case '!': |
423 | | - $comparator = SMW_CMP_NEQ; |
424 | | - break; |
425 | | - case '~': |
426 | | - $comparator = SMW_CMP_LIKE; |
427 | | - break; |
428 | | - case '!~': |
429 | | - $comparator = SMW_CMP_NLKE; |
430 | | - break; |
431 | | - case '≥' : |
432 | | - $comparator = SMW_CMP_GEQ; |
433 | | - break; |
434 | | - case '≤' : |
435 | | - $comparator = SMW_CMP_LEQ; |
436 | | - break; |
437 | | - // default: not possible |
438 | | - } |
| 414 | + $comparator = SMWQueryLanguage::getComparatorFromString( $list[1], SMW_CMP_EQ ); |
439 | 415 | } |
440 | 416 | } |
441 | 417 | |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_SetupLight.php |
— | — | @@ -70,6 +70,7 @@ |
71 | 71 | // $wgAutoloadClasses['SMWTypePage'] = $smwgIP . 'includes/articlepages/SMW_TypePage.php'; |
72 | 72 | $wgAutoloadClasses['SMWPropertyPage'] = $smwgIP . 'includes/articlepages/SMW_PropertyPage.php'; |
73 | 73 | // $wgAutoloadClasses['SMWConceptPage'] = $smwgIP . 'includes/articlepages/SMW_ConceptPage.php'; |
| 74 | + $wgAutoloadClasses['SMWQueryLanguage'] = $smwgIP . 'includes/SMW_QueryLanguage.php'; |
74 | 75 | |
75 | 76 | // Datavalues |
76 | 77 | $dvDir = $smwgIP . 'includes/datavalues/'; |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Description.php |
— | — | @@ -386,20 +386,7 @@ |
387 | 387 | |
388 | 388 | public function getQueryString( $asvalue = false ) { |
389 | 389 | if ( $this->m_datavalue !== null ) { |
390 | | - global $smwStrictComparators; |
391 | | - |
392 | | - switch ( $this->m_comparator ) { |
393 | | - case SMW_CMP_LEQ: $comparator = $smwStrictComparators ? '<=' : '<'; break; |
394 | | - case SMW_CMP_GEQ: $comparator = $smwStrictComparators ? '>=' : '>'; break; |
395 | | - case SMW_CMP_NEQ: $comparator = '!'; break; |
396 | | - case SMW_CMP_LIKE: $comparator = '~'; break; |
397 | | - case SMW_CMP_NLKE: $comparator = '!~'; break; |
398 | | - case SMW_CMP_LESS: $comparator = '<'; break; |
399 | | - case SMW_CMP_GRTR: $comparator = '>'; break; |
400 | | - default: case SMW_CMP_EQ: |
401 | | - $comparator = ''; |
402 | | - break; |
403 | | - } |
| 390 | + $comparator = SMWQueryLanguage::getStringForComparator( $this->m_comparator ); |
404 | 391 | |
405 | 392 | if ( $asvalue ) { |
406 | 393 | return $comparator . $this->m_datavalue->getWikiValue(); |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php |
— | — | @@ -78,6 +78,7 @@ |
79 | 79 | $wgAutoloadClasses['SMWResultPrinter'] = $smwgIP . 'includes/SMW_QueryPrinter.php'; |
80 | 80 | $wgAutoloadClasses['SMWDataValueFactory'] = $smwgIP . 'includes/SMW_DataValueFactory.php'; |
81 | 81 | $wgAutoloadClasses['SMWDataValue'] = $smwgIP . 'includes/SMW_DataValue.php'; |
| 82 | + $wgAutoloadClasses['SMWQueryLanguage'] = $smwgIP . 'includes/SMW_QueryLanguage.php'; |
82 | 83 | |
83 | 84 | // Article pages |
84 | 85 | $apDir = $smwgIP . 'includes/articlepages/'; |