category = 'General_Visitors';
}
protected function getGeoIPReportDocSuffix()
{
return Piwik::translate('UserCountry_GeoIPDocumentationSuffix',
array('',
'',
'',
'')
);
}
/**
* Checks if a datatable for a view is empty and if so, displays a message in the footer
* telling users to configure GeoIP.
*/
protected function checkIfNoDataForGeoIpReport(ViewDataTable $view)
{
$view->config->filters[] = function ($dataTable) use ($view) {
// if there's only one row whose label is 'Unknown', display a message saying there's no data
if ($dataTable->getRowsCount() == 1
&& $dataTable->getFirstRow()->getColumn('label') == Piwik::translate('General_Unknown')
) {
$footerMessage = Piwik::translate('UserCountry_NoDataForGeoIPReport1');
$userCountry = new UserCountry();
// if GeoIP is working, don't display this part of the message
if (!$userCountry->isGeoIPWorking()) {
$params = array('module' => 'UserCountry', 'action' => 'adminIndex');
$footerMessage .= ' ' . Piwik::translate('UserCountry_NoDataForGeoIPReport2',
array('',
'',
'',
''));
} else {
$footerMessage .= ' ' . Piwik::translate('UserCountry_ToGeolocateOldVisits',
array('', ''));
}
$view->config->show_footer_message = $footerMessage;
}
};
}
}