[Typo3-dev] feature-patch for pi_list_browseresults

Michael H.E. Roth mher at mher.de
Sat Nov 6 16:05:34 CET 2004


Rainer Kuhn wrote:

>> maybe I should change the name? But to what?
> 
> Hmm, don't know yet...
> 
so I'll stick to it - for now.

>> Well, I could add these alpha-values to the possible integer values:
>> 'R' would translate into 1
>> 'C' would translate into ceil(($maxPages-1)/2)
>> 'L' would translate into $maxPages-2
> 
> I'm not sure if this 'L' translation works for all ranges of maxPages?
it does since I check the range afterwards, but for maxPages == 2 the
results of 'R' and 'L' might be different than expected! 'R' means: 1
extra Page to the right, 'L' means 1 extra Page to the left =>
'R' => |< first < prev _Page x_ Page x+1 next > last >|
'L' => |< first < prev Page x _Page x+1_ next > last >|

>> maybe I should introduce another marker: ###fromto### so you also can wrap
>> the whole range: like <...>1 to 5</...> and not only each number by itself.
> 
> Yes, this could be helpful for some cases.
I changed all markers to UPPERCASE since this seems to be the standard in
all other tslib-classes.
Now the following markers will be recognized:
###FROM###, ###TO###, ###FROM_TO###, ###CURRENT_PAGE###, ###TOTAL_PAGES###

>>>One last proposal for improvement: maybe an additional parameter to
>>>disable linking of the currently active page link could make sense.
>>>IMHO the "traditional behaviour" of the list browser (linking the
>>>currently active page same as all other page links) is a little
>>>irritating.
>> 
>> good idea, how should we control this: via
>> $this->internal['dontLinkCurrentPage'] or via an extra parameter
>> function pi_link_browseresult (... , $dontLinkCurrentPage=0) ?
> 
> I would prefer $this->internal['dontLinkCurrentPage'] as you don't have
> to change existing method calls of pi_link_browseresult() for using this
> new feature.
$this->internal['dontLinkCurrentPage'] is now recognised and if set to 1
will prevent that the "current page" will be wrapped in hyperlink-markers

Patch is downloadable at
http://www.mher.de/pi_list_browseresults-3.1.0.patch.gz

I hope I didn't put new typos in (didn't test due to time restrictions).

Michael
-- 
Michael H.E. Roth




More information about the TYPO3-dev mailing list