MediaWiki
REL1_24
|
Represents the content of a JSON content. More...
Public Member Functions | |
__construct ($text, $modelId=CONTENT_MODEL_JSON) | |
beautifyJSON () | |
Pretty-print JSON. | |
getJsonData () | |
Decodes the JSON into a PHP associative array. | |
isValid () | |
preSaveTransform (Title $title, User $user, ParserOptions $popts) | |
Beautifies JSON prior to save. | |
Protected Member Functions | |
fillParserOutput (Title $title, $revId, ParserOptions $options, $generateHtml, ParserOutput &$output) | |
Set the HTML and add the appropriate styles. | |
objectRow ($key, $val) | |
Constructs HTML representation of a single key-value pair. | |
objectTable ($mapping) | |
Constructs an HTML representation of a JSON object. |
JsonContent::__construct | ( | $ | text, |
$ | model_id = CONTENT_MODEL_JSON |
||
) |
string | $text | |
string | $model_id |
Reimplemented from TextContent.
Definition at line 17 of file JsonContent.php.
Pretty-print JSON.
Definition at line 41 of file JsonContent.php.
References FormatJson\decode(), FormatJson\encode(), and TextContent\getNativeData().
Referenced by preSaveTransform().
JsonContent::fillParserOutput | ( | Title $ | title, |
$ | revId, | ||
ParserOptions $ | options, | ||
$ | generateHtml, | ||
ParserOutput &$ | output | ||
) | [protected] |
Set the HTML and add the appropriate styles.
Title | $title | |
int | $revId | |
ParserOptions | $options | |
bool | $generateHtml | |
ParserOutput | $output |
Reimplemented from TextContent.
Definition at line 71 of file JsonContent.php.
References $generateHtml, ParserOutput\addModuleStyles(), getJsonData(), objectTable(), and ParserOutput\setText().
Decodes the JSON into a PHP associative array.
Definition at line 25 of file JsonContent.php.
References FormatJson\decode(), and TextContent\getNativeData().
Referenced by fillParserOutput(), and isValid().
Reimplemented from AbstractContent.
Definition at line 32 of file JsonContent.php.
References getJsonData().
JsonContent::objectRow | ( | $ | key, |
$ | val | ||
) | [protected] |
Constructs HTML representation of a single key-value pair.
string | $key | |
mixed | $val |
Definition at line 103 of file JsonContent.php.
References $key, array(), Xml\elementClean(), FormatJson\encode(), and Xml\tags().
Referenced by objectTable().
JsonContent::objectTable | ( | $ | mapping | ) | [protected] |
Constructs an HTML representation of a JSON object.
array | $mapping |
Definition at line 86 of file JsonContent.php.
References $key, array(), as, objectRow(), and Xml\tags().
Referenced by fillParserOutput().
JsonContent::preSaveTransform | ( | Title $ | title, |
User $ | user, | ||
ParserOptions $ | popts | ||
) |
Beautifies JSON prior to save.
Title | $title | Title |
User | $user | User |
ParserOptions | $popts |
Reimplemented from TextContent.
Definition at line 57 of file JsonContent.php.
References beautifyJSON().