summaryrefslogtreecommitdiffstats
path: root/lib/kolab_client_task.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-03-04 14:43:24 +0100
committerAleksander Machniak <machniak@kolabsys.com>2014-03-04 14:43:24 +0100
commit2a8ac19a13e682bd1e52b2364702414031f36767 (patch)
tree95d9aa20b06fd1d74be8944acf95abd3ddf95157 /lib/kolab_client_task.php
parent8e09ba6962f63bfcb0dcd6eee92250b352bec895 (diff)
downloadwebadmin-2a8ac19a13e682bd1e52b2364702414031f36767.tar.gz
Add support for organizational unit hierarchy
Diffstat (limited to 'lib/kolab_client_task.php')
-rw-r--r--lib/kolab_client_task.php49
1 files changed, 28 insertions, 21 deletions
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index c9bcae9..35eec94 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -1298,7 +1298,7 @@ class kolab_client_task
$field['suffix'] = kolab_html::escape($this->translate($field['suffix']));
}
*/
- if (!empty($field['options'])) {
+ if (!empty($field['options']) && empty($field['escaped'])) {
foreach ($field['options'] as $opt_idx => $option) {
if (is_array($option)) {
$field['options'][$opt_idx]['content'] = kolab_html::escape($this->translate($option['content']));
@@ -1527,6 +1527,8 @@ class kolab_client_task
$cols = array('name');
$i = 0;
+ $table_class = 'list';
+
// table header
$head[0]['cells'][] = array('class' => 'name', 'body' => $this->translate($task . '.list'));
@@ -1555,29 +1557,34 @@ class kolab_client_task
// table body
if (!empty($result)) {
- foreach ($result as $idx => $item) {
- if (!is_array($item)) {
- continue;
- }
+ if (method_exists($this, 'list_result_handler')) {
+ list($rows, $head, $foot, $table_class) = $this->list_result_handler($result, $head, $foot, $table_class);
+ }
+ else {
+ foreach ($result as $idx => $item) {
+ if (!is_array($item)) {
+ continue;
+ }
- $class = array('selectable');
+ $class = array('selectable');
- if (method_exists($this, 'list_item_handler')) {
- $item = $this->list_item_handler($item, $class);
- }
- else {
- $item = array_shift($item);
- }
+ if (method_exists($this, 'list_item_handler')) {
+ $item = $this->list_item_handler($item, $class);
+ }
+ else {
+ $item = array_shift($item);
+ }
- if (empty($item)) {
- continue;
- }
+ if (empty($item)) {
+ continue;
+ }
- $i++;
- $cells = array();
- $cells[] = array('class' => 'name', 'body' => kolab_html::escape($item),
- 'onclick' => "kadm.command('$task.info', '$idx')");
- $rows[] = array('id' => $i, 'class' => implode(' ', $class), 'cells' => $cells);
+ $i++;
+ $cells = array();
+ $cells[] = array('class' => 'name', 'body' => kolab_html::escape($item),
+ 'onclick' => "kadm.command('$task.info', '$idx')");
+ $rows[] = array('id' => $i, 'class' => implode(' ', $class), 'cells' => $cells);
+ }
}
}
else {
@@ -1588,7 +1595,7 @@ class kolab_client_task
$table = kolab_html::table(array(
'id' => $task . 'list',
- 'class' => 'list',
+ 'class' => $table_class,
'head' => $head,
'body' => $rows,
'foot' => $foot,