Development

Changeset 17714

You must first sign up to be able to contribute.

Changeset 17714

Show
Ignore:
Timestamp:
04/28/09 15:57:29 (5 years ago)
Author:
FabianLange
Message:

[1.0, 1.1, 1.2, 1.3] code-cleanup. Being DRY (r17713) helps to eliminate waste

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/lib/config/sfViewConfigHandler.class.php

    r17712 r17714  
    243243  { 
    244244    $data = array(); 
    245     $omit = array(); 
    246     $delete = array(); 
    247     $delete_all = false; 
    248245 
    249246    // Merge the current view's stylesheets with the app's default stylesheets 
     
    287284    $data = array_merge($data, array_values($tmp)); 
    288285 
    289     $omit = array(); 
    290     $delete_all = false; 
    291  
    292286    // Populate $javascripts with the values from ONLY the current view 
    293287    $javascripts = $this->mergeConfigValue('javascripts', $viewName); 
  • branches/1.1/lib/config/sfViewConfigHandler.class.php

    r17713 r17714  
    239239  protected function addHtmlAsset($viewName = '') 
    240240  { 
    241     $data = array(); 
    242     $omit = array(); 
    243     $delete = array(); 
    244     $delete_all = false; 
    245  
    246241    // Merge the current view's stylesheets with the app's default stylesheets 
    247242    $stylesheets = $this->mergeConfigValue('stylesheets', $viewName); 
    248     $data = array_merge($data, $this->addAssets('Stylesheet', $stylesheets)); 
    249      
    250     $omit = array(); 
    251     $delete_all = false; 
     243    $css = $this->addAssets('Stylesheet', $stylesheets); 
    252244 
    253245    // Merge the current view's javascripts with the app's default javascripts 
    254246    $javascripts = $this->mergeConfigValue('javascripts', $viewName); 
    255     $data = array_merge($data, $this->addAssets('Javascript', $javascripts)); 
    256  
    257     return implode("\n", $data)."\n"; 
     247    $js = $this->addAssets('Javascript', $javascripts); 
     248 
     249    return implode("\n", array_merge($css, $js))."\n"; 
    258250  } 
    259251 
  • branches/1.2/lib/config/sfViewConfigHandler.class.php

    r17713 r17714  
    239239  protected function addHtmlAsset($viewName = '') 
    240240  { 
    241     $data = array(); 
    242     $omit = array(); 
    243     $delete = array(); 
    244     $delete_all = false; 
    245  
    246241    // Merge the current view's stylesheets with the app's default stylesheets 
    247242    $stylesheets = $this->mergeConfigValue('stylesheets', $viewName); 
    248     $data = array_merge($data, $this->addAssets('Stylesheet', $stylesheets)); 
    249      
    250     $omit = array(); 
    251     $delete_all = false; 
     243    $css = $this->addAssets('Stylesheet', $stylesheets); 
    252244 
    253245    // Merge the current view's javascripts with the app's default javascripts 
    254246    $javascripts = $this->mergeConfigValue('javascripts', $viewName); 
    255     $data = array_merge($data, $this->addAssets('Javascript', $javascripts)); 
    256  
    257     return implode("\n", $data)."\n"; 
     247    $js = $this->addAssets('Javascript', $javascripts); 
     248 
     249    return implode("\n", array_merge($css, $js))."\n"; 
    258250  } 
    259251 
  • branches/1.3/lib/config/sfViewConfigHandler.class.php

    r17713 r17714  
    239239  protected function addHtmlAsset($viewName = '') 
    240240  { 
    241     $data = array(); 
    242     $omit = array(); 
    243     $delete = array(); 
    244     $delete_all = false; 
    245  
    246241    // Merge the current view's stylesheets with the app's default stylesheets 
    247242    $stylesheets = $this->mergeConfigValue('stylesheets', $viewName); 
    248     $data = array_merge($data, $this->addAssets('Stylesheet', $stylesheets)); 
    249      
    250     $omit = array(); 
    251     $delete_all = false; 
     243    $css = $this->addAssets('Stylesheet', $stylesheets); 
    252244 
    253245    // Merge the current view's javascripts with the app's default javascripts 
    254246    $javascripts = $this->mergeConfigValue('javascripts', $viewName); 
    255     $data = array_merge($data, $this->addAssets('Javascript', $javascripts)); 
    256  
    257     return implode("\n", $data)."\n"; 
     247    $js = $this->addAssets('Javascript', $javascripts); 
     248 
     249    return implode("\n", array_merge($css, $js))."\n"; 
    258250  } 
    259251