Development

#2114: sfViewConfigHandler.class.php.diff

You must first sign up to be able to contribute.

Ticket #2114: sfViewConfigHandler.class.php.diff

File sfViewConfigHandler.class.php.diff, 1.0 kB (added by e.meitner, 11 months ago)

Unified diff that works, w/ cleaner formatting

  • sfViewConfigHandler.class.php.bak

    old new  
    294294    $tmp = array(); 
    295295    foreach ((array) $javascripts as $js) 
    296296    { 
    297       $js = $this->replaceConstants($js); 
     297      $position = ''; 
     298      if (is_array($js)) 
     299      { 
     300        $key = key($js); 
     301        $options = $js[$key]; 
     302        if (isset($options['position'])) 
     303        { 
     304          $position = $options['position']; 
     305        } 
     306      } 
     307      else 
     308      { 
     309        $key = $js; 
     310      } 
     311 
     312      $key = $this->replaceConstants($key); 
    298313 
    299       if ('-*' == $js
     314      if ('-*' == $key
    300315      { 
    301316        $tmp = array(); 
    302317      } 
    303       else if ('-' == $js[0]) 
     318      else if ('-' == $key[0]) 
    304319      { 
    305         unset($tmp[substr($js, 1)]); 
     320        unset($tmp[substr($key, 1)]); 
    306321      } 
    307322      else 
    308323      { 
    309         $tmp[$js] = sprintf("  \$response->addJavascript('%s');", $js); 
     324        $tmp[$key] = sprintf("  \$response->addJavascript('%s','%s');", $key, $position); 
    310325      } 
    311326    } 
    312327