<div class="gmail_quote">On Thu, Feb 12, 2009 at 10:01 PM, Patrick R. Michaud <span dir="ltr"><<a href="mailto:pmichaud@pobox.com">pmichaud@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Thu, Feb 12, 2009 at 09:41:30PM +0100, Peter Bowers wrote:<br>
><br>
> I looked at this once before and came to the conclusion that either (a) you<br>
> have to call pagelist twice or (b) you have to copy FPLTemplate() and make some<br>
> alterations. (This could be done as a recipe since $FPLFormatOpt holds this<br>
> function name.)<br>
<br>
</div>...or, if I'm wrong and it's not really possible to get to the matchcount<br>
easily, you can propose modifications to FPLTemplate() for the core. :-)<br>
<font color="#888888"></font></blockquote><div><br>With an invitation like that I'm not sure I can stay limited to just this particular issue... :-)<br><br>Right now pagelist is constructed somewhat as a chain link. FmtPageList calls $fmtfn (usually FPLTemplate()) which calls makepagelist(). No ifs, ands, or buts -- one calls the other which calls the last one. As a result there's very little possibility of any interaction in the process there...<br>
<br>If it were structured like this (function names intended for self-documentation, not for actual use):<br><br>function DoAPageList()<br>{<br> PageListOptionSetup();<br> $matchlist = MakeListOfPages($selection_options);<br>
FormatPageList($matchlist, $formatting_options);<br>}<br><br>Then there would be some *very useful* functions available to recipes along the way...<br><br>For instance, someone could construct 2 or 3 $matchlists, merge them together, and then hand it off to FormatPageList(). Or someone could use the pagelist options to get a $matchlist without having the format section called at all. Or someone could display the same pagelist in multiple formats without having to go through the selection of pages multiple times... (Hans's current project would be a perfect example of this -- the list of page-links to other chunks of the list wouldd simply be a format which printed a page-number-link for every n pages listed.) Basically it *hugely* increases the flexibility of pagelists...<br>
<br>Basically what I'm suggesting (although this may be too big a change -- I don't know what recipes may depend on the current implementation of FPL functions) is to separate the functionality of a pagelist. (a) Part of it is setting up defaults and options. Another part (b) is getting the appropriate list of pages. The last part (c) is actually formatting said list. Currently each function calls the next which means there's no possible division of those 3 functions. I'm lobbying for a mainline within pagelist.php...<br>
<br>*If* something like this were to occur I would suggest that the count=from..to be part of the *formatting* options rather than the *selection* options for reasons already explored in this thread...<br><br>Having said that I should hasten to add that I recognize pagelist.php to be a *very* tight and *highly* optimized piece of code and I recognize that the changes I am suggesting are not cosmetic... So if it's decided that this is not prudent at this time I totally understand..<br>
<br>-Peter<br></div></div>