A standard technique for module confirmation dialogues?
I'm writing a Drupal6 module that does read/write/updates to my own tables in the database using the forms API. There are a few instances where I would like to present a confirmation dialogue before updating the database, but I'm not sure what is the standard way to implement that? For example if I have a menu item that calls a function mymodule_foo() like this: function mymodule_foo() { return drupal_get_form('mymodule_foo_form') ; } function mymodule_foo_form(&$context) { $form[] = array( '#type' => 'fieldset', '#title' => t('Review table Foo'), ); // .... whatever form data $form['#validate'][] = 'mymodule_validate_foo_form'; $form['#submit'][] = 'mymodule_submit_foo_form'; return $form; } function mymodule_validate_foo_form(&$form, &$form_state) { } function mymodule_submit_foo_form(&$form, &$form_state) { // update {mymodule_foo} table in database drupal_write_record('mymodule_foo',$record,$foo_id); } I guess I'm just wondering if there is some standard approach to generating an intermediate confirmation page before actually making the drupal_write_record() call(s)? thanks Doug
Doug ha scritto:
I guess I'm just wondering if there is some standard approach to generating an intermediate confirmation page before actually making the drupal_write_record() call(s)?
*|confirm_form($form, $question, $path, $description = NULL, $yes = NULL, $no = NULL, $name = 'confirm') http://api.drupal.org/api/function/confirm_form/6 I hope that this is what you need. M. |* -- Michel 'ZioBudda' Morelli michel@ziobuddalabs.it Sviluppo applicazioni CMS DRUPAL e web dinamiche (LAMP+Ajax) Telefono: 0200619074 Telefono Cell: +39-3939890025 -- Fax: +39-0291390660 http://www.ziobudda.net ICQ: 58351764 http://www.ziobuddalabs.it Skype: zio_budda http://www.ziodrupal.net MSN: michel@ziobuddalabs.it JABBER: michel@ziobuddalabs.it
participants (2)
-
Doug -
Michel Morelli