*** Html.php.back	2010-07-25 16:57:24.000000000 +0200
--- Html.php	2010-07-25 21:20:53.000000000 +0200
***************
*** 8,13 ****
--- 8,14 ----
   * @copyright  Copyright (c) 2008-2009 ZF Debug Bar Team (http://code.google.com/p/zfdebug)
   * @license    http://code.google.com/p/zfdebug/wiki/License     New BSD License
   * @version    $Id$
+  * @Author     Philippe Ivaldi <http://www.piprime.fr/> adds tidy support
   */
  
  /**
***************
*** 17,25 ****
   * @copyright  Copyright (c) 2008-2009 ZF Debug Bar Team (http://code.google.com/p/zfdebug)
   * @license    http://code.google.com/p/zfdebug/wiki/License     New BSD License
   */
! class ZFDebug_Controller_Plugin_Debug_Plugin_Html 
!     extends ZFDebug_Controller_Plugin_Debug_Plugin 
!     implements ZFDebug_Controller_Plugin_Debug_Plugin_Interface
  {
      /**
       * Contains plugin identifier name
--- 18,26 ----
   * @copyright  Copyright (c) 2008-2009 ZF Debug Bar Team (http://code.google.com/p/zfdebug)
   * @license    http://code.google.com/p/zfdebug/wiki/License     New BSD License
   */
! class ZFDebug_Controller_Plugin_Debug_Plugin_Html
! extends ZFDebug_Controller_Plugin_Debug_Plugin
! implements ZFDebug_Controller_Plugin_Debug_Plugin_Interface
  {
      /**
       * Contains plugin identifier name
***************
*** 49,55 ****
      {
          return $this->_identifier;
      }
!     
      /**
       * Returns the base64 encoded icon
       *
--- 50,56 ----
      {
          return $this->_identifier;
      }
! 
      /**
       * Returns the base64 encoded icon
       *
***************
*** 82,95 ****
          $dom = new DOMDocument();
          $dom->loadHtml($body);
          libxml_use_internal_errors($liberrors);
-         $panel = '<h4>HTML Information</h4>';
-         $panel .= $this->_isXhtml();
          $linebreak = $this->getLinebreak();
!         $panel .= $dom->getElementsByTagName('*')->length.' Tags in ' . round(strlen($body)/1024, 2).'K'.$linebreak
!                 . $dom->getElementsByTagName('link')->length.' Link Tags'.$linebreak
!                 . $dom->getElementsByTagName('script')->length.' Script Tags'.$linebreak
!                 . $dom->getElementsByTagName('img')->length.' Images'.$linebreak
!                 . '<form method="post" action="http://validator.w3.org/check"><p><input type="hidden" name="fragment" value="'.htmlentities($body).'"'.$this->getClosingBracket().'<input type="submit" value="Validate With W3C"'.$this->getClosingBracket().'</p></form>';
          return $panel;
      }
  }
\ Pas de fin de ligne à la fin du fichier.
--- 83,110 ----
          $dom = new DOMDocument();
          $dom->loadHtml($body);
          libxml_use_internal_errors($liberrors);
          $linebreak = $this->getLinebreak();
!         $panel = '<h4>HTML Information</h4>';
!         $panel .= ($this->_isXhtml() ? 'x' : '') . 'html' . $linebreak;
!         $tidyInfo = '';
!         if (extension_loaded('tidy')) {
!             $tidy = tidy_parse_string($body, array(), 'utf8');
!             $tidy->diagnose();
!             $tidyError = array_reverse(explode("\n", htmlentities($tidy->errorBuffer)));
!             array_shift($tidyError);
!             $tidyInfo = implode($linebreak,$tidyError);
!         }
!         $panel .= ''
!             . $tidyInfo . $linebreak
!             . $dom->getElementsByTagName('*')->length.' Tags in ' . round(strlen($body)/1024, 2).'K'.$linebreak
!             . $dom->getElementsByTagName('link')->length.' Link Tags'.$linebreak
!             . $dom->getElementsByTagName('script')->length.' Script Tags'.$linebreak
!             . $dom->getElementsByTagName('img')->length.' Images'.$linebreak
!             . '<form method="post" action="http://validator.w3.org/check">'
!             . '<p><input type="hidden" name="fragment" value="'.htmlentities($body)
!             . '"'.$this->getClosingBracket()
!             . '<input type="submit" value="Validate With W3C"'
!             . $this->getClosingBracket().'</p></form>';
          return $panel;
      }
  }
\ Pas de fin de ligne à la fin du fichier.

