Changeset View
Changeset View
Standalone View
Standalone View
plugins/kolab_activesync/kolab_activesync_ui.php
Show First 20 Lines • Show All 177 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(); | |||||
foreach ($a_folders as $folder) { | foreach ($a_folders as $folder) { | ||||
$foldername = $origname = preg_replace('/^INBOX »\s+/', '', kolab_storage::object_prettyname($folder)); | $foldername = kolab_storage::object_prettyname($folder); | ||||
// find folder prefix to truncate (the same code as in kolab_addressbook plugin) | |||||
for ($i = count($names)-1; $i >= 0; $i--) { | |||||
if (strpos($foldername, $names[$i].' » ') === 0) { | |||||
$length = strlen($names[$i].' » '); | |||||
$prefix = substr($foldername, 0, $length); | |||||
$count = count(explode(' » ', $prefix)); | |||||
$foldername = str_repeat(' ', $count-1) . '» ' . substr($foldername, $length); | |||||
break; | |||||
} | |||||
} | |||||
$folder_id = 'rcmf' . rcube_utils::html_identifier($folder); | $folder_id = 'rcmf' . rcube_utils::html_identifier($folder); | ||||
$names[] = $origname; | |||||
$classes = array('mailbox'); | $classes = array('mailbox'); | ||||
if ($folder_class = $this->rc->folder_classname($folder)) { | if ($folder_class = $this->rc->folder_classname($folder)) { | ||||
if ($this->rc->text_exists($folder_class)) { | if ($this->rc->text_exists($folder_class)) { | ||||
$foldername = html::quote($this->rc->gettext($folder_class)); | $foldername = html::quote($this->rc->gettext($folder_class)); | ||||
} | } | ||||
$classes[] = $folder_class; | $classes[] = $folder_class; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |