This class represents the results of parsed source page, that is, the extracted sections and a template. More...
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 |
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.
TPParse::__construct | ( | Title $ | title | ) |
Constructor.
Definition at line 35 of file TPParse.php.
TPParse::countSections | ( | ) |
Returns the number of sections in this page.
Definition at line 43 of file TPParse.php.
TPParse::getDeletedSections | ( | ) |
Returns list of deleted sections.
Definition at line 113 of file TPParse.php.
TPParse::getSectionsForSave | ( | $ | highest = 0 |
) |
Gets the sections and assigns section id for new sections.
int | $highest The largest used integer id (Since 2012-08-02) |
Definition at line 77 of file TPParse.php.
Referenced by getDeletedSections(), and getTemplatePretty().
TPParse::getSourcePageText | ( | ) |
Returns the source page stripped of most translation mark-up.
Definition at line 155 of file TPParse.php.
TPParse::getTemplate | ( | ) |
Returns the page template where translatable content is replaced with placeholders.
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.
Definition at line 62 of file TPParse.php.
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.
array | $matches |
Definition at line 226 of file TPParse.php.
TPParse::$dbSections = null [protected] |
Definition at line 32 of file TPParse.php.
TPParse::$sections = array() |
Array[String => TPSection] Parsed sections indexed with placeholder.
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.
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.