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

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

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


Revision 1.2 - (show annotations) (download)
Mon Nov 3 15:30:38 2008 UTC (12 months, 3 weeks ago) by meba
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, DRUPAL-6--1-1, HEAD
Changes since 1.1: +16 -7 lines
File MIME type: text/plain
Adding a link to module documentation at http://drupal.org/node/329511. Thanks Gabor Hojtsy for security review of this module.
1 Views Embed Form
2 ================
3
4 Version
5 =======
6 Compatible with 6.x version of Drupal core
7
8 Author
9 ======
10 Jakub Suchy, <info at jsuchy dotNOSPAM cz>
11
12 Examples
13 ========
14
15 Every module developer who would like to embed his form in view needs to
16 create function called MODULENAME_views_embed_form(). Always think about
17 permissions for the form you want to embed. For example if the form should be
18 accessible only to an user with "administer content", don't forget to check it.
19 Example:
20
21 function testmodule_views_embed_form() {
22 if (user_access('administer content')) {
23 return array(
24 // Key in this array is the name of a form and also the name of a form function.
25 'testmodule_form' => t('Form for testing module'),
26 // Value in this array is a human-readable name of the form, use t() to allow internationalization.
27 'testmodule_basket_form' => t('Add to basket form'),
28 );
29 }
30 }
31
32 Then edit a view, add a field in group Embedded and select your form name.
33 Everytime a view is displayed, your form is called for every view row. Row
34 fields (including node nid) are passed as an argument to the form. Example:
35
36 function testmodule_form(&$form_state, $fields) {
37 // $fields are from a view, useful when you need to know node id for this row.
38 // It should be $fields->nid.
39 }
40
41 More documentation
42 ==================
43 See handbook page: http://drupal.org/node/329511

  ViewVC Help
Powered by ViewVC 1.1.2