forked from extern/egroupware
Configurable character set for vCard exports
This commit is contained in:
parent
30a3296c8e
commit
6647c40135
@ -175,6 +175,22 @@ class addressbook_hooks
|
|||||||
'default'=> 'iso-8859-1',
|
'default'=> 'iso-8859-1',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$selectCharSet = array(
|
||||||
|
'utf-8' => 'UTF-8',
|
||||||
|
'iso-8859-1' => 'ISO-8859-1',
|
||||||
|
);
|
||||||
|
|
||||||
|
$settings['vcard_charset'] = array(
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => 'Charset for the vCard export',
|
||||||
|
'name' => 'vcard_charset',
|
||||||
|
'values' => $selectCharSet,
|
||||||
|
'help' => 'Which charset should be used for the vCard export.',
|
||||||
|
'xmlrpc' => True,
|
||||||
|
'admin' => false,
|
||||||
|
'default'=> 'utf-8',
|
||||||
|
);
|
||||||
|
|
||||||
if ($GLOBALS['egw_info']['server']['contact_repository'] != 'ldap')
|
if ($GLOBALS['egw_info']['server']['contact_repository'] != 'ldap')
|
||||||
{
|
{
|
||||||
$settings['private_addressbook'] = array(
|
$settings['private_addressbook'] = array(
|
||||||
|
@ -980,9 +980,17 @@ class addressbook_vcal extends addressbook_bo
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (isset($GLOBALS['egw_info']['user']['preferences']['addressbook']['vcard_charset']))
|
||||||
|
{
|
||||||
|
$charset = $GLOBALS['egw_info']['user']['preferences']['addressbook']['vcard_charset'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$charset = 'utf-8';
|
||||||
|
}
|
||||||
foreach ($ids as $id)
|
foreach ($ids as $id)
|
||||||
{
|
{
|
||||||
fwrite($fp,$this->getVCard($id));
|
fwrite($fp,$this->getVCard($id, $charset));
|
||||||
}
|
}
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user