[Typo3-dev] feature-patch for pi_list_browseresults

Michael H.E. Roth mher at mher.de
Fri Oct 29 14:22:46 CEST 2004


Hi Peter,

as you suggested, I tried to make the whole thing more flexible, still 
without breaking the "traditional" behaviour.
The new patch can be downloaded from:
http://www.mher.de/pi_list_browseresults.flexible.patch.gz

it has to be applied to the original class.tslib_pibase.php !

changes:
added a third parameter ($wrapArr) which can contain the following elements:
['disabledLinkWrap']
['inactiveLinkWrap']
['activeLinkWrap']
['LinksWrap']
['showResultsWrap']
['browseBoxWrap']
['showResultsNumbersWrap']

each can contain a string that will be used as the wrap-string with the 
function $this->cObj->wrap

if the element ['showResultsNumbersWrap'] is not set, the LocalLang-String 
'pi_list_browseresults_displays' is expected to be in the 
"traditional"-format.
if it is set the localLang-String 'pi_list_browseresults_displays' is 
expected to contain the template markers ###from###, ###to### and 
###outof### (lowest shown record, highest shown record, total number of 
records).

Now you could define in TypoScript something like (untested yet)
pi.....wrappers {
   disabledLinkWrap = <span class="disabledLink">|</span>
   activeLinkWrap = <span class="activeLink">|</span>
...
}

and in your plugin-code:
you could do
$browsebox = $this->pi_list_browseresults(1,'',$this->conf['wrappers.']);

is that what you meant?

If nobody objects within the next couple of days I will send the patch to 
Kasper as a suggestion for the next release...

Maybe we should also tackle the other hardcoded parts in this area 
(searchbox, ...)

Greetings

Michael
--
Michael H.E. Roth

Peter Niederlag wrote:
>>> I added some - I think - nice features to the function 
>>> pi_list_browseresults in class.tslib_pibase.php:
>>>
>>> - optional first and last links
>>> - optional "floating" of the displayed pages (i.e. with maxPages=5 and 
>>> displayed page is 7 of 10, links to pages 4 through 8 are displayed, the 
>>> number of pages past the current page is configurable from 0 to 
>>> maxPages - 1)
>>> - optional displaying ie  1-20 21-40 ... instead of    Page 1  Page 2 
>>> ....
>>> - it doesn't change the behaviour if the additional 
>>> 'internal'-array-elements don't exist.
>>>
>>> Do you think these are useful additions
>>
>> I think these are _very_ useful additions. The display features of 
>> pi_list_browseresults IMHO have not been very useful for me in many 
>> cases.
>
> very useful. :->
>
> If I am not mistakeing the <table> stuff is harcoded in there as well. 
> might be really nice if we could abstract that too, into either template 
> or TS.






More information about the TYPO3-dev mailing list