Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function mvp_form_test_block_info() {
- $blocks = array(
- 'mvp_form_test_test_block' => array(
- 'info' => 'Test Form',
- 'cache' => DRUPAL_CACHE_GLOBAL,
- 'properties' => array(
- 'administrative' => true,
- ),
- ),
- );
- return $blocks;
- }
- function mvp_form_test_block_view($delta='') {
- if ($delta != 'mvp_form_test_test_block')
- return array();
- return array(
- 'title' => 'Test Block',
- 'content' => drupal_get_form('mvp_form_test_test_form'),
- );
- }
- function mvp_form_test_test_form($form, &$form_state) {
- $form = array();
- $form['sometext'] = array(
- '#type' => 'textfield',
- );
- $form['button'] = array(
- '#type' => 'submit',
- '#value' => 'Submit',
- );
- return $form;
- }
- function mvp_form_test_test_form_submit($form, $form_state) {
- watchdog('mvp_form_test', 'Form submitted with text '.$form_state['values']['sometext']);
- drupal_set_message('Form submitted with text '.$form_state['values']['sometext']);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment