* the column headers that need to be displayed
*/
public function &getColumnHeaders($action = NULL, $output = NULL) {
+
if (!isset(self::$_columnHeaders)) {
- self::$_columnHeaders = [
+ $enabledLanguages = CRM_Core_I18n::languages(TRUE);
+ $isMultiLingual = (count($enabledLanguages) > 1);
+
+ $headers = [
['desc' => ts('Contact Type')],
[
'name' => ts('Name'),
'sort' => 'mailing_name',
'direction' => CRM_Utils_Sort::DONTCARE,
],
- [
+ ];
+
+ // Check to see if languages column should be displayed.
+ if ($isMultiLingual) {
+ $headers[] = [
'name' => ts('Language'),
'sort' => 'language',
'direction' => CRM_Utils_Sort::DONTCARE,
- ],
+ ];
+ }
+ self::$_columnHeaders = array_merge($headers, [
[
'name' => ts('Mailing Subject'),
'sort' => 'mailing_subject',
'direction' => CRM_Utils_Sort::DONTCARE,
],
['desc' => ts('Actions')],
- ];
+ ]);
}
return self::$_columnHeaders;
}