sfPropelManualOrderPlugin (For symfony 1.1)
Overview
This module adds simple manual ordering/sort for the admin generator
Installation
- Install the plugin
Get it from here and unpack into your plugins directory
- create the sf_sortable table in your database
CREATE TABLE `sf_sortable` ( `sortable_id` INTEGER NOT NULL AUTO_INCREMENT, `list_name` VARCHAR(40) NOT NULL, `object_id` INTEGER NOT NULL, `sort_val` INTEGER NOT NULL, PRIMARY KEY (`sortable_id`), KEY `list`(`list_name`, `sort_val`, `object_id`) )Type=MyISAM; Enable the sfOpenIDAuth module
- configure the generator.yml in your admin modules
param:
theme: sortable # change the theme
...
list:
object_actions:
_moveTop: - # add these actions
_moveUp: - #
_moveDown: - #
_moveBottom: - #
...
- link or copy the images to the admin dir
cp plugins/sfPropelManualOrderePlugin/web/images/* to web/sf/sf_admin/images/
Notes
- the plugin is designed for ease of use with the admin generator
- take a look at the sfPropelActAsSortableBehaviorPlugin, which adds similar behaviours to the model
- works with int primary keys
- doesn't enforce consistency (but inconsistencies don't break it)
- is inefficient for high transaction volumes or large lists
- is not concurrency safe
- there's an excellent tutorial on how to do manual order:
- icons are thanks to Mark James' great 'Silk' icon set: http://www.famfamfam.com/lab/icons/silk/
- you can add sort functions into your model classes e.g. in
lib/model/MyClass.php, add the lines:
// adding moveUp, moveDown, toTop, toBottom, getSortRank, getSortedList (uses sfMixer/__call) sfSortablePeer::addSortFunctions('MyClass');
Changelog
1.0: initial release, copy Beetween version for symfony 1.0 and the new default template for sfPropelAdmin
Attachments
- sfPropelManualOrderPluginFor11.tar.gz (19.8 kB) - added by cedric on 07/02/08 14:58:47.