summaryrefslogtreecommitdiff
path: root/plugins/HistoryStats/src/column_rank.cpp
blob: ae44689be9b28d410540cbdf697f4ee6b8869bf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "_globals.h"
#include "column_rank.h"

/*
 * ColRank
 */

void ColRank::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
	if (row == 1)
	{
		writeRowspanTD(tos, getCustomTitle(i18n(muT("Rank")), i18n(muT("Rank"))), row, 1, rowSpan);
	}
}

void ColRank::impl_outputBegin()
{
	m_nNextRank = 1;
}

void ColRank::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display)
{
	if (display == asContact)
	{
		tos << muT("<td class=\"num\">")
			<< utils::htmlEscape(ext::str(ext::kformat(i18n(muT("#{rank}."))) % muT("#{rank}") * (m_nNextRank++)))
			<< muT("</td>") << ext::endl;
	}
	else
	{
		tos << muT("<td>&nbsp;</td>");
	}
}