/[drupal]/contributions/modules/formupdater/formupdater.module
ViewVC logotype

Diff of /contributions/modules/formupdater/formupdater.module

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

revision 1.8, Wed Jul 23 02:13:26 2008 UTC revision 1.9, Wed Jul 23 02:21:21 2008 UTC
# Line 9  Line 9 
9  /**  /**
10   * Implementation of hook_help().   * Implementation of hook_help().
11   */   */
12  function formupdater_help($section) {  function formupdater_help($path, $arg) {
13    switch ($section) {    switch ($path) {
14      case 'formupdater':      case 'formupdater':
15        return t('<p>Form Updater will search through your old Drupal code to find calls to old form functions (such as form_textfield, form_radios, etc). It will then reformat these functions as arrays for use with the new <a href="http://api.drupal.org/api/file/developer/topics/forms_api_reference.html">Drupal Forms API</a>.</p>');        return t('<p>Form Updater will search through your old Drupal code to find calls to old form functions (such as form_textfield, form_radios, etc). It will then reformat these functions as arrays for use with the new <a href="http://api.drupal.org/api/file/developer/topics/forms_api_reference.html">Drupal Forms API</a>.</p>');
16    }    }
# Line 19  function formupdater_help($section) { Line 19  function formupdater_help($section) {
19  /**  /**
20   * Implementation of hook_menu().   * Implementation of hook_menu().
21   */   */
22  function formupdater_menu($may_cache) {  function formupdater_menu() {
23    $items = array();    $items = array();
24    if ($may_cache) {    $items['formupdater'] = array(
25      $items[] = array(      'title' => 'Form updater',
26        'path' => 'formupdater',      'access callback' => 'user_access',
27        'title' => t('Form updater'),      'access arguments' => array('access content'),
28        'access' => user_access('access content'),      'page callback' => 'drupal_get_form',
29        'callback' => 'drupal_get_form',      'page arguments' => array('formupdater_form')
30        'callback arguments' => array('formupdater_form')    );
     );  
   }  
31    return $items;    return $items;
32  }  }
33    
# Line 47  function formupdater_form() { Line 45  function formupdater_form() {
45    return $form;    return $form;
46  }  }
47    
48  function formupdater_form_submit($form_id, $form_values) {  function formupdater_form_submit($form, &$form_state) {
49    $code = $form_values['code'];    $code = $form_state['values']['code'];
50    $regex = '/\s(form_(.*?)|form())\(([\w\W]*?)\);/i';    $regex = '/\s(form_(.*?)|form())\(([\w\W]*?)\);/i';
51    preg_match_all($regex, $code, $matches, PREG_SET_ORDER);    preg_match_all($regex, $code, $matches, PREG_SET_ORDER);
52    $i = 1;    $i = 1;

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.2