mikelietz wrote:
> I see no reason not to move it, but why would you do so? My initial
> impression was to enable in-place editing in themes, but that seems to
> be troublesome by virtue of how heavy the form is, currently.
>
> $post->get_form(); is more readable than $form->out() (or at least
> makes more sense out of context) but is that the reason?
This could help enable in-place editing in themes or at least the
display of the publishing page someplace other than the admin.
Yes, the form is heavy, but what we can do is change the function
signature slightly to account for that. We won't need to specify the
$post or $newpost because the Post object knows that. What we can add
is an optional $context parameter.
When called from the admin, it'll use a predefined string, like 'admin'.
The value of $context will be passed into the plugin hook
'form_publish' (and into a new one that happens before the form is
generated so that the usual publish form can be completely overridden).
This will allow plugins to redefine the form via FormUI.
So if you call this in your theme:
$post->get_form('inline')->out();
It'll get the form for that post, and while processing it through
action_form_publish, the theme can notice that 'inline' was passed as
the context and make any necessary modifications for that context. Then
->out() outputs the form as usual.
This idea subsequently begs the question of whether the comment form
should also be a FormUI construction in the Comment class.
Owen
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at http://groups.google.com/group/habari-dev
-~----------~----~----~----~------~----~------~--~---