StatsTable Class Reference
[Statistics]

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

List of all members.

Public Member Functions

 __construct ()
 element ($in, $bgcolor= '', $sort= '')
 Statistics table element (heading or regular cell).
 getBackgroundColor ($subset, $total, $fuzzy=false)
 getMainColumnHeader ()
 setMainColumnHeader (Message $msg)
 createColumnHeader (Message $msg)
 addExtraColumn (Message $column)
 getOtherColumnHeaders ()
 createHeader ()
 makeTotalRow (Message $message, $stats)
 Makes a row with aggregate numbers.
 makeNumberColumns ($stats)
 Makes partial row from completion numbers.
 formatPercentage ($num, $to= 'floor')
 Makes a nice print from plain float.
 getGroupLabel (MessageGroup $group)
 Gets the name of group with some extra formatting.
 makeGroupLink (MessageGroup $group, $code, $params)
 Gets the name of group linked to translation tool.
 getGroupDescription (MessageGroup $group)
 Gets the description of a group.
 isBlacklisted ($groupId, $code)
 Check whether translations in given group in given language has been disabled.

Static Public Member Functions

static formatTooltip ($text)
 Used to circumvent ugly tooltips when newlines are used in the message content ("x\ny" becomes "x y").

Protected Attributes

 $lang
 $translate
 $mainColumnHeader
 $extraColumns = array()

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 StatsTable.php.


Constructor & Destructor Documentation

StatsTable::__construct (  ) 

Definition at line 33 of file StatsTable.php.


Member Function Documentation

StatsTable::addExtraColumn ( Message $  column  ) 

Definition at line 105 of file StatsTable.php.

StatsTable::createColumnHeader ( Message $  msg  ) 

Definition at line 101 of file StatsTable.php.

Referenced by createHeader(), and setMainColumnHeader().

Here is the call graph for this function:

StatsTable::createHeader (  ) 

Definition at line 118 of file StatsTable.php.

Here is the call graph for this function:

StatsTable::element ( in,
bgcolor = '',
sort = '' 
)

Statistics table element (heading or regular cell).

Parameters:
$in   String   Element contents.
$bgcolor   String   Backround color in ABABAB format.
$sort   String   Value used for sorting.
Returns:
  String   Html td element.

Definition at line 46 of file StatsTable.php.

Referenced by createColumnHeader(), makeNumberColumns(), and makeTotalRow().

StatsTable::formatPercentage ( num,
to = 'floor' 
)

Makes a nice print from plain float.

Parameters:
$num float
$to string floor or ceil
Returns:
string Plain text

Definition at line 205 of file StatsTable.php.

Referenced by makeNumberColumns().

static StatsTable::formatTooltip ( text  )  [static]

Used to circumvent ugly tooltips when newlines are used in the message content ("x\ny" becomes "x y").

Parameters:
$text 
Returns:
string

Definition at line 333 of file StatsTable.php.

StatsTable::getBackgroundColor ( subset,
total,
fuzzy = false 
)

Definition at line 63 of file StatsTable.php.

Referenced by makeNumberColumns().

StatsTable::getGroupDescription ( MessageGroup group  ) 

Gets the description of a group.

This is a bit slow thing to do for thousand+ groups, so some caching is involved.

Parameters:
$group MessageGroup
Returns:
string Plain text

Definition at line 258 of file StatsTable.php.

Referenced by makeGroupLink().

Here is the call graph for this function:

StatsTable::getGroupLabel ( MessageGroup group  ) 

Gets the name of group with some extra formatting.

Parameters:
$group MessageGroup
Returns:
string Html

Definition at line 217 of file StatsTable.php.

Referenced by makeGroupLink().

Here is the call graph for this function:

StatsTable::getMainColumnHeader (  ) 

Definition at line 93 of file StatsTable.php.

Referenced by createHeader().

StatsTable::getOtherColumnHeaders (  ) 

Definition at line 109 of file StatsTable.php.

Referenced by createHeader().

StatsTable::isBlacklisted ( groupId,
code 
)

Check whether translations in given group in given language has been disabled.

Parameters:
$groupId string Message group id
$code string Language code
Returns:
bool

Definition at line 292 of file StatsTable.php.

Here is the call graph for this function:

StatsTable::makeGroupLink ( MessageGroup group,
code,
params 
)

Gets the name of group linked to translation tool.

Parameters:
$group MessageGroup
$code string Language code
$params array Any extra query parameters.
Returns:
string Html

Definition at line 235 of file StatsTable.php.

Here is the call graph for this function:

StatsTable::makeNumberColumns ( stats  ) 

Makes partial row from completion numbers.

Parameters:
array $stats
Returns:
string Html

Definition at line 159 of file StatsTable.php.

Referenced by makeTotalRow().

Here is the call graph for this function:

StatsTable::makeTotalRow ( Message $  message,
stats 
)

Makes a row with aggregate numbers.

Parameters:
Message $message
array $stats ( total, translate, fuzzy )
Returns:
string Html

Definition at line 145 of file StatsTable.php.

Here is the call graph for this function:

StatsTable::setMainColumnHeader ( Message $  msg  ) 

Definition at line 97 of file StatsTable.php.

Here is the call graph for this function:


Member Data Documentation

StatsTable::$extraColumns = array() [protected]

Definition at line 31 of file StatsTable.php.

StatsTable::$lang [protected]

Definition at line 25 of file StatsTable.php.

StatsTable::$mainColumnHeader [protected]

Definition at line 29 of file StatsTable.php.

StatsTable::$translate [protected]

Definition at line 27 of file StatsTable.php.


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