r94742 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94741‎ | r94742 | r94743 >
Date:11:30, 17 August 2011
Author:devayon
Status:deferred
Tags:
Comment:
some clean-up and fixing broken Navigation links
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialQueryCreator.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
@@ -258,16 +258,14 @@
259259 */
260260 public function getNavigationBar( $limit, $offset, $hasFurtherResults ) {
261261 global $smwgQMaxInlineLimit, $wgLang;
262 - $urlTail = $this->getUrlTail();
263262 // Prepare navigation bar.
264263 if ( $offset > 0 ) {
 264+ $this->setUrlArgs( array( 'offset' => max( 0, $offset - $limit ),
 265+ 'limit' => $limit ) );
265266 $navigation = Html::element(
266267 'a',
267268 array(
268 - 'href' => $this->getTitle()->getLocalURL(
269 - 'offset=' . max( 0, $offset - $limit ) .
270 - '&limit=' . $limit . $urlTail
271 - ),
 269+ 'href' => $this->getTitle()->getLocalURL( wfArrayToCGI( $this->getUrlArgs() ) ),
272270 'rel' => 'nofollow'
273271 ),
274272 wfMsg( 'smw_result_prev' )
@@ -285,13 +283,12 @@
286284 '</b>&#160;&#160;&#160;&#160;';
287285
288286 if ( $hasFurtherResults ) {
 287+ $this->setUrlArgs( array( 'offset' => max( 0, $offset + $limit ),
 288+ 'limit' => $limit ) );
289289 $navigation .= Html::element(
290290 'a',
291291 array(
292 - 'href' => $this->getTitle()->getLocalURL(
293 - 'offset=' . ( $offset + $limit ) .
294 - '&limit=' . $limit . $urlTail
295 - ),
 292+ 'href' => $this->getTitle()->getLocalURL( wfArrayToCGI( $this->getUrlArgs() ) ),
296293 'rel' => 'nofollow'
297294 ),
298295 wfMsg( 'smw_result_next' )
@@ -313,13 +310,11 @@
314311 }
315312
316313 if ( $limit != $l ) {
 314+ $this->setUrlArgs( array( 'offset' => $offset, 'limit' => $l ) );
317315 $navigation .= Html::element(
318316 'a',
319317 array(
320 - 'href' => $this->getTitle()->getLocalURL(
321 - 'offset=' . $offset .
322 - '&limit=' . $l . $urlTail
323 - ),
 318+ 'href' => $this->getTitle()->getLocalURL( wfArrayToCGI( $this->getUrlArgs() ) ),
324319 'rel' => 'nofollow'
325320 ),
326321 $wgLang->formatNum( $l, false )
@@ -345,6 +340,7 @@
346341 */
347342 protected function getQueryFormBox() {
348343 global $wgOut, $smwgScriptPath;
 344+ $this->setUrlArgs( array( 'q' => $this->uiCore->getQueryString() ) );
349345 $result = '<div>';
350346 $result .= Html::element( 'textarea', array( 'name' => 'q', 'id' => 'querybox' ),
351347 $this->uiCore->getQueryString() );
@@ -554,53 +550,32 @@
555551 '<input size="25" value="' . $mainLabelText . '" id="mainlabelvis" />' .
556552 '<input type="hidden" name="pmainlabel" value="' . $mainLabel . '" id="mainlabelhid" />' .
557553 '</div>';
 554+ $urlArgs = array();
 555+ $urlArgs['pmainlabel'] = $mainLabel;
558556
559557 // START: create form elements already submitted earlier via form
560558 // attempting to load parameters from $wgRequest
561 - $propertyValues = $wgRequest->getArray( 'property' );
562 - $propertyLabelValues = $wgRequest->getArray( 'prop_label' );
563 - $propertyFormatValues = $wgRequest->getArray( 'prop_format' );
564 - $propertyLimitValues = $wgRequest->getArray( 'prop_limit' );
565 - $orderValues = $wgRequest->getArray( 'order' );
566 - $displayValues = $wgRequest->getArray( 'display' );
567 - $categoryValues = $wgRequest->getArray( 'category' );
568 - $categoryLabelValues = $wgRequest->getArray( 'cat_label' );
569 - $categoryYesValues = $wgRequest->getArray( 'cat_yes' );
570 - $categoryNoValues = $wgRequest->getArray( 'cat_no' );
571 - $mainColumnLabels = $wgRequest->getArray( 'maincol_label' );
 559+ $propertyValues = $wgRequest->getArray( 'property', array() );
 560+ $propertyLabelValues = $wgRequest->getArray( 'prop_label', array() );
 561+ $propertyFormatValues = $wgRequest->getArray( 'prop_format', array() );
 562+ $propertyLimitValues = $wgRequest->getArray( 'prop_limit', array() );
 563+ $orderValues = $wgRequest->getArray( 'order', array() );
 564+ $displayValues = $wgRequest->getArray( 'display', array() );
 565+ $categoryValues = $wgRequest->getArray( 'category', array() );
 566+ $categoryLabelValues = $wgRequest->getArray( 'cat_label', array() );
 567+ $categoryYesValues = $wgRequest->getArray( 'cat_yes', array() );
 568+ $categoryNoValues = $wgRequest->getArray( 'cat_no', array() );
 569+ $mainColumnLabels = $wgRequest->getArray( 'maincol_label', array() );
572570
573 - if ( is_array( $propertyValues ) || is_array( $categoryValues ) || is_array( $mainColumnLabels ) ) {
 571+ $mainLabelCheck = $wgRequest->getCheck( 'pmainlabel' );
 572+
 573+ if ( !$mainLabelCheck ) {
574574 /*
575 - * Printouts were set via this Ui
576 - */
577 - if ( is_array( $propertyValues ) ) {
578 - // remove empty property values
579 - foreach ( $propertyValues as $key => $propertyValue ) {
580 - $propertyValues[$key] = trim( $propertyValue );
581 - if ( $propertyValue == '' ) {
582 - unset( $propertyValues[$key] );
583 - }
584 - }
585 - }
586 - } else {
587 - /*
588 - * Printouts and sorting were set via another widget/form/source, so
 575+ * Printouts and sorting might be set via another widget/form/source, so
589576 * create elements by fetching data from $uiCore. The exact ordering
590 - * of Ui elements might not be preserved, if the above block were to
 577+ * of Ui elements might not be preserved, if the above check were to
591578 * be removed.
592579 */
593 - $propertyValues = array();
594 - $propertyLabelValues = array();
595 - $propertyFormatValues = array();
596 - $propertyLimitValues = array();
597 - $orderValues = array();
598 - $displayValues = array();
599 - $categoryValues = array();
600 - $categoryLabelValues = array();
601 - $categoryYesValues = array();
602 - $categoryNoValues = array();
603 - $mainColumnLabels = array();
604 -
605580 if ( array_key_exists( 'sort', $params ) && array_key_exists( 'order', $params ) ) {
606581 $sortVal = explode( ',', trim( strtolower( $params['sort'] ) ) );
607582 $orderVal = explode( ',', $params['order'] );
@@ -619,7 +594,7 @@
620595 $counter = 0;
621596 foreach ( $printOuts as $poKey => $poValue ) {
622597 if ( $poValue->getMode() == SMWPrintRequest::PRINT_CATS ) {
623 - $categoryValues[$counter] = '';
 598+ $categoryValues[$counter] = ' ';
624599 $categoryLabelValues[$counter] = $poValue->getLabel();
625600 $categoryYesValues[$counter] = '';
626601 $categoryNoValues[$counter] = '';
@@ -679,29 +654,36 @@
680655 $counter++;
681656 }
682657 }
 658+ // remove empty property values
 659+ foreach ( $propertyValues as $key => $propertyValue ) {
 660+ $propertyValues[$key] = trim( $propertyValue );
 661+ if ( $propertyValue == '' ) {
 662+ unset( $propertyValues[$key] );
 663+ }
 664+ }
 665+
683666 $i = 0;
684667 $additionalPOs = array();
685 - if ( is_array( $propertyValues ) ) {
686 - $keys = array_keys( $propertyValues );
687 - foreach ( $keys as $value ) {
688 - $additionalPOs[$value] = $propertyValues[$value]; // array_merge won't work because numeric keys need to be preserved
689 - }
 668+
 669+ $keys = array_keys( $propertyValues );
 670+ foreach ( $keys as $value ) {
 671+ $additionalPOs[$value] = $propertyValues[$value]; // array_merge won't work because numeric keys need to be preserved
690672 }
691 - if ( is_array( $categoryValues ) ) {// same as testing $categoryLabelValues
692 - $keys = array_keys( $categoryValues );
693 - foreach ( $keys as $value ) {
694 - $additionalPOs[$value] = $categoryValues[$value]; // array_merge won't work because numeric keys need to be preserved
695 - }
 673+
 674+
 675+ $keys = array_keys( $categoryValues );
 676+ foreach ( $keys as $value ) {
 677+ $additionalPOs[$value] = $categoryValues[$value]; // array_merge won't work because numeric keys need to be preserved
696678 }
697 - if ( is_array( $mainColumnLabels ) ) {
698 - $keys = array_keys( $mainColumnLabels );
699 - foreach ( $keys as $value ) {
700 - $additionalPOs[$value] = $mainColumnLabels[$value]; // array_merge won't work because numeric keys need to be preserved
701 - }
 679+
 680+ $keys = array_keys( $mainColumnLabels );
 681+ foreach ( $keys as $value ) {
 682+ $additionalPOs[$value] = $mainColumnLabels[$value]; // array_merge won't work because numeric keys need to be preserved
702683 }
 684+
703685 ksort( $additionalPOs );
704686 foreach ( $additionalPOs as $key => $value ) {
705 - if ( is_array( $propertyValues ) && array_key_exists( $key, $propertyValues ) ) {
 687+ if ( array_key_exists( $key, $propertyValues ) ) {
706688 /*
707689 * Make an element for additional properties
708690 */
@@ -709,46 +691,53 @@
710692 $result .= '<span class="smwquisortlabel"><span class="smw-remove"><a href="javascript:removePOInstance(\'sort_div_' . $i . '\')"><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>';
711693 $result .= wfMsg( 'smw_qui_property' ) . '</span>';
712694 $result .= Html::input( 'property[' . $i . ']', $propertyValues[$key], 'text', array( 'size' => '25', 'id' => "property$i" ) ) . "\n";
 695+ $urlArgs["property[$i]"] = $propertyValues[$key];
713696 $result .= Html::openElement( 'select', array( 'name' => "order[$i]" ) );
714 -
715 - $if1 = ( !is_array( $orderValues ) || !array_key_exists( $key, $orderValues ) || $orderValues[$key] == 'NONE' );
 697+ if ( array_key_exists( $key, $orderValues ) ) {
 698+ $urlArgs["order[$i]"] = $orderValues[$key];
 699+ }
 700+ $if1 = ( !array_key_exists( $key, $orderValues ) || $orderValues[$key] == 'NONE' );
716701 $result .= Xml::option( wfMsg( 'smw_qui_nosort' ), "NONE", $if1 );
717702
718 - $if2 = ( is_array( $orderValues ) && array_key_exists( $key, $orderValues ) && $orderValues[$key] == 'ASC' );
 703+ $if2 = ( array_key_exists( $key, $orderValues ) && $orderValues[$key] == 'ASC' );
719704 $result .= Xml::option( wfMsg( 'smw_qui_ascorder' ), "ASC", $if2 );
720705
721 - $if3 = ( is_array( $orderValues ) && array_key_exists( $key, $orderValues ) && $orderValues[$key] == 'DESC' );
 706+ $if3 = ( array_key_exists( $key, $orderValues ) && $orderValues[$key] == 'DESC' );
722707 $result .= Xml::option( wfMsg( 'smw_qui_descorder' ), "DESC", $if3 );
723708
724709 $result .= Xml::closeElement( 'select' );
725710
726 - $if4 = ( is_array( $displayValues ) && array_key_exists( $key, $displayValues ) );
 711+ $if4 = ( array_key_exists( $key, $displayValues ) );
727712 $result .= Xml::checkLabel( wfMsg( 'smw_qui_shownresults' ), "display[$i]", "display$i", $if4 );
 713+ if ( $if4 ) $urlArgs["display[$i]"] = '1';
728714
729 - if ( is_array( $propertyLabelValues ) && array_key_exists( $key, $propertyLabelValues ) ) {
 715+ if ( array_key_exists( $key, $propertyLabelValues ) ) {
730716 $result .= Html::hidden( "prop_label[$i]", $propertyLabelValues[$key], array( 'id' => "prop_label$i" ) );
 717+ $urlArgs["prop_label[$i]"] = $propertyLabelValues[$key];
731718 } else {
732719 $result .= Html::hidden( "prop_label[$i]", '', array( 'id' => "prop_label$i" ) );
733720 }
734 - if ( is_array( $propertyFormatValues ) && array_key_exists( $key, $propertyFormatValues ) ) {
 721+ if ( array_key_exists( $key, $propertyFormatValues ) ) {
735722 $result .= Html::hidden( "prop_format[$i]", $propertyFormatValues[$key], array( 'id' => "prop_format$i" ) );
 723+ $urlArgs["prop_format[$i]"] = $propertyFormatValues[$key];
736724 } else {
737725 $result .= Html::hidden( "prop_format[$i]", '', array( 'id' => "prop_format$i" ) );
738726 }
739 - if ( is_array( $propertyLimitValues ) && array_key_exists( $key, $propertyLimitValues ) ) {
 727+ if ( array_key_exists( $key, $propertyLimitValues ) ) {
740728 $result .= Html::hidden( "prop_limit[$i]", $propertyLimitValues[$key], array( 'id' => "prop_limit$i" ) );
 729+ $urlArgs["prop_limit[$i]"] = $propertyLimitValues[$key];
741730 } else {
742731 $result .= Html::hidden( "prop_limit[$i]", '', array( 'id' => "prop_limit$i" ) );
743732 }
744 - $result .= ' <a id="more' . $i . '" "class="smwq-more" href="javascript:smw_makePropDialog(\'' . $i . '\')"> ' . WfMsg( 'smw_qui_options' ) . ' </a> ';
 733+ $result .= ' <a id="more' . $i . '" "class="smwq-more" href="javascript:smw_makePropDialog(\'' . $i . '\')"> ' . WfMsg( 'smw_qui_options' ) . ' </a> ';
745734
746735 $result .= Xml::closeElement( 'div' );
747736 $i++;
748737 }
749 - if ( is_array( $categoryValues ) && array_key_exists( $key, $categoryValues ) &&
750 - is_array( $categoryLabelValues ) && array_key_exists( $key, $categoryLabelValues ) &&
751 - is_array( $categoryYesValues ) && array_key_exists( $key, $categoryYesValues ) &&
752 - is_array( $categoryNoValues ) && array_key_exists( $key, $categoryNoValues ) ) {
 738+ if ( array_key_exists( $key, $categoryValues ) ) {
 739+ if ( !array_key_exists( $key, $categoryLabelValues ) ) $categoryLabelValues[$key] = '';
 740+ if ( !array_key_exists( $key, $categoryYesValues ) ) $categoryYesValues[$key] = '';
 741+ if ( !array_key_exists( $key, $categoryNoValues ) ) $categoryNoValues[$key] = '';
753742 /*
754743 * Make an element for additional categories
755744 */
@@ -759,11 +748,15 @@
760749 Html::hidden( "cat_label[$i]", $categoryLabelValues[$key], array( 'id' => "cat_label$i" ) ) .
761750 Html::hidden( "cat_yes[$i]", $categoryYesValues[$key], array( 'id' => "cat_yes$i" ) ) .
762751 Html::hidden( "cat_no[$i]", $categoryNoValues[$key], array( 'id' => "cat_no$i" ) ) .
763 - ' <a id="more' . $i . '" "class="smwq-more" href="javascript:smw_makeCatDialog(\'' . $i . '\')"> ' . WfMsg( 'smw_qui_options' ) . ' </a> ' .
 752+ ' <a id="more' . $i . '" "class="smwq-more" href="javascript:smw_makeCatDialog(\'' . $i . '\')"> ' . WfMsg( 'smw_qui_options' ) . ' </a> ' .
764753 Xml::closeElement( 'div' );
 754+ $urlArgs["category[$i]"] = ( $categoryValues[$key] == '' ) ? ' ':$categoryValues[$key];
 755+ $urlArgs["cat_label[$i]"] = $categoryLabelValues[$key];
 756+ $urlArgs["cat_yes[$i]"] = $categoryYesValues[$key];
 757+ $urlArgs["cat_no[$i]"] = $categoryNoValues[$key];
765758 $i++;
766759 }
767 - if ( is_array( $mainColumnLabels ) && array_key_exists( $key, $mainColumnLabels ) ) {
 760+ if ( array_key_exists( $key, $mainColumnLabels ) ) {
768761 /*
769762 * Make an element for main column
770763 */
@@ -772,10 +765,12 @@
773766 wfMsg( 'smw_qui_rescol' ) . '</span>' .
774767 Xml::input( "maincol_label[$i]", '25', $mainColumnLabels[$key], array ( 'id' => "maincol_label$i" ) ) . " " .
775768 Xml::closeElement( 'div' );
 769+ $urlArgs["maincol_label[$i]"] = ( $mainColumnLabels[$key] == '' ) ? ' ':$mainColumnLabels[$key];
776770 $i++;
777771 }
778772 }
779773 $numSortValues = $i;
 774+ $this->setUrlArgs( $urlArgs );
780775 // END: create form elements already submitted earlier via form
781776
782777 // create hidden form elements to be cloned later
@@ -1174,8 +1169,11 @@
11751170 }
11761171
11771172 foreach ( $orders as $i => $order ) {
 1173+ $urlArgs = array();
11781174 $result .= "<div id=\"sort_div_$i\">" . wfMsg( 'smw_ask_sortby' ) . ' <input type="text" name="sort[' . $i . ']" value="' .
11791175 htmlspecialchars( $sorts[$i] ) . "\" size=\"25\"/>\n" . '<select name="order[' . $i . ']"><option ';
 1176+ $urlArgs["sort[$i]"] = htmlspecialchars( $sorts[$i] );
 1177+ $urlArgs["order[$i]"] = $order;
11801178 if ( $order == 'ASC' ) $result .= 'selected="selected" ';
11811179 $result .= 'value="ASC">' . wfMsg( 'smw_qui_ascorder' ) . '</option><option ';
11821180 if ( $order == 'DESC' ) $result .= 'selected="selected" ';
@@ -1183,6 +1181,7 @@
11841182 $result .= 'value="DESC">' . wfMsg( 'smw_qui_descorder' ) . "</option></select>\n";
11851183 $result .= '[<a class="smwq-remove" href="javascript:removeInstance(\'sort_div_' . $i . '\')">' . wfMsg( 'smw_qui_delete' ) . '</a>]' . "\n";
11861184 $result .= "</div>\n";
 1185+ $this->setUrlArgs( $urlArgs );
11871186 }
11881187
11891188 $hidden .= '<div id="sorting_starter" style="display: none">' . wfMsg( 'smw_ask_sortby' ) . ' <input type="text" size="25" />' . "\n";
@@ -1346,7 +1345,7 @@
13471346 $wgOut->addScript( $javascriptAutocompleteText );
13481347
13491348 }
1350 -
 1349+ $this->setUrlArgs( array( 'po' => $this->getPOStrings() ) );
13511350 return Html::element( 'textarea', array( 'id' => 'add_property', 'name' => 'po', 'cols' => '20', 'rows' => '6' ), $this->getPOStrings() );
13521351 }
13531352
@@ -1380,42 +1379,35 @@
13811380 }
13821381
13831382 /**
1384 - * Generates the url parameters based on passed parameters.
1385 - * UI implementations need to overload this if they use different form
1386 - * parameters.
 1383+ * Keeps track of the various Url Arguments used
13871384 *
1388 - * @return string An url-encoded string.
 1385+ * @var array of strings in the urlparamater=>value format
13891386 */
1390 - protected function getUrlTail() {
1391 - $urlTail = '&q=' . urlencode( $this->uiCore->getQuerystring() );
 1387+ protected $urlArgs = array();
13921388
1393 - $tmpArray = array();
1394 - $params = $this->uiCore->getParameters();
1395 - foreach ( $params as $key => $value ) {
1396 - if ( !in_array( $key, array( 'sort', 'order', 'limit', 'offset', 'title' ) ) ) {
1397 - $tmpArray[$key] = $value;
1398 - }
1399 - }
1400 - $urlTail .= '&p=' . urlencode( SMWInfolink::encodeParameters( $tmpArray ) );
 1389+ /**
 1390+ * Given an array of urlparameter=>value pairs, this method adds them to its
 1391+ * set of Url-arguments. If the urlparameter already exists, it is replaced by the supplied value
 1392+ *
 1393+ * @param array $args
 1394+ */
 1395+ protected function setUrlArgs( array $args ) {
 1396+ $this->urlArgs = array_merge( $this->urlArgs, $args );
 1397+ }
14011398
1402 - $printOutString = '';
1403 - foreach ( $this->uiCore->getPrintOuts() as $printout ) {
1404 - $printOutString .= $printout->getSerialisation() . "\n";
1405 - }
 1399+ /**
 1400+ *
 1401+ * @return array of strings in the urlparamater=>value format
 1402+ */
 1403+ protected function getUrlArgs() {
 1404+ return $this->urlArgs;
 1405+ }
14061406
1407 - if ( $printOutString != '' ) {
1408 - $urlTail .= '&po=' . urlencode( $printOutString );
1409 - }
1410 - if ( array_key_exists( 'sort', $params ) ) {
1411 - $urlTail .= '&sort=' . $params['sort'];
1412 - }
1413 - if ( array_key_exists( 'order', $params ) ) {
1414 - $urlTail .= '&order=' . $params['order'];
1415 - }
1416 -
1417 - return $urlTail;
 1407+ protected function resetUrlArgs() {
 1408+ $this->urlArgs = array();
14181409 }
14191410
 1411+
14201412 /**
14211413 * Displays a form section showing the options for a given format,
14221414 * based on the getParameters() value for that format's query printer.
@@ -1432,6 +1424,7 @@
14331425 $params = method_exists( $printer, 'getValidatorParameters' ) ? $printer->getValidatorParameters() : array();
14341426
14351427 $optionsHtml = array();
 1428+ $urlArgs = array();
14361429
14371430 foreach ( $params as $param ) {
14381431 // Ignore the parameters for which we have a special control in the GUI already.
@@ -1452,7 +1445,9 @@
14531446 '<br />' .
14541447 Html::element( 'em', array(), $param->getDescription() )
14551448 );
 1449+ $urlArgs['p[' . htmlspecialchars( $param->getName() ) . ']'] = $currentValue;
14561450 }
 1451+ $this->setUrlArgs( $urlArgs );
14571452
14581453 for ( $i = 0, $n = count( $optionsHtml ); $i < $n; $i++ ) {
14591454 if ( $i % 3 == 2 || $i == $n - 1 ) {
Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialQueryCreator.php
@@ -83,13 +83,14 @@
8484 *
8585 * @return string
8686 *
87 - * Overridden from parent to ignore GUI parameters 'format' 'limit' and 'offset'
 87+ * Overridden from parent to ignore some parameters.
8888 */
8989 protected function showFormatOptions( $format, array $paramValues, array $ignoredAttribs = array() ) {
9090 return parent::showFormatOptions( $format, $paramValues, array(
9191 'format', 'limit', 'offset', 'mainlabel', 'intro', 'outro', 'default'
9292 ) );
9393 }
 94+
9495 /**
9596 * Creates the input form
9697 *
@@ -127,7 +128,17 @@
128129 $result .= '</div>';
129130 // END: show|hide additional options
130131 $result .= '<div id="additional_options" style="display:none">';
131 -
 132+ $params = $this->uiCore->getParameters();
 133+ if ( array_key_exists( 'limit', $params ) ) {
 134+ $limit = $params['limit'];
 135+ } else {
 136+ $limit = '';
 137+ }
 138+ if ( array_key_exists( 'offset', $params ) ) {
 139+ $offset = $params['offset'];
 140+ } else {
 141+ $offset = '';
 142+ }
132143 $result .= '<fieldset><legend>' . wfMsg( 'smw_ask_otheroptions' ) . "</legend>\n" .
133144 Html::rawElement( 'div', array( 'style' => 'width: 30%; padding: 5px; float: left;' ),
134145 'Intro: <input name="p[intro]" size="32"/> <br/>' . wfMsg( 'smw_paramdesc_intro' )
@@ -138,6 +149,8 @@
139150 Html::rawElement( 'div', array( 'style' => 'width: 30%; padding: 5px; float: left;' ),
140151 'Default: <input name="p[default]" size="32"/> <br/>' . wfMsg( 'smw_paramdesc_default' )
141152 ) .
 153+ Html::hidden( 'p[limit]', $limit ) .
 154+ Html::hidden( 'p[offset]', $offset ) .
142155 '</fieldset>';
143156 $result .= '<fieldset><legend>' . wfMsg( 'smw_qc_formatopt' ) . "</legend>\n" .
144157 $formatBox[1] . // display the format options
@@ -176,9 +189,25 @@
177190 }
178191 $result .= '<input type="hidden" name="eq" value="no"/>' .
179192 "\n</form><br/>";
180 -
181193 return $result;
182194
183195 }
 196+
 197+ /**
 198+ * Overridden to include form parameters.
 199+ *
 200+ * @return array of strings in the urlparamater=>value format
 201+ */
 202+ protected function getUrlArgs() {
 203+ $tmpArray = array();
 204+ $params = $this->uiCore->getParameters();
 205+ foreach ( $params as $key => $value ) {
 206+ if ( !in_array( $key, array( 'sort', 'order', 'limit', 'offset', 'title' ) ) ) {
 207+ $tmpArray[$key] = $value;
 208+ }
 209+ }
 210+ $this->setUrlArgs( $tmpArray );
 211+ return $this->urlArgs;
 212+ }
184213 }
185214