summaryrefslogtreecommitdiff
path: root/plugins/HistoryStats/src/column_group.cpp
blob: bb860e7114ed38115ea5bd773c10a59776c9c463 (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>";
	}
}