Includable special page for generating graphs on translations. More...
Public Member Functions | |
__construct () | |
getGraphTypes () | |
getGraphClass ($type) | |
execute ($par) | |
draw (FormOptions $opts) | |
Adds raw image data of the graph to the output. | |
Static Public Member Functions | |
static | roundToSignificant ($number, $significant=1) |
Enhanced version of round that supports rounding up to a given scale relative to the number itself. | |
static | getIncrement ($scale) |
Returns an increment in seconds for a given scale. | |
Protected Member Functions | |
form (FormOptions $opts) | |
Constructs the form which can be used to generate custom graphs. | |
eInput ($name, FormOptions $opts, $width=4) | |
Constructs a table row with label and input in two columns. | |
eLabel ($name) | |
Constructs a label for option. | |
eRadio ($name, FormOptions $opts, array $alts) | |
Constructs a table row with label and radio input in two columns. | |
eLanguage ($name, FormOptions $opts) | |
Constructs a table row with label and language selector in two columns. | |
languageSelector () | |
Constructs a JavaScript enhanced language selector. | |
eGroup ($name, FormOptions $opts) | |
Constructs a table row with label and group selector in two columns. | |
image (FormOptions $opts) | |
Returns an <img> tag for graph. | |
getData (FormOptions $opts) | |
Fetches and preprocesses graph data that can be fed to graph drawer. | |
Static Protected Member Functions | |
static | roundTimestampToCutoff ($scale, $cutoff, $direction= 'earlier') |
Gets the closest earlieast timestamp that corresponds to start of a period in given scale, like, midnight, monday or first day of the month. | |
static | roundingAddition ($ts, $amount, $dir) |
Static Protected Attributes | |
static | $graphs |
Includable special page for generating graphs on translations.
Definition at line 22 of file SpecialTranslationStats.php.
SpecialTranslationStats::__construct | ( | ) |
Definition at line 23 of file SpecialTranslationStats.php.
SpecialTranslationStats::draw | ( | FormOptions $ | opts | ) |
Adds raw image data of the graph to the output.
FormOptions | $opts |
Definition at line 563 of file SpecialTranslationStats.php.
Referenced by execute().
SpecialTranslationStats::eGroup | ( | $ | name, | |
FormOptions $ | opts | |||
) | [protected] |
Constructs a table row with label and group selector in two columns.
string | $name Option name. | |
FormOptions | $opts |
Definition at line 329 of file SpecialTranslationStats.php.
Referenced by form().
SpecialTranslationStats::eInput | ( | $ | name, | |
FormOptions $ | opts, | |||
$ | width = 4 | |||
) | [protected] |
Constructs a table row with label and input in two columns.
string | $name Option name. | |
FormOptions | $opts | |
int | $width |
Definition at line 224 of file SpecialTranslationStats.php.
Referenced by form().
SpecialTranslationStats::eLabel | ( | $ | name | ) | [protected] |
Constructs a label for option.
string | $name Option name. |
Definition at line 238 of file SpecialTranslationStats.php.
Referenced by eGroup(), eInput(), eLanguage(), and eRadio().
SpecialTranslationStats::eLanguage | ( | $ | name, | |
FormOptions $ | opts | |||
) | [protected] |
Constructs a table row with label and language selector in two columns.
string | $name Option name. | |
FormOptions | $opts |
Definition at line 283 of file SpecialTranslationStats.php.
Referenced by form().
SpecialTranslationStats::eRadio | ( | $ | name, | |
FormOptions $ | opts, | |||
array $ | alts | |||
) | [protected] |
Constructs a table row with label and radio input in two columns.
string | $name Option name. | |
FormOptions | $opts | |
string[] | $alts List of alternatives. |
Definition at line 256 of file SpecialTranslationStats.php.
Referenced by form().
SpecialTranslationStats::execute | ( | $ | par | ) |
Definition at line 53 of file SpecialTranslationStats.php.
SpecialTranslationStats::form | ( | FormOptions $ | opts | ) | [protected] |
Constructs the form which can be used to generate custom graphs.
FormOptions | $opts |
Definition at line 140 of file SpecialTranslationStats.php.
Referenced by execute().
SpecialTranslationStats::getData | ( | FormOptions $ | opts | ) | [protected] |
Fetches and preprocesses graph data that can be fed to graph drawer.
FormOptions | $opts |
Definition at line 398 of file SpecialTranslationStats.php.
Referenced by draw().
SpecialTranslationStats::getGraphClass | ( | $ | type | ) |
string | $type |
Definition at line 49 of file SpecialTranslationStats.php.
Referenced by getData().
SpecialTranslationStats::getGraphTypes | ( | ) |
Definition at line 40 of file SpecialTranslationStats.php.
static SpecialTranslationStats::getIncrement | ( | $ | scale | ) | [static] |
Returns an increment in seconds for a given scale.
The increment must be small enough that we will hit every item in the scale when using different multiples of the increment. It should be large enough to avoid hitting the same item multiple times.
string | $scale Either months, weeks, days or hours. |
Definition at line 671 of file SpecialTranslationStats.php.
Referenced by getData().
SpecialTranslationStats::image | ( | FormOptions $ | opts | ) | [protected] |
Returns an <img> tag for graph.
FormOptions | $opts |
Definition at line 379 of file SpecialTranslationStats.php.
SpecialTranslationStats::languageSelector | ( | ) | [protected] |
Constructs a JavaScript enhanced language selector.
Definition at line 300 of file SpecialTranslationStats.php.
Referenced by eLanguage().
static SpecialTranslationStats::roundingAddition | ( | $ | ts, | |
$ | amount, | |||
$ | dir | |||
) | [static, protected] |
int | $ts | |
int | $amount | |
int | $dir |
Definition at line 551 of file SpecialTranslationStats.php.
Referenced by roundTimestampToCutoff().
static SpecialTranslationStats::roundTimestampToCutoff | ( | $ | scale, | |
$ | cutoff, | |||
$ | direction = 'earlier' | |||
) | [static, protected] |
Gets the closest earlieast timestamp that corresponds to start of a period in given scale, like, midnight, monday or first day of the month.
string | $scale One of hours, days, weeks, months | |
int | $cutoff Timestamp in unix format. | |
string | $direction One of earlier, later |
Definition at line 516 of file SpecialTranslationStats.php.
Referenced by getData().
static SpecialTranslationStats::roundToSignificant | ( | $ | number, | |
$ | significant = 1 | |||
) | [static] |
Enhanced version of round that supports rounding up to a given scale relative to the number itself.
Examples:
int | $number Number to round. | |
int | $significant How many signficant numbers to keep. |
Definition at line 655 of file SpecialTranslationStats.php.
Referenced by draw().
SpecialTranslationStats::$graphs [static, protected] |
array( 'edits' => 'TranslatePerLanguageStats', 'users' => 'TranslatePerLanguageStats', 'registrations' => 'TranslateRegistrationStats', 'reviews' => 'ReviewPerLanguageStats', 'reviewers' => 'ReviewPerLanguageStats', )
Definition at line 28 of file SpecialTranslationStats.php.