TPParse Class Reference
[Page Translation]

This class represents the results of parsed source page, that is, the extracted sections and a template. More...

List of all members.

Public Member Functions

 __construct (Title $title)
 Constructor.
 countSections ()
 Returns the number of sections in this page.
 getTemplate ()
 Returns the page template where translatable content is replaced with placeholders.
 getTemplatePretty ()
 Returns the page template where the ugly placeholders are replaced with section markers.
 getSectionsForSave ($highest=0)
 Gets the sections and assigns section id for new sections.
 getDeletedSections ()
 Returns list of deleted sections.
 getSourcePageText ()
 Returns the source page stripped of most translation mark-up.

Public Attributes

 $sections = array()
   Array[String => TPSection]   Parsed sections indexed with placeholder.
 $template = null
   String   Page source with content replaced with placeholders.

Protected Member Functions

 loadFromDatabase ()
 Load section saved in the database.

Static Protected Member Functions

static replaceTagCb ($matches)
 Chops of trailing or preceeding whitespace intelligently to avoid build up of unintented whitespace.

Protected Attributes

 $title = null
   Title   Title of the page.
 $dbSections = null

Detailed Description

This class represents the results of parsed source page, that is, the extracted sections and a template.

Definition at line 17 of file TPParse.php.


Constructor & Destructor Documentation

TPParse::__construct ( Title $  title  ) 

Constructor.

Definition at line 35 of file TPParse.php.


Member Function Documentation

TPParse::countSections (  ) 

Returns the number of sections in this page.

Returns:
  Integer  

Definition at line 43 of file TPParse.php.

TPParse::getDeletedSections (  ) 

Returns list of deleted sections.

Returns:
array List of sections indexed by id. array( string => TPsection, ... )

Definition at line 113 of file TPParse.php.

Here is the call graph for this function:

TPParse::getSectionsForSave ( highest = 0  ) 

Gets the sections and assigns section id for new sections.

Parameters:
int $highest The largest used integer id (Since 2012-08-02)
Returns:
array array( string => TPSection, ... )

Definition at line 77 of file TPParse.php.

Referenced by getDeletedSections(), and getTemplatePretty().

Here is the call graph for this function:

TPParse::getSourcePageText (  ) 

Returns the source page stripped of most translation mark-up.

Returns:
  String   Wikitext.

Definition at line 155 of file TPParse.php.

TPParse::getTemplate (  ) 

Returns the page template where translatable content is replaced with placeholders.

Returns:
  String  

Definition at line 52 of file TPParse.php.

TPParse::getTemplatePretty (  ) 

Returns the page template where the ugly placeholders are replaced with section markers.

Sections which previously had no number will get one assigned now.

Returns:
  String  

Definition at line 62 of file TPParse.php.

Here is the call graph for this function:

TPParse::loadFromDatabase (  )  [protected]

Load section saved in the database.

Populates dbSections.

Definition at line 129 of file TPParse.php.

Referenced by getSectionsForSave().

static TPParse::replaceTagCb ( matches  )  [static, protected]

Chops of trailing or preceeding whitespace intelligently to avoid build up of unintented whitespace.

Parameters:
array $matches
Returns:
string

Definition at line 226 of file TPParse.php.


Member Data Documentation

TPParse::$dbSections = null [protected]

Definition at line 32 of file TPParse.php.

TPParse::$sections = array()

  Array[String => TPSection]   Parsed sections indexed with placeholder.

Todo:
Encapsulate

Definition at line 24 of file TPParse.php.

Referenced by getDeletedSections(), getSectionsForSave(), and getTemplatePretty().

TPParse::$template = null

  String   Page source with content replaced with placeholders.

Todo:
Encapsulate

Definition at line 28 of file TPParse.php.

TPParse::$title = null [protected]

  Title   Title of the page.

Definition at line 19 of file TPParse.php.


The documentation for this class was generated from the following file:
Generated on Tue Oct 29 00:00:55 2013 for MediaWiki Translate Extension by  doxygen 1.6.3