From: Reini U. <ru...@x-...> - 2004-03-16 17:52:20
|
Dan F schrieb: > Again, thanks for PhpWiki. Here is another patch (from 1.3.7 more or > less) to support an "initial_content" argument to my CreatePage plug-in. > This is so that I can put a "CreatePage" button on a category page that > creates another page that already has example text (the > "initial_content" parameter) to refer to the category. I'm not sure if > this is the right place to post patches; please give me more info on this. I'm not sure if we should allow the initial_content GET arg in the redirect, or just a template argument to take the initial_content from a existing template page. GET urls are limited in its length. pagenames are no problem. > In particular, I changed WikiPlugin->expandArg() so that it allows > quoting (via ~) of "[Restaurant]" (which would normally be evaluated to > the "Restaurant" arg of a request, which probably doesn't exist). This > allows me to put sufficient ~s in front of "[Restaurant]" to allow it to > pass through multiple layers of expansion (one ~ dissappears through > each layer). I hope changes such as these can be accepted into the > codebase. Just to support "[...]" in the initial_content param? Hmm, why not accept the template arg, which seems to be easier. function getDefaultArguments() { return array('s' => false, 'template' => false); } ... if ($template and $dbi->isWikiPage($template)) { $page = $dbi->getPage($template); $current = $page->getCurrentRevision(); $version = $current->getVersion(); $initial_content = $current->getPackedContent(); } ... -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |