| 1 |
<?php |
<?php |
| 2 |
// $Id: formupdater.module,v 1.3 2005/11/13 23:54:43 jjeff Exp $ |
// $Id: formupdater.module,v 1.4 2005/11/23 01:15:45 webchick Exp $ |
| 3 |
|
|
| 4 |
function formupdater_help($section){ |
function formupdater_help($section){ |
| 5 |
switch($section){ |
switch($section){ |
| 25 |
$form['input'] = array('#type' => 'textarea', '#title'=> t('Drupal PHP code containing old form function calls'), '#rows' => 20); |
$form['input'] = array('#type' => 'textarea', '#title'=> t('Drupal PHP code containing old form function calls'), '#rows' => 20); |
| 26 |
$form['submit'] = array('#type' => 'submit', '#value' => 'submit'); |
$form['submit'] = array('#type' => 'submit', '#value' => 'submit'); |
| 27 |
$output = drupal_get_form('formupdater_input', $form); |
$output = drupal_get_form('formupdater_input', $form); |
| 28 |
$output .= str_replace(array('$RCSf'.'ile:', ',v', ',', '$Re'.'vision: ', '$Da'.'te: ', '$'), '', '<p style="font-size:x-small">$RCSfile: formupdater.module,v $ version: <b>$Revision: 1.3 $</b>, $Date: 2005/11/13 23:54:43 $</p>'); |
$output .= str_replace(array('$RCSf'.'ile:', ',v', ',', '$Re'.'vision: ', '$Da'.'te: ', '$'), '', '<p style="font-size:x-small">$RCSfile: formupdater.module,v $ version: <b>$Revision: 1.4 $</b>, $Date: 2005/11/23 01:15:45 $</p>'); |
| 29 |
return $output; |
return $output; |
| 30 |
} |
} |
| 31 |
|
|
| 32 |
function formupdater_process($edit){ |
function formupdater_process($edit){ |
| 33 |
//var_dump($form_values); |
//var_dump($form_values); |
| 34 |
$code = $edit['input']; |
$code = $edit['input']; |
| 35 |
$regex = '/form_?(.*?)\(([\w\W]*?)\);/i'; |
$regex = '/form_(.*?)\(([\w\W]*?)\);/i'; |
| 36 |
preg_match_all($regex, $code, $matches, PREG_SET_ORDER); |
preg_match_all($regex, $code, $matches, PREG_SET_ORDER); |
| 37 |
$i = 1; |
$i = 1; |
| 38 |
if (is_array($matches)){ |
if (is_array($matches)){ |