[Pmwiki-users] [PATCH] Allow setting of BasicLayoutVars in local/group/page config
Patrick R. Michaud
Mon Jun 21 08:25:48 CDT 2004
On Mon, Jun 21, 2004 at 10:08:58AM -0400, Ari Pollak wrote:
> Hm, I'm not seeing how this creates a problem. If the user doesn't set
> $PageEditFmt, and the template doesn't set $PageEditFmt, then PmWiki
> should just fall back to setting the default, right?
PmWiki has traditionally set $PageEditFmt *before* processing user
settings and templates, because then administrators can modify the
default value of $PageEditFmt (using str_replace and preg_replace)
rather than setting the entire value. By modifying the default
instead of setting a completely new value, an admin retains any new
features that are added into $PageEditFmt by new versions of PmWiki.
However, this use is much less common now that templates have been
developed, and it might make sense to go ahead and set $PageEditFmt
after templates have had a chance to do their thing. I'll have to
think about this a fair bit.
(Side note: Early versions of PmWiki also tried to put user-customizable
config variables at the *beginning* of the pmwiki.php script so that it
would be easier for an admin to figure out what "could" be set. Of course,
PmWiki has since evolved to the point where this isn't really true
> Not only that, but
> PageEditFmt isn't actually contained in $BasicLayoutVars, so this
> patch shouldn't even affect that.
No, $BasicLayoutVars doesn't define which variables are set/modified
by tlayout.php, it simply specifies which variables are a part of the
layout of *every* HTML page produced by PmWiki. Any variable that is
of the form $Page...Fmt can be set by a template, including $PageEditFmt.
$PageEditFmt isn't in $BasicLayoutVars because it doesn't occur
in every HTML page PmWiki produces.
More information about the pmwiki-users