From: Whit B. <wh...@tr...> - 2004-02-22 19:02:18
|
Hi, Are there instructions somewhere about how PhpWiki plugins work, or style guidelines for them, or ...? I'm looking for something at a level that assumes the reader knows PHP fairly well, but is new to PhpWiki and not too familiar with plugin architectures, let alone how PhpWiki instantiates one. What I want to be able to do is add an option where a page can include a subclass of its "children" in the page output, so that a class of links from a page to new pages which are intended as comments on it can afford an option of displaying those comments (other pages) integrated into the page - or not. Combine that with the new login and permissions scheme, and it might make for a useful addition to range of ways it can be used for collaboration on works-in-progress. This is something I'd like to be able to demo before April, so it looks like the best strategy to learn to build it as a plugin for the development version, rather than take an arbitrary timeslice of it and make a bunch of ugly hacks to get the desired behavior. But I haven't found where the PhpWiki plugin interface and design goals are spelled out yet. Thanks, Whit |
From: Reini U. <ru...@x-...> - 2004-02-22 19:25:45
|
Whit Blauvelt schrieb: > Are there instructions somewhere about how PhpWiki plugins work, or style > guidelines for them, or ...? I'm looking for something at a level that > assumes the reader knows PHP fairly well, but is new to PhpWiki and not too > familiar with plugin architectures, let alone how PhpWiki instantiates one. Best see all existing plugins, and for hardcore code the plugin loader: lib/WikiPlugin.php. We have four basic types of plugin invocation: <?plugin PluginName [args...] ?> The typical plugin returns the output of ->run() as HTML object. It can react on any argument, either from the plugin args in the page or the dynamic request args (GET or POST args). <?plugin-form PluginName [args...] ?> Displays a input type=text with the default argument <?plugin-link PluginName [args...] ?> ?? please ask Jeff. Never used that. <?plugin-head PluginName [args...] ?> Here you can set or change any HTML header. Useful for framesets, javascripts or redirects. > What I want to be able to do is add an option where a page can include a > subclass of its "children" in the page output, so that a class of links from > a page to new pages which are intended as comments on it can afford an > option of displaying those comments (other pages) integrated into the page - > or not. Combine that with the new login and permissions scheme, and it might > make for a useful addition to range of ways it can be used for collaboration > on works-in-progress. I don't understand it fully. You want to get the links from subpages and optionally display them? sounds easy. > This is something I'd like to be able to demo before April, so it looks like > the best strategy to learn to build it as a plugin for the development > version, rather than take an arbitrary timeslice of it and make a bunch of > ugly hacks to get the desired behavior. But I haven't found where the > PhpWiki plugin interface and design goals are spelled out yet. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |
From: Whit B. <wh...@tr...> - 2004-02-22 21:18:23
|
On Sun, Feb 22, 2004 at 08:18:10PM +0100, Reini Urban wrote: > I don't understand it fully. You want to get the links from subpages and > optionally display them? sounds easy. Hi Reini, Thanks for the pointers. Basically the goal is: - to optionally automatically add to each subsection of a page a special sort of link that goes to a wiki page intended for comments on that subsection - or at least to allow manual inserting of a new subclass of link that can support the next function: - to have the option of displaying the main page so that it includes these comment pages, perhaps with each section of the main page then being a simple two-cell table where the comments are to the right of the section being commented The second goal may be close to what UnfoldSubpages.php does. But I'm puzzled at the moment because when I test <?plugin UnfoldSubpages ?> in 1.3.7 it's not giving me anything. Maybe I don't understand what qualifies as a "subpage". Is it any normal linked page? If I could get that working, then have it only onfold those subpages whose links are of the special type allocated for marginal comments, that would be most of this little project. Anyway, the desire is to get something like marginal notes from readers in a situation where there's a primary author (or authors) who have perms to the main page, in which a draft document is presented. I've seen other wikis which allow comments on the end of a page, but comments alongside the sections of primary text could be more useful for this. I'd also want to link this into the new perms stuff, so that the primary authors could specify the group of readers with "comment" permission (equivalent to having write permission to a subdir belonging to the page). Thanks again. Pretty sure I'll do some version of this, as soon as I can get the basic PhpWiki concepts down. Have to admit a retrograde preference for procedural rather than OO style, but I've overcome it before.... Whit |
From: Reini U. <ru...@x-...> - 2004-02-22 23:30:26
|
Whit Blauvelt schrieb: > On Sun, Feb 22, 2004 at 08:18:10PM +0100, Reini Urban wrote: >>I don't understand it fully. You want to get the links from subpages and >>optionally display them? sounds easy. > Thanks for the pointers. Basically the goal is: > - to optionally automatically add to each subsection of a page a special > sort of link that goes to a wiki page intended for comments on that > subsection - or at least to allow manual inserting of a new subclass of > link that can support the next function: A subsection is everything from a header to the next header or the end. > - to have the option of displaying the main page so that it includes these > comment pages, perhaps with each section of the main page then being a > simple two-cell table where the comments are to the right of the section > being commented I see. Someting like UnfoldBacklinks. The new IncludeSiteMap does this. Use reclimit=1 for only Backlinks on this page: <?plugin IncludeSiteMap reclimit=1 pagename='ThisComment' includepages='' ?> > The second goal may be close to what UnfoldSubpages.php does. But I'm > puzzled at the moment because when I test <?plugin UnfoldSubpages ?> in > 1.3.7 it's not giving me anything. Maybe I don't understand what qualifies > as a "subpage". Is it any normal linked page? No, a subpage is a page with the SUBPAGE_SEPERATOR (default: "/") in the pagename. You want a linked page: see plugin/BackLinks > If I could get that working, > then have it only onfold those subpages whose links are of the special type > allocated for marginal comments, that would be most of this little project. > > Anyway, the desire is to get something like marginal notes from readers in a > situation where there's a primary author (or authors) who have perms to the > main page, in which a draft document is presented. I've seen other wikis > which allow comments on the end of a page, but comments alongside the > sections of primary text could be more useful for this. > > I'd also want to link this into the new perms stuff, so that the primary > authors could specify the group of readers with "comment" permission > (equivalent to having write permission to a subdir belonging to the page). > > Thanks again. Pretty sure I'll do some version of this, as soon as I can get > the basic PhpWiki concepts down. Have to admit a retrograde preference for > procedural rather than OO style, but I've overcome it before.... PhpWiki is special kind of OO beast :) -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |
From: Whit B. <wh...@tr...> - 2004-02-23 20:01:22
|
Hi, Is InlineParser.php where section headings (!, !!, !!!) get handled? Is there any way to have a plugin alter (extend) the action taken when the section heading is output, or does that require adding code to base files (such as InlineParser)? What I would like to do is either have any page toggleable so that all section headings are of an extended type, or else define a parallel set of codes (some other character than !) which produce this second sort of heading. The difference in this sort of heading is that each one would be accompanied by a link to a subpage for comments on that section. Then I want to present an option to "unfold" these individual subpages (via a variation on the current UnfoldSubpages.php that just goes for a single subpage) into right-aligned half-page-width tables starting at each section head. So each section head would alternately be accompanied by a "comment" link, or by a table on the right showing any existing comments as well as an "additional comment" link. I'm unclear whether the plugin architecture is rich enough to do this or whether I just need to hack PhpWiki's base files - which looks like it should be fairly simple once I can decipher just how those section headings get mangled. I'd rather make a proper plugin of it if that's possible for action on the level of the whole page, rather than just - like the plugins I've looked at so far - in a single spot on the page given over to the plugin. Thanks for any advice. The code is impressively concise, it's just taking a bit of study to get up to speed on it. Whit |