/[drupal]/contributions/modules/elements/README.txt
ViewVC logotype

Contents of /contributions/modules/elements/README.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Thu Jan 31 00:20:16 2008 UTC (21 months, 3 weeks ago) by heine
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5, DRUPAL-6--1
File MIME type: text/plain
Initial commit of elements module - This module intends to become a repository for advanced form elements, other developers can use. For now, it contains a tableselect element type that can be used to easily create tables as seen on admin/user/user. It also contains an imagebutton ripped from views, but this does not work satisfactorily. This module was commissioned by the NCRV (http://www.ncrv.nl)
1 Description
2 ===========
3 Elements intends to become a library that provides complex form elements for developers to use in their modules.
4
5 Written by Heine Deelstra.
6
7 This module was commissioned by the NCRV (http://www.ncrv.nl/).
8
9 Elements provided
10 =================
11
12 1. tableselect
13 2. imagebutton (not working properly yet).
14
15
16 1. tableselect
17 ===============
18 Provides a table with checkboxes or radios in the first column (similar to the table on admin/user/user).
19
20 $header = array(
21 'field_key' => 'field_title',
22 'field_key1' => 'field_title1',
23 );
24
25 $options = array(
26 'id1'=> array(
27 'field_key' => 'value',
28 'field_key1' => 'another value',
29 ),
30
31 'id2'=> array(
32 'field_key' => 'value',
33 'field_key1' => 'another value',
34 ),
35 );
36
37 $form['test_multiselect'] = array(
38 '#type'=> 'tableselect',
39 '#header' => $header,
40 '#options'=> $options,
41 '#default_value'=> array('id1' => ''),
42 );
43
44
45 $form['test_single_select'] = array(
46 '#type'=> 'tableselect',
47 '#header' => $header,
48 '#options'=> $options,
49 '#multiple' => FALSE,
50 '#default_value'=> 'id1',
51 );
52
53 Properties tableselect
54 ======================
55 #header
56 The table header, an array of field_key => title pairs.
57 #options
58 The data displayed in the table. Nested array of id => array pairs where the array is an array of field_key => value pairs.
59 #multiple
60 Determines whether multiple values can be selected. Displays checkboxes when TRUE, radios when FALSE.
61 Default: TRUE
62 #advanced_select
63 Whether to provide advanced selection behaviour (SELECT ALL checkbox, SHIFT-select).
64 Default: TRUE - when #multiple is TRUE.
65 When #multiple is FALSE, always FALSE.
66 #default_value
67 Provide an array of id => x pairs for the ids that should be selected by default when #multiple is TRUE.
68 Provide the id as a scalar for the id that should be selected by default when #multiple is FALSE.

  ViewVC Help
Powered by ViewVC 1.1.2