Changeset 6436
- Timestamp:
- 12/11/07 01:47:43 (6 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfExtjs2Plugin/trunk/lib/helper/sfExtjs2Helper.php
r6151 r6436 119 119 else 120 120 { 121 // TODO: fix this $value = array, so encode it to { key, value} recursively! 121 122 $attributes[$key] = $value; 122 123 } … … 433 434 foreach ($merged_attributes as $key => $value) 434 435 { 435 $attributes .= sprintf('%s%s:%s', ($attributes === '' ? '' : ','), $key, $value);436 $attributes .= sprintf('%s%s:%s', ($attributes === '' ? '' : ','), $key, sfExtjs2Plugin::_process_value($value)); 436 437 } 437 438 438 439 return $attributes; 440 } 441 442 private static function _process_value($value = '') 443 { 444 if (is_array($value)) 445 { 446 $array_value = $value; 447 $value = '{'; 448 449 foreach ($array_value as $key => $v) 450 { 451 if (!is_array($v) && ($v != 'true') && ($v != 'false')) 452 { 453 $value .= sprintf('%s%s:\'%s\'', ($value === '{' ? '' : ','), $key, sfExtjs2Plugin::_process_value($v)); 454 } 455 else 456 { 457 $value .= sprintf('%s%s:%s', ($value === '{' ? '' : ','), $key, sfExtjs2Plugin::_process_value($v)); 458 } 459 } 460 461 $value .= '}'; 462 } 463 464 return $value; 439 465 } 440 466