Development

Changeset 8723

You must first sign up to be able to contribute.

Changeset 8723

Show
Ignore:
Timestamp:
05/02/08 19:09:05 (7 months ago)
Author:
dwhittle
Message:

dwhittle: merged changes to branch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dwhittle/1.0/lib/helper/JavascriptHelper.php

    r6598 r8723  
    931931      $js_options['afterUpdateElement'] = $options['after_update_element']; 
    932932    } 
     933    if (isset($options['param_name']))  
     934    { 
     935      $js_options['paramName'] = "'".$options['param_name']."'"; 
     936    } 
    933937 
    934938    $javascript .= ', '._options_for_javascript($js_options).');'; 
  • branches/dwhittle/1.0/lib/util/sfFillInForm.class.php

    r8713 r8723  
    4444  { 
    4545    $dom = new DomDocument('1.0', sfConfig::get('sf_charset', 'UTF-8')); 
     46 
     47    $noHead = strpos($html,'<head>') === false; 
     48    if ($noHead){ 
     49      //loadHTML needs the conent-type meta for the charset 
     50      $html = '<meta http-equiv="Content-Type" content="text/html; charset='.sfConfig::get('sf_charset').'"/>'.$html; 
     51    } 
     52 
    4653    @$dom->loadHTML($html); 
    47  
    4854    $dom = $this->fillInDom($dom, $formName, $formId, $values); 
    4955 
     56    if($noHead){ 
     57      //remove the head element that was created by adding the meta tag. 
     58      $headElement = $dom->getElementsByTagName('head')->item(0); 
     59      if ($headElement) 
     60      { 
     61        $dom->getElementsByTagName('html')->item(0)->removeChild($headElement); 
     62      } 
     63    } 
    5064    return $dom->saveHTML(); 
    5165  } 
  • branches/dwhittle/1.0/lib/validator/sfUrlValidator.class.php

    r6598 r8723  
    2929  public function execute(&$value, &$error) 
    3030  { 
    31     $re = '/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)/i'; 
    32  
     31    $re = '~^ 
     32      (https?|ftp)://                         # http or https or ftp 
     33      ( 
     34        ([a-z0-9-]+\.)+[a-z]{2,6}             # a domain name 
     35          |                                   #  or 
     36        \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}    # a IP address 
     37      ) 
     38      (:[0-9]+)?                              # a port (optional) 
     39      (/?|/\S+)                               # a /, nothing or a / with something 
     40    $~ix'; 
    3341    if (!preg_match($re, $value)) 
    3442    { 
  • branches/dwhittle/1.0/test/unit/validator/sfUrlValidatorTest.php

    r6598 r8723  
    1212require_once($_test_dir.'/unit/sfContextMock.class.php'); 
    1313 
    14 $t = new lime_test(12, new lime_output_color()); 
     14$t = new lime_test(22, new lime_output_color()); 
    1515 
    1616$context = new sfContext(); 
     
    2626  'http://www.symfony-project.com/', 
    2727  'ftp://www.symfony-project.com/file.tgz', 
     28  'http://www.google.com:8080',  
     29  'http://192.168.1.1',  
    2830); 
    2931 
     
    3133  'google.com', 
    3234  'http:/google.com', 
     35  'http://www.symfony-project,com/',  
     36  'http://www.symfony-project@com',  
     37  'http://www.symfony-project@com foobar',  
    3338); 
    3439 
  • branches/dwhittle/1.1/lib/helper/JavascriptHelper.php

    r8501 r8723  
    952952{ 
    953953  $javascript = "new Ajax.Autocompleter("; 
     954    if (isset($options['param_name']))  
     955    { 
     956      $js_options['paramName'] = "'".$options['param_name']."'"; 
     957    } 
    954958 
    955959  $javascript .= "'".get_id_from_name($field_id)."', "; 
  • branches/dwhittle/1.1/lib/helper/ObjectAdminHelper.php

    r8331 r8723  
    108108    $label_all, 
    109109    $select1, 
    110     submit_image_tag(sfConfig::get('sf_admin_web_dir').'/images/next.png', "style=\"border: 0\" onclick=\"double_list_move('{$name1}), '{$name2}'); return false;\""), 
     110    submit_image_tag(sfConfig::get('sf_admin_web_dir').'/images/next.png', "style=\"border: 0\" onclick=\"double_list_move('{$name1}', '{$name2}'); return false;\""), 
    111111    submit_image_tag(sfConfig::get('sf_admin_web_dir').'/images/previous.png', "style=\"border: 0\" onclick=\"double_list_move('{$name2}', '{$name1}'); return false;\""), 
    112112    $label_assoc, 
  • branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/lib/util/sfFillInForm.class.php

    r8713 r8723  
    4444  { 
    4545    $dom = new DomDocument('1.0', sfConfig::get('sf_charset', 'UTF-8')); 
     46 
     47    $noHead = strpos($html,'<head>') === false; 
     48    if ($noHead){ 
     49      //loadHTML needs the conent-type meta for the charset 
     50      $html = '<meta http-equiv="Content-Type" content="text/html; charset='.sfConfig::get('sf_charset').'"/>'.$html; 
     51    } 
     52 
    4653    @$dom->loadHTML($html); 
    47  
    4854    $dom = $this->fillInDom($dom, $formName, $formId, $values); 
    4955 
     56    if($noHead){ 
     57      //remove the head element that was created by adding the meta tag. 
     58      $headElement = $dom->getElementsByTagName('head')->item(0); 
     59      if ($headElement) 
     60      { 
     61        $dom->getElementsByTagName('html')->item(0)->removeChild($headElement); 
     62      } 
     63    } 
    5064    return $dom->saveHTML(); 
    5165  }