Development

Changeset 19185

You must first sign up to be able to contribute.

Changeset 19185

Show
Ignore:
Timestamp:
06/11/09 22:17:39 (4 years ago)
Author:
joshiausdemwald
Message:

initial checkin

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfWidgetFormInputSWFUploadPlugin/README

    r19184 r19185  
    1 sfWidgetFormTreePlugin 
     1sfWidgetFormInputSWFUploadPlugin 
    22====================== 
    33 
    4 sfWidgetFormTreePlugin creates - similar to sfWidgetFormChoice/ChoiceMultiple - 
    5 a tree structure widget consisting of radio buttons or checkboxes. So you can 
    6 maintain hierarchical data whithin your symfony forms. 
    7  
    8 It has the same functionality as the wordpress "assign blog article to 
    9 categories x, y and z", to enlighten what this plugin may do for you. 
    10  
    11 The plugin widgets have a few validators that also can check simple constraints 
    12 (e.g. "self drops/movements" of nodes). 
    13  
    14 There is a screenshot to experience the look and feel of the widget. 
    15 No javascript required or included. 
     4sfWidgetFormInputSWFUploadPlugin decorates a file input widget with queued 
     5uploading capabilities, provided by SWFUpload (www.swfupload.org). 
    166 
    177Instructions: 
    188============= 
    199 
    20 sfWidgetFormTree provides a widget to render a structured group of checkboxes 
    21 or radiobuttons that represent nodes in a tree. 
    22  
    23 They are configured like all select/multiselect-widgets by giving a mandatory 
    24 array of choices. 
    25  
    26 Due the fact that a hierarchy is displayed, this array must have information 
    27 about that. 
    28  
    29 It is possible to pass 2 types of arrays: 
    30  
    31 Multi-Dim (with childnodes): 
    32 ---------------------------- 
    33  
    34       $choices = array( 
    35         1=> array('label'=>'test', 'children'=>array( 
    36           2=> array('label'=>'test2', 'children'=> array( 
    37             3=> array('label'=>'test3'), 
    38             4=> array('label'=>'hans') 
    39           )), 
    40           5=> array('label'=>'wurst') 
    41         )), 
    42         6=>array('label'=>'letzter') 
    43       ); 
    44  
    45 Single-DIM (with level/depth): 
    46 ------------------------------ 
    47  
    48     $choices = array( 
    49       1=>array('level'=>0, 'label'=>"+++1"), 
    50       2=>array('level'=>0, 'label'=>"+++2"), 
    51       3=>array('level'=>1, 'label'=>"+++3"), 
    52       4=>array('level'=>2, 'label'=>"+++4"), 
    53       8=>array('level'=>3, 'label'=>"+++8"), 
    54       9=>array('level'=>3, 'label'=>"+++9"), 
    55       10=>array('level'=>3, 'label'=>"+++10"), 
    56       11=>array('level'=>4, 'label'=>"+++11"), 
    57       12=>array('level'=>4, 'label'=>"+++12"), 
    58       13=>array('level'=>3, 'label'=>"+++13"), 
    59       5=>array('level'=>2, 'label'=>"+++5"), 
    60       6=>array('level'=>1, 'label'=>"+++6"), 
    61       7=>array('level'=>0, 'label'=>"+++7"), 
    62     ); 
    63  
    64 There is also a tree validator which allows to check against a given id (or 
    65 a collection of ids), so that it is not allowed to select a node within the tree 
    66 that is child of a given parent: 
    67  
    68     $this->validatorSchema['category_ids'] = new sfValidatorTreeMany(array( 
    69       'choices'=>$choices, 
    70       'restrict_select_below'=>array(10,6),  
    71       'required'=>false 
    72     )); 
    73  
    74 This could be useful if you deal e.g. with a taxonomy system and want to move 
    75 nodes with your admin form. In this case it is not allowed to move a category 
    76 as a child of it's own. With the option 
    77  
    78     'restrict_select_below'=>array(parent_node_1, ..., parent_node-n); 
    79  
    80 you can define the nodes that are not allowed to select (including its child 
    81 nodes). 
     10Use the widget like an ordinary file upload widget and configure it by 
     11passing custom options to its options array. 
    8212 
    8313Installation 
     
    9121With symfony 1.1/1.2, use: 
    9222 
    93     $ symfony plugin:install sfwidgetFormTreePlugin 
     23    $ symfony plugin:install sfWidgetFormInputSWFUploadPlugin 
    9424 
    9525Alternatively, if you don't have PEAR installed, you can download the latest 
     
    10131    $ php symfony cc 
    10232 
     33Publish the plugins assets 
     34 
     35    $ php symfony plugin:publish-assets 
     36 
    10337You're done. 
    10438 
     
    10741======= 
    10842 
    109 Thanks to the symfony team for this great framework. The few classes used within 
    110 this plugin are derived from the sfWidgetFormChoice class and -validator. 
    111 So it is merly an addon on existing, great functionality. 
     43The guys managing and devolping the SWFUpload flash movie as well as its 
     44javascript api should be mentioned here. Lern more at http://swfupload.org