[pmwiki-users] A save-and-view button
Randy Brown
randy at brownragfilms.com
Sat Feb 6 12:14:06 CST 2010
A preview begins with "Page is unsaved". That makes sense for "Preview", but would be confusing for "Save and edit".
Unless someone can suggest a better way, I'd create markup for a conditional test so the edit form can ask whether the request was "postedit". Something like this:
$Conditions['savingwithpreview'] = 'SavingWithPreview()';
function SavingWithPreview()
{
return (@$_REQUEST['postedit']>'')
}
Then on the edit form I'd put (:if savingwithpreview:) Page is unsaved (:ifend:)
This raises a question that I've been meaning to ask anyway: does adding custom conditional tests or custom page variables slow PmWiki's processing? If it doesn't slow my already slow wiki, I can think of all sorts of ways I might want to use them.
Randy
On Feb 6, 2010, at 2:17 AM, Petko Yotov wrote:
> On Saturday 06 February 2010 08:22:08, Simon wrote :
>>>
>>> This sounds great, can we have a preview just when 'save and edit' is used
>> rather than edit?
>
> Yes, instead of the line above, use this one:
> if(@$_REQUEST['postedit']>'') $_REQUEST['preview'] = 1;
More information about the pmwiki-users
mailing list