Skip Navigation

UNL_TidyTemplate API Documentation

Developers, developers, developers, devel…

Class UNL_TidyTemplate

Description

Class which provides basic functionality for Tidy'ing a template.

Located in /TidyTemplate.php (line 28)


	
			
Variable Summary
array $files
array $fixed
array $unfixable
Method Summary
bool fileIsTemplate ( &$uri, string $uri)
array getEditableRegions ( &$html, string $html)
string getTemplateName ( &$html, string $html)
bool isTemplate ( &$html, string $html)
bool isValidTemplateExtension ( &$file, string $file)
void setTemplateRegions ( &$template, array $regions, UNL_Template $template)
void tidyFile (string $file)
string tidyFragment (string $string, [ $options = array('indent' => true, 'output-xhtml' => true, 'wrap' => false, 'wrap-attributes' => false)])
void tidyLocalFiles (array $afiles)
void tidyTemplateHTML ( &$html,  &$file, string $html, string $file)
void writeCleanTemplate ( &$file,  &$template, string $file, UNL_Template $template)
Variables
array $files = array() (line 36)

after checking the files, this will contain an associative array of files and their validation status valid=true|false

array $fixed = array() (line 43)

Array of pages fixed by TidyTemplate.

array $unfixable = array() (line 49)

Could not fix these files, but did what we could.

Methods
fileIsTemplate (line 84)

Checks if the file is using the templates.

  • return: true|false
bool fileIsTemplate ( &$uri, string $uri)
  • string $uri: URI or local filename of the page.
  • &$uri
getEditableRegions (line 220)

Scans a snippet of HTML and returns an array of UNL_DWT_Region

array getEditableRegions ( &$html, string $html)
  • string $html
  • &$html
getTemplateName (line 235)

returns the name of the template file used.

string getTemplateName ( &$html, string $html)
  • string $html
  • &$html
isTemplate (line 95)

Determines if the HTML page is using the UNL Templates.

  • return: true|false
bool isTemplate ( &$html, string $html)
  • string $html
  • &$html
isValidTemplateExtension (line 110)

Checks if a file has the correct extension.

bool isValidTemplateExtension ( &$file, string $file)
  • string $file
  • &$file
setTemplateRegions (line 197)

Takes an array of UNL_DWT_Region and populates a UNL_Template with the region values.

void setTemplateRegions ( &$template, array $regions, UNL_Template $template)
  • UNL_Template $template
  • array $regions
  • &$template
tidyFile (line 133)

Will tidy up a file. First checks if it is a Template file, then calls tidyTemplateHTML if it is a Tidy File.

void tidyFile (string $file)
  • string $file
tidyFragment (line 262)

Will run tidy on a snippet of html.

string tidyFragment (string $string, [ $options = array('indent' => true, 'output-xhtml' => true, 'wrap' => false, 'wrap-attributes' => false)])
  • string $string
  • $options
tidyLocalFiles (line 56)

This will tidy up all the template files given.

void tidyLocalFiles (array $afiles)
  • array $afiles: array of filenames.
tidyTemplateHTML (line 149)

Runs tidy on the template html.

void tidyTemplateHTML ( &$html,  &$file, string $html, string $file)
  • string $html
  • string $file: filename
  • &$html
  • &$file
writeCleanTemplate (line 183)

Writes out a template file to the given filename, after first creating a backup copy, named $file.bak

void writeCleanTemplate ( &$file,  &$template, string $file, UNL_Template $template)
  • string $file
  • UNL_Template $template
  • &$file
  • &$template

Documentation generated on Wed, 12 Aug 2009 12:59:49 -0500 by phpDocumentor 1.4.2