[Pmwiki-users] Re: Request for method to let plugins execute code after stdconfig.php

chr@home.se chr
Fri Jul 16 14:45:50 CDT 2004


On Fri, 16 Jul 2004, Patrick R. Michaud wrote:

> ...and this assumes that all of the default values are known and static
> before PmWiki loads customizations, which isn't true.  Many values you 
> would want a script to modify are commonly dependent on variables set 
> in config.php, such as $ScriptUrl, $PubDirUrl, $FarmD, $PageTemplateFmt, 
> etc.   

Oops, I should thought a bit more. Thanks for the clarification though.

> A good example is $PageFooterFmt.  A script would often like to be
> able to add its own features into the default value for $PageFooterFmt,
> but $PageFooterFmt is normally set within a layout template.

> But to me, this whole notion of modifying variable defaults by using 
> string replacements is simply The Wrong Way To Do It.

I completely agree with you here, I just haven't found any useful
alternatives (re-defining the entire variable suffers from similar
problems to search/replace). Perhaps what I should have requested from the
beginning are more hooks to let plugins modify parts.

A problem as a designer of a plugin is that you have no feeling for what
you can expect to be added to the standard pmwiki (in order to support
your plugin. e.g. if you need a hook).

> Better is to standardize well-defined places where modules can add in
> their own customizations as needed.
...
> If the current hooks aren't sufficient, let's judiciously add a few
> more.

There is one problem with that though... the plugin won't work with old 
versions of pmwiki. This might not be such a big deal in practice though.

Let me ask for a specific hook: We (I and John) would like to add a button
to the edit page, how could we do this?  The button should probably be 
next to the 'save','preview' and 'reset' buttons. It'd be labelled 
something like "Delete draft" and it's purpose is hopefully self-evident.

/Christian

PS. I hope I'm not completely off about adding a button, I think that was
the problem that caused me to initate this request.

-- 
Christian Ridderstr?m, +46-8-768 39 44               http://www.md.kth.se/~chr




More information about the pmwiki-users mailing list