Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: patTemplate

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5
Source code for file /pattemplate/patTemplate/OutputFilter/Tidy.php

Documentation is available at Tidy.php

  1. <?PHP
  2. /**
  3.  * patTemplate Tidy output filter
  4.  *
  5.  * $Id: Tidy.php 357 2005-02-04 15:07:43Z schst $
  6.  *
  7.  * Used to tidy up your resulting HTML document,
  8.  * requires ext/tidy.
  9.  *
  10.  * @package        patTemplate
  11.  * @subpackage    Filters
  12.  * @author        Stephan Schmidt <[email protected]>
  13.  */
  14.  
  15. // Check to ensure this file is within the rest of the framework
  16. defined('JPATH_BASE'or die();
  17.  
  18. /**
  19.  * requires tidy extension
  20.  */
  21. define'PATTEMPLATE_OUTPUTFILTER_TIDY_ERROR_NOT_SUPPORTED''patTemplate::Outputfilter::Tidy::1' );
  22.  
  23. /**
  24.  * patTemplate Tidy output filter
  25.  *
  26.  * $Id: Tidy.php 357 2005-02-04 15:07:43Z schst $
  27.  *
  28.  * Used to tidy up your resulting HTML document,
  29.  * requires ext/tidy.
  30.  *
  31.  * @package        patTemplate
  32.  * @subpackage    Filters
  33.  * @author        Stephan Schmidt <[email protected]>
  34.  */
  35. {
  36.    /**
  37.     * filter name
  38.     *
  39.     * This has to be set in the final
  40.     * filter classes.
  41.     *
  42.     * @var    string 
  43.     */
  44.     var    $_name = 'Tidy';
  45.  
  46.    /**
  47.     * tidy the data
  48.     *
  49.     * @access    public
  50.     * @param    string        data
  51.     * @return    string        compressed data
  52.     */
  53.     function apply$data )
  54.     {
  55.         if (!function_exists('tidy_parse_string')) {
  56.             return $data;
  57.         }
  58.  
  59.         /**
  60.          * tidy 1.0
  61.          */
  62.         if (function_exists'tidy_setopt' && is_array$this->_params)) {
  63.             foreach ($this->_params as $opt => $value{
  64.                 tidy_setopt$opt$value );
  65.             }
  66.             tidy_parse_string($data);
  67.             tidy_clean_repair();
  68.             $data tidy_get_output();
  69.         else {
  70.             $tidy tidy_parse_string($data$this->_params);
  71.             tidy_clean_repair($tidy);
  72.             $data tidy_get_output($tidy);
  73.         }
  74.  
  75.         return $data;
  76.     }
  77. }
  78. ?>

Documentation generated on Mon, 05 Mar 2007 21:29:21 +0000 by phpDocumentor 1.3.1