Development

Changeset 11121

You must first sign up to be able to contribute.

Changeset 11121

Show
Ignore:
Timestamp:
08/25/08 19:08:29 (10 months ago)
Author:
fabien
Message:

[1.2] moved web debug toolbar from <head> to <body> for better readability of the source

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/lib/debug/sfWebDebug.class.php

    r11052 r11121  
    147147  public function injectToolbar($content) 
    148148  { 
    149     $content = str_ireplace('</head>', $this->getAssets().'</head>', $content); 
     149    $content = str_ireplace('</head>', '<style>'.str_replace("\n", ' ', $this->getStylesheet()).'</style></head>', $content); 
    150150 
    151151    $debug = $this->asHtml(); 
    152152    $count = 0; 
    153     $content = str_ireplace('</body>', $debug.'</body>', $content, $count); 
     153    $content = str_ireplace('</body>', '<script type="text/javascript">'.$this->getJavascript().'</script>'.$debug.'</body>', $content, $count); 
    154154    if (!$count) 
    155155    { 
     
    236236 
    237237  /** 
    238    * Gets the HTML to inject in the head tag. 
    239    * 
    240    * @param string The asset HTML code 
    241    */ 
    242   public function getAssets() 
    243   { 
    244     return sprintf(' 
    245       <script type="text/javascript">%s</script> 
    246       <style>%s</style>', 
    247       $this->getJavascript(), 
    248       str_replace("\n", ' ', $this->getStylesheet()) 
    249     ); 
    250   } 
    251  
    252   /** 
    253238   * Gets the javascript code to inject in the head tag. 
    254239   * 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.