summaryrefslogtreecommitdiff
path: root/plugins/HistoryStats/src/column_group.cpp
blob: 740e97d0e1292566ff670b01364267a9bf335199 (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
#include "stdafx.h"
#include "column_group.h"

/*
 * ColGroup
 */

void ColGroup::impl_outputRenderHeader(ext::ostream& tos, int row, int rowSpan) const
{
	if (row == 1)
	{
		writeRowspanTD(tos, getCustomTitle(TranslateT("Group"), TranslateT("Group")), row, 1, rowSpan);
	}
}

void ColGroup::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, DisplayType display)
{
	if (display == asContact)
	{
		ext::string groupName = contact.getGroup();

		// replace subgroup separator with something better (really better?)
		utils::replaceAllInPlace(groupName, L"\\", L" > ");

		tos << L"<td>" << utils::htmlEscape(groupName) << L"</td>" << ext::endl;
	}
	else
	{
		tos << L"<td>&nbsp;</td>";
	}
}