Changeset View
Changeset View
Standalone View
Standalone View
lib/Kolab/Utils/DAVBackend.php
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | public static function folder_update($folder, array $mutations) | ||||
switch ($prop) { | switch ($prop) { | ||||
case '{DAV:}displayname': | case '{DAV:}displayname': | ||||
// abort if name didn't change | // abort if name didn't change | ||||
if ($val == html_entity_decode($folder->get_name(), ENT_COMPAT, RCUBE_CHARSET)) { | if ($val == html_entity_decode($folder->get_name(), ENT_COMPAT, RCUBE_CHARSET)) { | ||||
break; | break; | ||||
} | } | ||||
// restrict renaming to personal folders only | // restrict renaming to personal folders only | ||||
if ($folder->get_namespace() == 'personal') { | if ($folder->get_namespace() == 'personal') { | ||||
$parts = preg_split('!(\s*/\s*|\s+[»:]\s+)!', $val); | $parts = preg_split('!(*UTF8)(\s*/\s*|\s+[»:]\s+)!', $val); | ||||
$updates['oldname'] = $folder->name; | $updates['oldname'] = $folder->name; | ||||
$updates['name'] = array_pop($parts); | $updates['name'] = array_pop($parts); | ||||
$updates['parent'] = join('/', $parts); | $updates['parent'] = join('/', $parts); | ||||
} | } | ||||
else { | else { | ||||
$updates['displayname'] = $val; | $updates['displayname'] = $val; | ||||
} | } | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines |