}
}
- function &execute()
+ function &execute($attributes)
{
$this->getInfo($this->_vars, $info);
if (isset($info['object'])) {
$this->koward->search['criteria']));
$filter = $this->koward->getServer()->searchQuery($criteria);
$params = array('scope' => 'sub',
- 'attributes' => array('dn'));
+ 'attributes' => array_merge(array('dn'), $attributes));
return $this->koward->getServer()->search($filter, $params);
}
}
<table cellspacing="0" width="100%" class="linedRow">
<thead>
<tr>
- <th class="item" width="1%"><?php echo Horde::img('edit.png', _("Edit"), '', $GLOBALS['registry']->getImageDir('horde')) ?></th>
- <th class="item" width="1%"><?php echo Horde::img('delete.png', _("Delete"), '', $GLOBALS['registry']->getImageDir('horde')) ?></th>
+ <?php if ($this->allowEdit): ?>
+ <th class="item" width="1%"><?php echo Horde::img('edit.png', _("Edit"), '', $GLOBALS['registry']->getImageDir('horde')) ?></th>
+ <?php endif; ?>
+ <?php if ($this->allowDelete): ?>
+ <th class="item" width="1%"><?php echo Horde::img('delete.png', _("Delete"), '', $GLOBALS['registry']->getImageDir('horde')) ?></th>
+ <?php endif; ?>
<?php foreach ($this->attributes as $attribute => $info): ?>
<th class="item leftAlign" width="<?php echo $info['width'] ?>%" nowrap="nowrap"><?= $info['title'] ?></th>
<?php endforeach; ?>
<tbody>
<?php foreach ($this->objectlist as $dn => $info): ?>
<tr>
- <td>
- <?= $info['edit_url'] ?>
- </td>
- <td>
- <?= $info['delete_url'] ?>
- </td>
+ <?php if ($this->allowEdit): ?>
+ <td>
+ <?= $info['edit_url'] ?>
+ </td>
+ <?php endif; ?>
+ <?php if ($this->allowDelete): ?>
+ <td>
+ <?= $info['delete_url'] ?>
+ </td>
+ <?php endif; ?>
<?php foreach ($this->attributes as $attribute => $ainfo): ?>
<td>
+ <?php
+ if (isset($info[$attribute])) {
+ if (is_array($info[$attribute])) {
+ $value = $info[$attribute][0];
+ } else {
+ $value = $info[$attribute];
+ }
+ } else {
+ $value = '';
+ }
+ ?>
<?php if (!empty($ainfo['link_view'])): ?>
- <?= $info['view_url'] . $this->escape($info[$attribute]) . '</a>'; ?>
+ <?= $info['view_url'] . $this->escape($value) . '</a>'; ?>
<?php else: ?>
- <?= $this->escape($info[$attribute]) ?>
+ <?= $this->escape($value) ?>
<?php endif; ?>
</td>
<?php endforeach; ?>