MessageWebImporter Class Reference

Class which encapsulates message importing. More...

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

MessageWebImporter::__construct ( Title $  title = null,
group = null,
code = 'en' 
)

Definition at line 45 of file MessageWebImporter.php.

Here is the call graph for this function:


Member Function Documentation

MessageWebImporter::allowProcess (  )  [protected]
Returns:
bool

Definition at line 136 of file MessageWebImporter.php.

Referenced by execute().

Here is the call graph for this function:

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.

Parameters:
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
Exceptions:
MWException 
Returns:
string Action result

Definition at line 357 of file MessageWebImporter.php.

Referenced by execute().

Here is the call graph for this function:

MessageWebImporter::doFooter (  )  [protected]
Returns:
string

Definition at line 129 of file MessageWebImporter.php.

Referenced by execute().

static MessageWebImporter::doFuzzy ( title,
message,
comment,
user,
editFlags = 0 
) [static]
Parameters:
Title $title
$message 
$comment 
$user 
int $editFlags
Returns:
array|String

Definition at line 427 of file MessageWebImporter.php.

Referenced by doAction().

Here is the call graph for this function:

MessageWebImporter::doHeader (  )  [protected]
Returns:
string

Definition at line 112 of file MessageWebImporter.php.

Referenced by execute().

Here is the call graph for this function:

static MessageWebImporter::doImport ( title,
message,
comment,
user = null,
editFlags = 0 
) [static]
Exceptions:
MWException 
Parameters:
Title $title
$message 
$comment 
User $user
$editFlags 
Returns:
array

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.

Parameters:
string $name
Returns:
string

Definition at line 557 of file MessageWebImporter.php.

Referenced by execute().

MessageWebImporter::execute ( messages  ) 

Definition at line 174 of file MessageWebImporter.php.

Here is the call graph for this function:

MessageWebImporter::getAction (  )  [protected]
Returns:
string

Definition at line 105 of file MessageWebImporter.php.

Referenced by doHeader().

Here is the call graph for this function:

MessageWebImporter::getActions (  )  [protected]
Returns:
array

Definition at line 153 of file MessageWebImporter.php.

Referenced by execute().

MessageWebImporter::getCode (  ) 

Definition at line 94 of file MessageWebImporter.php.

Referenced by execute().

MessageWebImporter::getDefaultAction ( fuzzy,
action 
) [protected]
Parameters:
bool $fuzzy
string $action
Returns:
string

Definition at line 166 of file MessageWebImporter.php.

Referenced by execute().

MessageWebImporter::getGroup (  ) 
Returns:
MessageGroup

Definition at line 78 of file MessageWebImporter.php.

Referenced by execute(), and setGroup().

MessageWebImporter::getTitle (  ) 

Wrapper for consistency with SpecialPage.

Returns:
Title

Definition at line 56 of file MessageWebImporter.php.

Referenced by doHeader(), and getAction().

MessageWebImporter::getUser (  ) 
Returns:
User

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.

Parameters:
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.
Returns:
string Section element as html.

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.

Parameters:
string $message Message content
Returns:
string Message prefixed with TRANSLATE_FUZZY tag

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.

Parameters:
MessageGroup $group
string $key Message key
string $code Language code
Returns:
Title

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.

Parameters:
MessageGroup|string $group

Definition at line 86 of file MessageWebImporter.php.

Referenced by __construct().

Here is the call graph for this function:

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.


Member Data Documentation

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().


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