/[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.9, Wed Jul 23 02:21:21 2008 UTC revision 1.10, Sun Dec 28 04:11:30 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id$  // $Id: formupdater.module,v 1.9 2008/07/23 02:21:21 deekayen Exp $
3    
4  /**  /**
5   * @file   * @file
6   * Regex engine to help with module <4.6 upgrades.   * Regex engine to help with module <=4.6 upgrades.
7   */   */
8    
9  /**  /**
# Line 125  function formupdater_convert($type, $arg Line 125  function formupdater_convert($type, $arg
125    //split by parenthasis    //split by parenthasis
126    $parensplit = preg_split('/([\(\)])/', $args, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);    $parensplit = preg_split('/([\(\)])/', $args, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
127    $open = 0;    $open = 0;
128      $reargs = '';
129    foreach ((array)$parensplit as $parenchunk) {    foreach ((array)$parensplit as $parenchunk) {
130      switch ($parenchunk) {      switch ($parenchunk) {
131        case '(':        case '(':
# Line 155  function formupdater_convert($type, $arg Line 156  function formupdater_convert($type, $arg
156    $args = $trimedargs;    $args = $trimedargs;
157    
158    $a = formupdater_get_argnames($type);    $a = formupdater_get_argnames($type);
159    $note = $a['note'];    $note = isset($a['note']) ? $a['note'] : '';
160    unset($a['note']);    unset($a['note']);
161    //var_dump($a);    //var_dump($a);
162    
# Line 216  function formupdater_get_argnames($type) Line 217  function formupdater_get_argnames($type)
217        break;        break;
218      case 'get_error':      case 'get_error':
219        // NOT A FORM FUNCTION *****************************        // NOT A FORM FUNCTION *****************************
220        $a['na'] = true;        $a['na'] = TRUE;
221        break;        break;
222      case 'get_errors':      case 'get_errors':
223        // NOT A FORM FUNCTION *****************************        // NOT A FORM FUNCTION *****************************
224        $a['na'] = true;        $a['na'] = TRUE;
225        break;        break;
226      case 'group':      case 'group':
227        // form_group($legend, $group, $description = NULL, $attributes = NULL)        // form_group($legend, $group, $description = NULL, $attributes = NULL)
# Line 277  function formupdater_get_argnames($type) Line 278  function formupdater_get_argnames($type)
278        // NOTE: #extra is ignored        // NOTE: #extra is ignored
279        break;        break;
280      default:      default:
281        $a['na'] = true;        $a['na'] = TRUE;
282    }    }
283    if (!isset($a['#type'])) {    if (!isset($a['#type'])) {
284      $a['#type'] = $type;      $a['#type'] = $type;
285    }    }
286    $a['na'] = $a['na'] ? TRUE : FALSE;    $a['na'] = isset($a['na']) && $a['na'] ? TRUE : FALSE;
287    return $a;    return $a;
288  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.2