Welcome to Habari plugin development, Bill!

Bill wrote:
> 
> 1) It sounds like the preferred approach for configuring a plugin is
> to add a menu option to the drop button to the right of the plugin
> description on the plugin page and have the the config options appear
> below. What would be the recommended approach *if* you had a lot of
> options that you wanted to break into groups: multiple entries in the
> drop button? Could the entry in the drop button take you to a
> dedicated configuration page?

You can add multiple items to the drop button, and each will display its 
own options in the plugin configuration.

We really want to discourage developers from producing entirely new 
admin pages just for plugin configuration options.  It is possible to 
do, but there are many good reasons not to.  Plugin devs should 
thoughtfully consider whether this is absolutely essential to making 
their plugins work.

To answer your question, "Could the entry in the drop button take you to 
a dedicated configuration page?":  The answer is "not directly".  The 
system is designed so that when you click the configuration button, 
Habari displays the requested form.  You could have the plugin redirect 
instead of displaying a form, but once again, I would really think about 
how the Habari UI works for end-users before I did that.

> 2) With this plugin, I have a new content type (photos) that would
> benefit from a separate admin set of pages. To access this, would that
> be from the plugin drop button (same approach as last line in first
> question.) or would a new entry be added to the menu?

When you create a new content type, the menu items to create and manage 
those items are automatically added to the menu.  These items will 
likely be moved into a submenu in the future, since the list could be 
long.  Also, as we complete ACL, Habari will dictate which content types 
a user has permission to create and only display those menu options, so 
these menu items should not be created directly by plugins.

> 3) When create a page or post, I want to be able to add a section to
> the post page (perhaps a button like the tags and settings buttons
> that allow adding content to the content window). Is there a hook for
> doing this?

Unlike WordPress, there isn't a hook for producing additional output in 
the form.  Instead, you define a hook that modifies the FormUI object 
that creates the posting form for your content type.  There is a 
screencast on how this is done:

http://www.habariproject.org/en/screencasts

The hook you need to use is action_form_publish($form, $post).

You will need to add a new fieldset to the publish_controls in the form, 
and then add your controls to that.  For example:

$my_fieldset = $form->publish_controls->append('fieldset', 
'my_fieldset', _t('My Fieldset'));
$my_fieldset->append('text', 'stuff', 'null:null', _t('Stuff'), 
'tabcontrol_text');
$my_fieldset->stuff->value = $post->info->stuff;

That should add a new tab and put a text control in it.

You should look at the form_publish() function in 
system/classes/adminhandler.php to see how the baseline publish form is 
built, which includes some fancier commands like for the tag selector.

Hopefully that gets you started.  If you have more questions, please 
don't hesitate to ask!

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to