Class which encapsulates message importing. More...
Public Member Functions | |
__construct (Title $title=null, $group=null, $code= 'en') | |
getTitle () | |
Wrapper for consistency with SpecialPage. | |
setTitle (Title $title) | |
getUser () | |
setUser (User $user) | |
getGroup () | |
setGroup ($group) | |
Group is either MessageGroup object or group id. | |
getCode () | |
setCode ($code= 'en') | |
execute ($messages) | |
Static Public Member Functions | |
static | doAction ($action, $group, $key, $code, $message, $comment= '', $user=null, $editFlags=0) |
Perform an action on a given group/key/code. | |
static | doImport ($title, $message, $comment, $user=null, $editFlags=0) |
static | doFuzzy ($title, $message, $comment, $user, $editFlags=0) |
static | makeTranslationTitle ($group, $key, $code) |
Given a group, message key and language code, creates a title for the translation page. | |
static | makeSectionElement ($legend, $type, $content, $lang=null) |
Make section elements. | |
static | makeTextFuzzy ($message) |
Prepends translation with fuzzy tag and ensures there is only one of them. | |
static | escapeNameForPHP ($name) |
Escape name such that it validates as name and id parameter in html, and so that we can get it back with WebRequest::getVal(). | |
Protected Member Functions | |
getAction () | |
doHeader () | |
doFooter () | |
allowProcess () | |
getActions () | |
getDefaultAction ($fuzzy, $action) | |
checkProcessTime () | |
Protected Attributes | |
$title | |
$user | |
$group | |
$code | |
$time | |
$out | |
$processingTime = 43 | |
Maximum processing time in seconds. |
Class which encapsulates message importing.
It scans for changes (new, changed, deleted), displays them in pretty way with diffs and finally executes the actions the user choices.
Definition at line 17 of file MessageWebImporter.php.
MessageWebImporter::__construct | ( | Title $ | title = null , |
|
$ | group = null , |
|||
$ | code = 'en' | |||
) |
MessageWebImporter::allowProcess | ( | ) | [protected] |
Definition at line 136 of file MessageWebImporter.php.
Referenced by execute().
MessageWebImporter::checkProcessTime | ( | ) | [protected] |
Definition at line 388 of file MessageWebImporter.php.
Referenced by execute().
static MessageWebImporter::doAction | ( | $ | action, | |
$ | group, | |||
$ | key, | |||
$ | code, | |||
$ | message, | |||
$ | comment = '' , |
|||
$ | user = null , |
|||
$ | editFlags = 0 | |||
) | [static] |
Perform an action on a given group/key/code.
string | $action Options: 'import', 'conflict' or 'ignore' | |
MessageGroup | $group Group object | |
string | $key Message key | |
string | $code Language code | |
string | $message Contents for the $key/code combination | |
string | $comment Edit summary (default: empty) - see Article::doEdit | |
User | $user User that will make the edit (default: null - RequestContext user). See Article::doEdit. | |
int | $editFlags Integer bitfield: see Article::doEdit |
MWException |
Definition at line 357 of file MessageWebImporter.php.
Referenced by execute().
MessageWebImporter::doFooter | ( | ) | [protected] |
static MessageWebImporter::doFuzzy | ( | $ | title, | |
$ | message, | |||
$ | comment, | |||
$ | user, | |||
$ | editFlags = 0 | |||
) | [static] |
Title | $title | |
$message | ||
$comment | ||
$user | ||
int | $editFlags |
Definition at line 427 of file MessageWebImporter.php.
Referenced by doAction().
MessageWebImporter::doHeader | ( | ) | [protected] |
Definition at line 112 of file MessageWebImporter.php.
Referenced by execute().
static MessageWebImporter::doImport | ( | $ | title, | |
$ | message, | |||
$ | comment, | |||
$ | user = null , |
|||
$ | editFlags = 0 | |||
) | [static] |
MWException |
Title | $title | |
$message | ||
$comment | ||
User | $user | |
$editFlags |
Definition at line 402 of file MessageWebImporter.php.
Referenced by doAction(), and doFuzzy().
static MessageWebImporter::escapeNameForPHP | ( | $ | name | ) | [static] |
Escape name such that it validates as name and id parameter in html, and so that we can get it back with WebRequest::getVal().
Especially dot and spaces are difficult for the latter.
string | $name |
Definition at line 557 of file MessageWebImporter.php.
Referenced by execute().
MessageWebImporter::execute | ( | $ | messages | ) |
MessageWebImporter::getAction | ( | ) | [protected] |
Definition at line 105 of file MessageWebImporter.php.
Referenced by doHeader().
MessageWebImporter::getActions | ( | ) | [protected] |
MessageWebImporter::getCode | ( | ) |
Definition at line 94 of file MessageWebImporter.php.
Referenced by execute().
MessageWebImporter::getDefaultAction | ( | $ | fuzzy, | |
$ | action | |||
) | [protected] |
bool | $fuzzy | |
string | $action |
Definition at line 166 of file MessageWebImporter.php.
Referenced by execute().
MessageWebImporter::getGroup | ( | ) |
Definition at line 78 of file MessageWebImporter.php.
Referenced by execute(), and setGroup().
MessageWebImporter::getTitle | ( | ) |
Wrapper for consistency with SpecialPage.
Definition at line 56 of file MessageWebImporter.php.
Referenced by doHeader(), and getAction().
MessageWebImporter::getUser | ( | ) |
Definition at line 67 of file MessageWebImporter.php.
Referenced by allowProcess(), doFuzzy(), and doHeader().
static MessageWebImporter::makeSectionElement | ( | $ | legend, | |
$ | type, | |||
$ | content, | |||
$ | lang = null | |||
) | [static] |
Make section elements.
string | $legend Legend as raw html. | |
string | $type Contents of type class. | |
string | $content Contents as raw html. | |
Language | $lang The language in which the text is written. |
Definition at line 521 of file MessageWebImporter.php.
Referenced by execute().
static MessageWebImporter::makeTextFuzzy | ( | $ | message | ) | [static] |
Prepends translation with fuzzy tag and ensures there is only one of them.
string | $message Message content |
Definition at line 544 of file MessageWebImporter.php.
Referenced by doAction(), and doFuzzy().
static MessageWebImporter::makeTranslationTitle | ( | $ | group, | |
$ | key, | |||
$ | code | |||
) | [static] |
Given a group, message key and language code, creates a title for the translation page.
MessageGroup | $group | |
string | $key Message key | |
string | $code Language code |
Definition at line 506 of file MessageWebImporter.php.
Referenced by doAction().
MessageWebImporter::setCode | ( | $ | code = 'en' |
) |
Definition at line 98 of file MessageWebImporter.php.
Referenced by __construct().
MessageWebImporter::setGroup | ( | $ | group | ) |
Group is either MessageGroup object or group id.
MessageGroup|string | $group |
Definition at line 86 of file MessageWebImporter.php.
Referenced by __construct().
MessageWebImporter::setTitle | ( | Title $ | title | ) |
Definition at line 60 of file MessageWebImporter.php.
Referenced by __construct().
MessageWebImporter::setUser | ( | User $ | user | ) |
Definition at line 71 of file MessageWebImporter.php.
MessageWebImporter::$code [protected] |
Definition at line 32 of file MessageWebImporter.php.
Referenced by __construct(), doAction(), execute(), and setCode().
MessageWebImporter::$group [protected] |
Definition at line 31 of file MessageWebImporter.php.
Referenced by __construct(), doAction(), execute(), makeTranslationTitle(), and setGroup().
MessageWebImporter::$out [protected] |
Definition at line 38 of file MessageWebImporter.php.
MessageWebImporter::$processingTime = 43 [protected] |
Maximum processing time in seconds.
Definition at line 43 of file MessageWebImporter.php.
MessageWebImporter::$time [protected] |
Definition at line 33 of file MessageWebImporter.php.
MessageWebImporter::$title [protected] |
Definition at line 21 of file MessageWebImporter.php.
Referenced by __construct(), doAction(), doFuzzy(), and doImport().
MessageWebImporter::$user [protected] |
Definition at line 26 of file MessageWebImporter.php.
Referenced by doAction(), doFuzzy(), and doImport().