News

2011-03-16

Applied patch that adds support for 'checked' => 'checked' in choices array. Thanks to Michał Piotrowski

Further changes are available by SVN only.

What is this?

sfWidgetFormTreePlugin creates - similar to sfWidgetFormChoice/ChoiceMultiple - a tree structure widget consisting of radio buttons or checkboxes. So you can maintain hierarchical data whithin your symfony forms.

It has the same functionality as the wordpress "assign blog article to categories x, y and z", to enlighten what this plugin may do for you.

The plugin widgets have a few validators that also can check simple constraints (e.g. "self drops/movements" of nodes).

There is a screenshot to experience the look and feel of the widget. No javascript required or included.

Developers

License

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Release 1.0.1 - 31/05/2009

Release 1.0.0 - 30/05/2009

sfWidgetFormTreePlugin

sfWidgetFormTreePlugin creates - similar to sfWidgetFormChoice/ChoiceMultiple -
a tree structure widget consisting of radio buttons or checkboxes. So you can
maintain hierarchical data whithin your symfony forms.

It has the same functionality as the wordpress "assign blog article to
categories x, y and z", to enlighten what this plugin may do for you.

The plugin widgets have a few validators that also can check simple constraints
(e.g. "self drops/movements" of nodes).

There is a screenshot to experience the look and feel of the widget.
No javascript required or included.

Instructions:

sfWidgetFormTree provides a widget to render a structured group of checkboxes
or radiobuttons that represent nodes in a tree.

They are configured like all select/multiselect-widgets by giving a mandatory
array of choices.

Due the fact that a hierarchy is displayed, this array must have information
about that.

This could be useful if you deal e.g. with a taxonomy system and want to move
nodes with your admin form. In this case it is not allowed to move a category
as a child of it's own. With the option

'restrict_select_below'=>array(parent_node_1, ..., parent_node-n);

you can define the nodes that are not allowed to select (including its child
nodes).

Installation

(Install instructions taken from README in sfThumbnailPlugin, (c) Fabien Potencier)

To install the plugin for a symfony project, the usual process is to use the
symfony command line.

With symfony 1.1/1.2, use:

$ symfony plugin:install sfwidgetFormTreePlugin

Alternatively, if you don't have PEAR installed, you can download the latest
package attached to this plugin's wiki page and extract it under your project's
plugins/ directory.

Clear the cache to enable the autoloading to find the new classes:

$ php symfony cc

You're done.

Credits

Thanks to the symfony team for this great framework. The few classes used within
this plugin are derived from the sfWidgetFormChoice class and -validator.
So it is merly an addon on existing, great functionality.