From: Reini U. <ru...@x-...> - 2004-11-26 07:42:10
|
Pascal Giard (QC/EMC) schrieb: > > Pascal Giard (QC/EMC) schrieb: > > i also added the "redirect" parameter. > > > at the moment, it's boolean, but maybe it'd be smarter to make it > > > support the destination page as a value ? > > > > > > That might be interesting if you modify a page from another > > one and want > > > to come back to the modificator. > > > > What I really want is the following as default: > > > > If the current page and the target page (the page argument) are the > > same, display after the successful AppendText action the changed page > > directly, and an AppendText notification at the top of the > > page. As on > > SearchHighlight and > > > > No link to the changed page, the page directly. > > so you want something like: > > if ( $args['caller'] == $pagename ) { > $newrevision = $page->getCurrentRevision(); > return HTML($newrevision->getTransformedContent()); > } That's probably too expensive. I think of something simplier, just passing $errmsg to the page, and redirecting. See the bottom. > btw, i don't understand why the php parser doesn't like: > $page->getCurrentRevision()->getTransformedContent() php4 is not really a truly parsed language yet, just a simple but efficient hack. you need php5 or perl or java for such advanced syntax features :) > what's the problem with that ? > how am i suppose to workaround that cleanly ? > > > Only if the basepage is different, display the link to the > > changed page. > > Well... it's not really the basepage as the basepage is AppendText... > but i understand what you mean. > > > > PS: do you plan to add the snippets you pasted me in the > > standard edit > > > page ? > > > Something like this, just better. The AddCategory button is already > > there, the plugin part not yet. > > What is missing is that the popup window on the AddCategory button > > should generate an extra request to get those pages. A > > category "popup on demand". > > ah oki, nice ;) > ---- > > from a previous msg: > > The only "major" problem we have now is the > > "Go to ", HTML::em(WikiLink($pagename)), "." part, which should be > > translatable. > > for some reason, > $message->pushContent(sprintf(_("Go to %s."), $link->asXml())); > doesn't work as i expected... > so i'm using: > $message->pushContent(HTML::Raw(sprintf(_("Go to %s."), $link->asXml()))); > > there must be a cleaner way!? It should, but I have no time to write yet another basic msg-formatter. After the pending 1.3.11 release. > I'm sending you yet another version of AppendText... but there's at > least one thing that needs to be modified: > it should not be possible for the user to specify the value of the > caller variable (see getDefaultArguments()). $args['caller'] is the same as $request->getArg($pagename). But we don't have to display again the changed page. Since AppendText is just a side-effect we should let the basic browse action generate that page, and either invalidate the cache (if AppendText is at the very fronm of the page) or redirect to the new page (if it's somewhere in between or after). // AppendText has been called from the same page that got modified // so we directly show the page. if ( $request->getArg($pagename) == $pagename ) { // just invalidate the cache. //$dbi->touch(); // or the plugin is at the end we better do another browse loop. HTML($request->redirect(WikiURL($pagename, false, 'absurl'), false)); } elseif ... -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |