SpecialLanguageStats Class Reference
[Special pages of Translate extensionStatistics]

Implements includable special page Special:LanguageStats which provides translation statistics for all defined message groups. More...

Inheritance diagram for SpecialLanguageStats:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 __construct ()
 execute ($par)
 addWorkflowStatesColumn ()
 If workflow states are configured, adds a workflow states column.
 getTable ()
 Returns the table itself.

Protected Member Functions

 isValidValue ($value)
 Return the list of allowed values for target here.
 invalidTarget ()
 Called when the target is unknown.
 getForm ()
 HTML for the top form.
 outputIntroduction ()
 Output something helpful to guide the confused user.
 getWorkflowStateValue ($target)
 getWorkflowStateCell ($target, $state)
 If workflow states are configured, adds a cell with the workflow state to the row,.
 makeGroupGroup ($item, array $cache, MessageGroup $parent=null)
 Creates a html table row for given (top-level) message group.
 makeGroupRow (MessageGroup $group, array $cache, MessageGroup $parent=null)
 Actually creates the table for single message group, unless it is blacklisted or hidden by filters.
 getWorkflowStates ($field= 'tgr_group', $filter= 'tgr_lang')

Protected Attributes

 $table
 $targetValueName = array( 'code', 'language' )
 $totals
 Most of the displayed numbers added together at the bottom of the table.
 $timelimit = 8
 $nothing = false
 $incomplete = false
 $noComplete = true
 $noEmpty = false
 $target
 The target of stats, language code or group id.
 $purge
 $statsCounted = array()
 $states

Detailed Description

Implements includable special page Special:LanguageStats which provides translation statistics for all defined message groups.

Loosely based on the statistics code in phase3/maintenance/language

Use {{Special:LanguageStats/nl/1}} to show for 'nl' and suppres completely translated groups.

Definition at line 23 of file SpecialLanguageStats.php.


Constructor & Destructor Documentation

SpecialLanguageStats::__construct (  ) 

Reimplemented in SpecialMessageGroupStats.

Definition at line 95 of file SpecialLanguageStats.php.

Here is the call graph for this function:


Member Function Documentation

SpecialLanguageStats::addWorkflowStatesColumn (  ) 

If workflow states are configured, adds a workflow states column.

Definition at line 292 of file SpecialLanguageStats.php.

Referenced by SpecialMessageGroupStats::getTable(), and getTable().

Here is the call graph for this function:

SpecialLanguageStats::execute ( par  ) 

Definition at line 102 of file SpecialLanguageStats.php.

Here is the call graph for this function:

SpecialLanguageStats::getForm (  )  [protected]

HTML for the top form.

Returns:
  String   HTML
Todo:
duplicated code

Definition at line 193 of file SpecialLanguageStats.php.

Referenced by execute().

SpecialLanguageStats::getTable (  ) 

Returns the table itself.

Returns:
  String   HTML

Todo:
Allow extra message here, once total translated volume goes over a certain percentage? (former live hack at translatewiki) if ( $this->totals['2'] && ( $this->totals['1'] / $this->totals['2'] ) > 0.95 ) { $out .= $this->msg( 'translate-somekey' ); }

Reimplemented in SpecialMessageGroupStats.

Definition at line 363 of file SpecialLanguageStats.php.

Referenced by execute().

Here is the call graph for this function:

SpecialLanguageStats::getWorkflowStateCell ( target,
state 
) [protected]

If workflow states are configured, adds a cell with the workflow state to the row,.

Parameters:
String $target Whose workflow state do we want, such as language code or group id.
String $state The workflow state id
Returns:
string Html

Definition at line 315 of file SpecialLanguageStats.php.

Referenced by makeGroupRow(), and SpecialMessageGroupStats::makeRow().

Here is the call graph for this function:

SpecialLanguageStats::getWorkflowStates ( field = 'tgr_group',
filter = 'tgr_lang' 
) [protected]

Reimplemented in SpecialMessageGroupStats.

Definition at line 514 of file SpecialLanguageStats.php.

Referenced by addWorkflowStatesColumn().

SpecialLanguageStats::getWorkflowStateValue ( target  )  [protected]

Definition at line 305 of file SpecialLanguageStats.php.

Referenced by makeGroupRow(), and SpecialMessageGroupStats::makeRow().

SpecialLanguageStats::invalidTarget (  )  [protected]

Called when the target is unknown.

Reimplemented in SpecialMessageGroupStats.

Definition at line 181 of file SpecialLanguageStats.php.

Referenced by execute().

SpecialLanguageStats::isValidValue ( value  )  [protected]

Return the list of allowed values for target here.

Parameters:
$value 
Returns:
array

Reimplemented in SpecialMessageGroupStats.

Definition at line 174 of file SpecialLanguageStats.php.

Referenced by execute().

SpecialLanguageStats::makeGroupGroup ( item,
array $  cache,
MessageGroup parent = null 
) [protected]

Creates a html table row for given (top-level) message group.

If $item is an array, meaning that the first group is an AggregateMessageGroup and the latter are its children, it will recurse and create rows for them too.

Parameters:
$item Array|MessageGroup
$cache Array Cache as returned by MessageGroupStats::forLanguage
$parent MessageGroup (do not use, used internally only)
Returns:
string

Definition at line 419 of file SpecialLanguageStats.php.

Referenced by getTable().

Here is the call graph for this function:

SpecialLanguageStats::makeGroupRow ( MessageGroup group,
array $  cache,
MessageGroup parent = null 
) [protected]

Actually creates the table for single message group, unless it is blacklisted or hidden by filters.

Parameters:
MessageGroup $group
array $cache
MessageGroup $parent
Returns:
string

Definition at line 445 of file SpecialLanguageStats.php.

Referenced by makeGroupGroup().

Here is the call graph for this function:

SpecialLanguageStats::outputIntroduction (  )  [protected]

Output something helpful to guide the confused user.

Reimplemented in SpecialMessageGroupStats.

Definition at line 266 of file SpecialLanguageStats.php.

Referenced by execute().

Here is the call graph for this function:


Member Data Documentation

SpecialLanguageStats::$incomplete = false [protected]

Definition at line 56 of file SpecialLanguageStats.php.

SpecialLanguageStats::$noComplete = true [protected]

Reimplemented in SpecialMessageGroupStats.

Definition at line 62 of file SpecialLanguageStats.php.

SpecialLanguageStats::$noEmpty = false [protected]

Reimplemented in SpecialMessageGroupStats.

Definition at line 68 of file SpecialLanguageStats.php.

SpecialLanguageStats::$nothing = false [protected]

Definition at line 50 of file SpecialLanguageStats.php.

SpecialLanguageStats::$purge [protected]

Definition at line 79 of file SpecialLanguageStats.php.

SpecialLanguageStats::$states [protected]

Definition at line 93 of file SpecialLanguageStats.php.

Referenced by getWorkflowStates().

SpecialLanguageStats::$statsCounted = array() [protected]

Definition at line 88 of file SpecialLanguageStats.php.

SpecialLanguageStats::$table [protected]

Definition at line 27 of file SpecialLanguageStats.php.

Referenced by SpecialMessageGroupStats::getTable(), and getTable().

SpecialLanguageStats::$target [protected]

The target of stats, language code or group id.

Definition at line 73 of file SpecialLanguageStats.php.

Referenced by getWorkflowStateCell(), and getWorkflowStateValue().

SpecialLanguageStats::$targetValueName = array( 'code', 'language' ) [protected]

Reimplemented in SpecialMessageGroupStats.

Definition at line 32 of file SpecialLanguageStats.php.

SpecialLanguageStats::$timelimit = 8 [protected]

Definition at line 44 of file SpecialLanguageStats.php.

SpecialLanguageStats::$totals [protected]

Most of the displayed numbers added together at the bottom of the table.

Definition at line 37 of file SpecialLanguageStats.php.


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