Changeset View
Changeset View
Standalone View
Standalone View
plugins/kolab_delegation/kolab_delegation.php
Show First 20 Lines • Show All 557 Lines • ▼ Show 20 Lines | private function delegate_folders_block($a_folders, $attrib, $rights) | ||||
$table->add_header(array('class' => 'write checkbox-cell', 'title' => $this->gettext('write'), 'tabindex' => 0), $write_ico); | $table->add_header(array('class' => 'write checkbox-cell', 'title' => $this->gettext('write'), 'tabindex' => 0), $write_ico); | ||||
$table->add_header('foldername', $this->rc->gettext('folder')); | $table->add_header('foldername', $this->rc->gettext('folder')); | ||||
$checkbox_read = new html_checkbox(array('name' => 'read[]', 'class' => 'read')); | $checkbox_read = new html_checkbox(array('name' => 'read[]', 'class' => 'read')); | ||||
$checkbox_write = new html_checkbox(array('name' => 'write[]', 'class' => 'write')); | $checkbox_write = new html_checkbox(array('name' => 'write[]', 'class' => 'write')); | ||||
$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 All 29 Lines |