Changeset 1446
- Timestamp:
- 06/14/06 21:51:36 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/slickrick/lib/config/sfViewConfigHandler.class.php
r1445 r1446 254 254 foreach ($stylesheets as $stylesheet) 255 255 { 256 $key = is_array($stylesheet) ? key($stylesheet) : $stylesheet;256 $key = is_array($stylesheet) ? key($stylesheet) : $stylesheet; 257 257 258 258 if ($key != '-*') 259 259 { 260 260 $omit[] = $key; 261 }261 } 262 262 } 263 263 } … … 270 270 foreach ($stylesheets as $stylesheet) 271 271 { 272 if (!is_array($stylesheet))273 {272 if (!is_array($stylesheet)) 273 { 274 274 if (substr($stylesheet, 0, 1) == '-') 275 275 { 276 276 $delete[] = substr($stylesheet, 1); 277 277 } 278 }278 } 279 279 } 280 280 } … … 295 295 if (!in_array($key, $omit)) 296 296 { 297 unset($stylesheets[$index]);297 unset($stylesheets[$index]); 298 298 } 299 299 } … … 304 304 foreach ($delete as $value) 305 305 { 306 if ($key == $value OR substr($key, 1) == $value)307 {306 if ($key == $value OR substr($key, 1) == $value) 307 { 308 308 unset($stylesheets[$index]); 309 }309 } 310 310 } 311 311 } … … 338 338 } 339 339 340 341 $omit = array(); 342 $delete_all = false; 343 344 // Populate $javascripts with the values from ONLY the current view 345 $javascripts = $this->getConfigValue('javascripts', $viewName); 346 347 // If we find results from the view, check to see if there is a '-*' 348 // This indicates that we will remove ALL javascripts EXCEPT for those passed in the current view 349 if (is_array($javascripts) AND in_array('-*', $javascripts)) 350 { 351 $delete_all = true; 352 foreach ($javascripts as $javascript) 353 { 354 if (substr($javascript, 0, 1) != '-') 355 { 356 $omit[] = $javascript; 357 } 358 } 359 } 360 340 361 $javascripts = $this->mergeConfigValue('javascripts', $viewName); 341 362 if (is_array($javascripts)) 342 363 { 343 364 // remove javascripts marked with a beginning '-' 365 // We exclude any javascripts that were omitted above 344 366 $delete = array(); 367 345 368 foreach ($javascripts as $javascript) 346 369 { 347 if ( substr($javascript, 0, 1) == '-')370 if (!in_array($javascript, $omit) && (substr($javascript, 0, 1) == '-' || $delete_all == true)) 348 371 { 349 372 $delete[] = $javascript;