Changeset View
Changeset View
Standalone View
Standalone View
plugins/kolab_activesync/kolab_activesync_ui.php
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | public function folder_subscriptions_block($a_folders, $attrib, $subscribed) | ||||
$table->add_header('foldername', $this->plugin->gettext('folder')); | $table->add_header('foldername', $this->plugin->gettext('folder')); | ||||
$checkbox_sync = new html_checkbox(array('name' => 'subscribed[]', 'class' => 'subscription')); | $checkbox_sync = new html_checkbox(array('name' => 'subscribed[]', 'class' => 'subscription')); | ||||
$checkbox_alarm = new html_checkbox(array('name' => 'alarm[]', 'class' => 'alarm')); | $checkbox_alarm = new html_checkbox(array('name' => 'alarm[]', 'class' => 'alarm')); | ||||
$names = array(); | $names = array(); | ||||
foreach ($a_folders as $folder) { | foreach ($a_folders as $folder) { | ||||
$foldername = $origname = preg_replace('/^INBOX »\s+/', '', kolab_storage::object_prettyname($folder)); | $foldername = $origname = kolab_storage::object_prettyname($folder); | ||||
// find folder prefix to truncate (the same code as in kolab_addressbook plugin) | // find folder prefix to truncate (the same code as in kolab_addressbook plugin) | ||||
for ($i = count($names)-1; $i >= 0; $i--) { | for ($i = count($names)-1; $i >= 0; $i--) { | ||||
if (strpos($foldername, $names[$i].' » ') === 0) { | if (strpos($foldername, $names[$i].' » ') === 0) { | ||||
$length = strlen($names[$i].' » '); | $length = strlen($names[$i].' » '); | ||||
$prefix = substr($foldername, 0, $length); | $prefix = substr($foldername, 0, $length); | ||||
$count = count(explode(' » ', $prefix)); | $count = count(explode(' » ', $prefix)); | ||||
$foldername = str_repeat(' ', $count-1) . '» ' . substr($foldername, $length); | $foldername = str_repeat(' ', $count-1) . '» ' . substr($foldername, $length); | ||||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |