[pmwiki-devel] UpdatePage and HandleEdit

Hans design5 at softflow.co.uk
Tue Dec 12 03:35:47 CST 2006


Tuesday, December 12, 2006, 8:57:37 AM, Dominique wrote:

> Surely because of the assignation:

> $action = 'edit';

> which occurs before the core $action processing, no?

you may be right there.
But it leaves me with  a problem:
I cannot do this from within a function.

$HandleActions['newaction'] = 'ProcessNewAction';

// called with action=newaction
function ProcesssNewAction($pagename, $args) {

       ....get a page name  etc. ....
       ....get some template stuff into $text

       if(isset($_POST['newpage'])) {
          ...try to get $text into newpage...
          $pagename = $newpage;
          $action = 'edit';  //does not get me into edit!
       }
       else
          ....we modify the page instead....
}

This does not work.
I still don't know a way to open a new page in edit mode
with template text modified or generated from within a function.
Or there is perhaps this way:
1. Create the template text.
2. Save it as a NewTemplate page.
3. Call the new page with action=edit&template=NewTemplate

I guess I like to avoid step 2, not wanting to create another page
first.

Hans




More information about the pmwiki-devel mailing list