Development

Changeset 6492

You must first sign up to be able to contribute.

Changeset 6492

Show
Ignore:
Timestamp:
12/13/07 23:21:16 (1 year ago)
Author:
Leon.van.der.Ree
Message:

make use of quoteExcept in recursion and added sfExtjsVar so you can add javascript-variables in your config

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfExtjs2Plugin/trunk/lib/helper/sfExtjs2Helper.php

    r6436 r6492  
    2525 *                                         - created 
    2626 */ 
     27 
     28class sfExtjsVar { 
     29 
     30  private $var  = ''; 
     31   
     32  public function __construct($var) 
     33  { 
     34    $this->var = $var; 
     35  } 
     36   
     37  public function __toString() 
     38  { 
     39    return $this->var; 
     40  } 
     41   
     42} 
     43 
    2744class sfExtjs2Plugin { 
    2845 
     
    111128      #enables us to have empty keys removed 
    112129      if(is_null($value)) continue; 
    113  
     130       
    114131      #quotes everything not in the quote_except value list 
    115       if(!is_array($value)
    116       { 
    117         $attributes[$key] = (sfExtjs2Plugin::quote_except($key, $value) ? '\''.$value.'\'' : $value)
     132      if( !is_array($value) && sfExtjs2Plugin::quote_except($key, $value) && !($value instanceof sfExtjsVar)
     133      { 
     134        $attributes[$key] = '\''.$value.'\''
    118135      } 
    119136      else 
     
    449466      foreach ($array_value as $key => $v) 
    450467      { 
    451         if (!is_array($v) && ($v != 'true') && ($v != 'false')) 
     468        if (!is_array($v) && sfExtjs2Plugin::quote_except($key, $v) && !($v instanceof sfExtjsVar)) 
    452469        { 
    453470          $value .= sprintf('%s%s:\'%s\'', ($value === '{' ? '' : ','), $key, sfExtjs2Plugin::_process_value($v));