[ Index ]
 

Code source de Plume CMS 1.2.2

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/manager/extinc/ -> class.html2text.php (sommaire)

(pas de description)

Poids: 334 lignes (11 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

html2text:: (7 méthodes):
  html2text()
  set_html()
  get_text()
  print_text()
  p()
  _convert()
  _build_link_list()


Classe: html2text  - X-Ref

Takes HTML and converts it to formatted, plain text.

Thanks to Alexander Krug (http://www.krugar.de/) to pointing out and
correcting an error in the regexp search array. Fixed 7/30/03.

Updated set_html() function's file reading mechanism, 9/25/03.

Thanks to Joss Sanglier (http://www.dancingbear.co.uk/) for adding
several more HTML entity codes to the $search and $replace arrays.
Updated 11/7/03.

html2text( $source = '', $from_file = false )   X-Ref
Constructor.

If the HTML source string (or file) is supplied, the class
will instantiate with that source propagated, all that has
to be done it to call get_text().

param: string $source HTML content
param: boolean $from_file Indicates $source is a file to pull content from
return: void

set_html( $source, $from_file = false )   X-Ref
Loads source HTML into memory, either from $source string or a file.

param: string $source HTML content
param: boolean $from_file Indicates $source is a file to pull content from
return: void

get_text()   X-Ref
Returns the text, converted from HTML.

return: string

print_text()   X-Ref
Prints the text, converted from HTML.

return: void

p()   X-Ref
Alias to print_text(), operates identically.

return: void

_convert()   X-Ref
Workhorse function that does actual conversion.

First performs custom tag replacement specified by $search and
$replace arrays. Then strips any remaining HTML tags, reduces whitespace
and newlines to a readable format, and word wraps the text to
$width characters.

return: void

_build_link_list($link_count, $link, $display)   X-Ref
Helper function called by preg_replace() on link replacement.

Maintains an internal list of links to be displayed at the end of the
text, with numeric indices to the original point in the text they
appeared.

param: integer $link_count Counter tracking current link number
param: string $link URL of the link
param: string $display Part of the text to associate number with
return: string



Généré le : Mon Nov 26 11:57:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics