Development

sfPropelManualOrderPluginFor11 (diff)

You must first sign up to be able to contribute.

Changes from Version 1 of sfPropelManualOrderPluginFor11

Show
Ignore:
Author:
cedric (IP: 82.243.37.107)
Timestamp:
07/02/08 14:58:11 (9 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • sfPropelManualOrderPluginFor11

    v0 v1  
     1= sfPropelManualOrderPlugin (For symfony 1.1) = 
     2 
     3== Overview == 
     4 
     5This module adds simple manual ordering/sort for the admin generator 
     6 
     7[[Image(screenshot.png)]] 
     8 
     9== Installation == 
     10 
     11  * Install the plugin 
     12   
     13  Get it [http://trac.symfony-project.com/trac/attachment/wiki/sfPropelManualOrderPluginFor11/sfPropelManualOrderPluginFor11.tar.gz?format=raw from here] and unpack into your plugins directory 
     14   
     15  * create the sf_sortable table in your database 
     16 
     17  {{{ 
     18                CREATE TABLE `sf_sortable` 
     19                ( 
     20                        `sortable_id` INTEGER  NOT NULL AUTO_INCREMENT, 
     21                        `list_name` VARCHAR(40)  NOT NULL, 
     22                        `object_id` INTEGER  NOT NULL, 
     23                        `sort_val` INTEGER  NOT NULL, 
     24                        PRIMARY KEY (`sortable_id`), 
     25                        KEY `list`(`list_name`, `sort_val`, `object_id`) 
     26                )Type=MyISAM; 
     27                Enable the sfOpenIDAuth module 
     28  }}} 
     29 
     30  * configure the generator.yml in your admin modules 
     31 
     32  {{{ 
     33  param: 
     34    theme:            sortable                           # change the theme 
     35         
     36        ... 
     37         
     38    list: 
     39      object_actions: 
     40       _moveTop: -                     # add these actions 
     41                         _moveUp: -                      #  
     42       _moveDown: -                    #  
     43       _moveBottom: -                  #  
     44         
     45        ... 
     46  }}} 
     47 
     48  * link or copy the images to the admin dir 
     49 
     50 {{{ 
     51  cp plugins/sfPropelManualOrderePlugin/web/images/* to web/sf/sf_admin/images/ 
     52 }}} 
     53 
     54== Notes == 
     55        - the plugin is designed for ease of use with the admin generator 
     56        - take a look at the [http://trac.symfony-project.com/trac/wiki/sfPropelActAsSortableBehaviorPlugin sfPropelActAsSortableBehaviorPlugin], which adds similar behaviours to the model 
     57        - works with int primary keys 
     58        - doesn't enforce consistency (but inconsistencies don't break it) 
     59        - is inefficient for high transaction volumes or large lists 
     60        - is not concurrency safe 
     61 
     62        - there's an excellent tutorial on how to do manual order: 
     63                http://web.archive.org/web/20060519130448/http://www.symfony-project.com/content/book/page/sortable.html        
     64        - icons are thanks to Mark James' great 'Silk' icon set: 
     65          http://www.famfamfam.com/lab/icons/silk/ 
     66        - you can add sort functions into your model classes e.g. in 
     67          lib/model/MyClass.php, add the lines: 
     68   {{{ 
     69                // adding moveUp, moveDown, toTop, toBottom, getSortRank, getSortedList (uses sfMixer/__call) 
     70                sfSortablePeer::addSortFunctions('MyClass');  
     71   }}}   
     72 
     73== Changelog == 
     74 
     75 
     761.0: initial release, copy Beetween version for symfony 1.0 and the new default template for sfPropelAdmin 
     77