http://www.mediawiki.org/wiki/Special:Code/MediaWiki/94147
Revision: 94147
Author: devayon
Date: 2011-08-10 08:45:51 +0000 (Wed, 10 Aug 2011)
Log Message:
-----------
fw: r94146 (added right to left text support)
Modified Paths:
--------------
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
Modified:
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
===================================================================
---
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
2011-08-10 07:15:18 UTC (rev 94146)
+++
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
2011-08-10 08:45:51 UTC (rev 94147)
@@ -248,7 +248,7 @@
* one may overload getUrlTail();
*
* @global int $smwgQMaxInlineLimit
- * @global mixed $wgContLang
+ * @global Language $wgContLang
* @param int $limit
* @param int $offset
* @param boolean $hasFurtherResults
@@ -260,7 +260,7 @@
$url_tail = $this->getUrlTail();
// Prepare navigation bar.
if ( $offset > 0 ) {
- $navigation = Html::element(
+ $previous = Html::element(
'a',
array(
'href' =>
$this->getTitle()->getLocalURL(
@@ -273,18 +273,14 @@
);
} else {
- $navigation = wfMsg( 'smw_result_prev' );
+ $previous = wfMsg( 'smw_result_prev' );
}
+ $space = '    ';
+ $first_digit = $wgContLang->formatNum( $offset + 1 );
+ $last_digit = $wgContLang->formatNum( $offset +
$this->uiCore->getResultCount() );
- $navigation .=
- '     <b>' .
- wfMsg( 'smw_result_results' ) . ' ' .
$wgContLang->formatNum( $offset + 1 ) .
- ' - ' .
- $wgContLang->formatNum( $offset +
$this->uiCore->getResultCount() ) .
- '</b>    ';
-
if ( $hasFurtherResults ) {
- $navigation .= Html::element(
+ $next = Html::element(
'a',
array(
'href' =>
$this->getTitle()->getLocalURL(
@@ -296,7 +292,7 @@
wfMsg( 'smw_result_next' )
);
} else {
- $navigation .= wfMsg( 'smw_result_next' );
+ $next = wfMsg( 'smw_result_next' );
}
$first = true;
@@ -305,14 +301,14 @@
if ( $l > $smwgQMaxInlineLimit ) break;
if ( $first ) {
- $navigation .=
'        (';
+ $limit_choices = '(';
$first = false;
} else {
- $navigation .= ' | ';
+ $limit_choices .= ' | ';
}
if ( $limit != $l ) {
- $navigation .= Html::element(
+ $limit_choices .= Html::element(
'a',
array(
'href' =>
$this->getTitle()->getLocalURL(
@@ -324,12 +320,16 @@
$wgContLang->formatNum( $l, false )
);
} else {
- $navigation .= '<b>' . $wgContLang->formatNum(
$l ) . '</b>';
+ $limit_choices .= '<b>' .
$wgContLang->formatNum( $l ) . '</b>';
}
}
- $navigation .= ')';
-
+ $limit_choices .= ')';
+ if ( $wgContLang->isRTL() ) { // right to left
+ $navigation = "$limit_choices $next $space
<b>$last_digit - $first_digit " . wfMsg( 'smw_result_results' ) . "</b> $space
$previous";
+ } else { // left to right
+ $navigation = "$space $previous $space <b>" . wfMsg(
'smw_result_results' ) . " $first_digit - $last_digit</b> $space $next $space
$limit_choices";
+ }
return $navigation;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs