[Typo3-dev] feature-patch for pi_list_browseresults

Rainer Kuhn kuhn at punkt.de
Tue Nov 2 16:15:57 CET 2004


Hi Michael,

first of all: Congratulations for the birth of your son - all the best for 
you and your family!  :-)


 > OK, you can download the patch here: ...
 > comments welcome

If you find some time for the less important things of life ;) , here are 
the announced test results from my first test of your patch (the following 
comments are pure "user test" results, I did not check the code).


 > the additional 'internal'-array-elements are:

My environment: I used the pi_list_browseresults.flexible2u.patch in TYPO3 
3.6.1 and in my test extension I assigned the new $this->internal array 
elements directly before calling $this->pi_list_browseresults()).


 > $this->internal['pagefloat']
 > (integer: number of page-links behind current page, if not set or negative:
 > "traditional behaviour")

Setting this array element did not work as I expected.

Example 1: I have 26 list elements with results_at_a_time = 5 and 
maxPages=5. When 'displaying 'results 1 to 5 out of 26' I got with the 
"traditional behaviour":

Page 1  Page 2  Page 3  Page 4  Page 5  Next >

After setting $this->internal['pagefloat'] to 3, I got

Page 3  Page 4  Page 5  Next >

The link to 'Page 2' is never displayed - regardless on which page I've been...

Example 2: Same configuration as above, but maxPages=10. The "traditional 
behaviour" displayed the same result as above, and after setting 
$this->internal['pagefloat'] to 3 nothing changed:

Page 1  Page 2  Page 3  Page 4  Page 5  Next >

Did I misunderstood something or is this _not_ the expected behaviour?


 > $this->internal['showFirstLast']
 > (if set to 1 it will show first and last links and also sets "show always
 > previous" to true, if not set or not 1 these links don't show ("traditional
 > behaviour");

Enabling the additional first and last links worked fine when setting 
$this->internal['showFirstLast']=1. But disabling by setting the value to 0 
did not work for me. In fact it didn't matter which value I've set for 
$this->internal['showFirstLast'], the first and last links showed up all the 
time. Disabling was only possible by deleting or commenting the line out.


 > $this->internal['showRange']
 > (if set to 1 it will show the Record-Range for each page instead of the
 > localized word for page and the pagenumber, if not set or not 1:
 > "traditional behaviour")

Same effect as with 'showFirstLast': enabling works fine, disabling works 
only by out-commenting the line.
OK, I had a quick look in the code now:

Patch line 94:
if (isset($this->internal['showRange']) and $this->internal['showRange']=1)
should be:
if (isset($this->internal['showRange']) and $this->internal['showRange']==1)
                                                                        ^^^^
Same matter for lines 69, 76, 101, 108.


The additional meaning to the first parameter $showResultCount (mentioned in 
another branch of this thread) works fine.


Testing the third parameter $wrapArr (also mentioned in the other branch of 
this thread) resulted sometimes in a "broken" display, e.g. with the 
following example displaying Page 1:

$wrapArr['disabledLinkWrap'] = '<div style="color:red">|</div>';
$this->internal['showFirstLast'] = 1;
$fullTable .= $this->pi_list_browseresults(1, '', $wrapArr);

The problem is that "|< First" and "< Previous" are no more members of the 
HTML table where the page links are contained in. Comparable effects with 
the other elements of $wrapArr...


I hope this helps - thanks for your work,

Cheers
Rainer




More information about the TYPO3-dev mailing list