/** * Format a table cell. The return value should be HTML, but use an empty * string not   for empty cells. Do not include the <td> and </td>. * * The current result row is available as $this->mCurrentRow, in case you * need more context. * * @param $name String: the database field name * @param $value String: the value retrieved from the database */ function formatValue($name, $value) { global $wgLang; switch ($name) { case 'wps_start_date': case 'wps_end_date': return $value === null ? '-' : $wgLang->date($value, true); case 'wpp_name': return wfMessage('wpp-' . $value)->text(); case 'wps_tmr_status': $msg = wfMessage("status-{$value}")->text(); if ($value == 'PE' && $this->mCurrentRow->wps_active == 0) { $msg .= ' (' . SpecialSubscriptions::getLinkCancel($this->mCurrentRow->wps_id) . ')'; } return $msg; case 'wpp_nb_wikiplaces': case 'wpp_nb_wikiplace_pages': return wfFormatNumber($value); case 'wpp_monthly_bandwidth': case 'wpp_diskspace': return wfFormatSizeMB($value); default: return htmlspecialchars($value); } }
/** * Format a table cell. The return value should be HTML, but use an empty * string not   for empty cells. Do not include the <td> and </td>. * * The current result row is available as $this->mCurrentRow, in case you * need more context. * * @param $name String: the database field name * @param $value String: the value retrieved from the database */ function formatValue($name, $value) { global $wgLang; switch ($name) { case 'wpp_name': return SpecialSubscriptions::getLinkNew($value, 'wpp-' . $value); case 'wpp_period_months': return wfMessage('wp-period', $value); case 'wpp_nb_wikiplaces': case 'wpp_nb_wikiplace_pages': return wfFormatNumber($value); case 'wpp_monthly_bandwidth': case 'wpp_diskspace': return wfFormatSizeMB($value); case 'wpp_price': $cur = ' ' . $this->mCurrentRow->wpp_currency; if ($cur == ' EUR') { $cur = ' ' . wfMessage('cur-euro')->text(); } $cur = Xml::element('span', array('class' => 'currency'), $cur); return $wgLang->formatNum($value) . $cur; case 'wpp_end_date': return $wgLang->date($value, true); case 'hard_quotas': return $this->formatHardQuotas(); case 'monthly_quotas': return $this->formatMonthlyQuotas(); default: return htmlspecialchars($value); } }
public function __construct() { parent::__construct('Invitation'); }