[pmwiki] Re: [Pmwiki-users] Approach for handling Diff

Bernhard Weichel in pmwiki-users pmwiki-users at b-weichel.2in.de
Sat Jun 14 11:33:35 CDT 2003


Patrick R. Michaud wrote:
> On Sat, Jun 14, 2003 at 01:47:50PM +0200, Bernhard Weichel in
> pmwiki-users wrote:
>> the new pagelayout approach in Version 0.5.0 is not applicable to
>> diffs.
>>
>> So I propose that there is also a Variable simmilar to
>> HandleBrowseFmt and HandleEditFmt HandleSearchFmt
>>
>> for Diff, Refcount and all other actions.
>
> I agree, I just haven't had a chance to implement these yet, and I'm
> not exactly sure what model to follow.  One model is to do it the
> way the HandleEdit and the search operations currently work (text
> substitution in the $PageEditFmt and $PageSearchFmt variables) or to
> do it the way HandleBrowse and HandleDiff currently work (sandwiching
> the processed output between header and footer fmt variables).
>

I think, this is a question in general

PrintFmt ... could also be implemented as RenderFmt which would allow
to do further processing before it is output.

nevertheless, there from the perspecive of features there is no big
difference between

$HandleDiffFmt = array(&$HTMLStartFmt,&$PageHeaderFmt,&$PageTitleFmt,
  "function:PrintTextDiff",&$PageFooterFmt,&$HTMLEndFmt);

and

$HandleDiffFmt = array(&$HTMLStartFmt,&$PageHeaderFmt,&$PageTitleFmt,
  "$TextDiff",&$PageFooterFmt,&$HTMLEndFmt);


in the latter case TextDiff must be set somewhee before the page is
produced.

I managed to embedd the Diff output by dropping the Fmt Variables used by
HandleDiff:

if ($action=="diff") $action="thediff";  // prevent pmwiki to call
HandleDiff implicitly ...
$PageDiffFmt = "";
$PageDiffFootFmt = "";
$HTMLStartFmt = "";

and in my default.browse.php I have:
          <div class='wikibody  '>
            <?php
              $myaction=FmtPageName("\$action",$pagename);
              if ($myaction=="browse")
                {
                 PrintFmt($pagename, "wiki:\$Group.\$Title");
                }
               else if ($myaction=="thediff")
                {
                 HandleDiff($pagename);
                }
             ?>
           </div>

then diff uses the same layout as browse. You can see this in
www.b-weichel.2in.de/rittertag. you can see that all pages (except refcount)
use the same page layout which comes from one particular file. Due to the
glory of PrintFmt (yes, I am really excited about this), menu etc. is still
group specific if needed.

*This is my comment about the new page layout facilities: it is really
great!*

With the search page it is more complicated, since search operation actualy
returns three result items:
* the list of pages found
* the number of pages found
* the number of pages used for search

In this case the variable subsitution is more flexible.

--bernhard





More information about the pmwiki-users mailing list