public function html($active = true) { global $browser, $vars; if (!$this->contact) { echo '<h3>' . _("The requested contact was not found.") . '</h3>'; return; } if (!$this->contact->hasPermission(Horde_Perms::EDIT)) { if (!$this->contact->hasPermission(Horde_Perms::READ)) { echo '<h3>' . _("You do not have permission to view this contact.") . '</h3>'; return; } else { echo '<h3>' . _("You only have permission to view this contact.") . '</h3>'; return; } } echo '<div id="EditContact"' . ($active ? '' : ' style="display:none"') . '>'; $form = new Turba_Form_EditContact($vars, $this->contact); $form->renderActive($form->getRenderer(), $vars, Horde::url('edit.php'), 'post'); echo '</div>'; if ($active && $browser->hasFeature('dom')) { if ($this->contact->hasPermission(Horde_Perms::READ)) { $view = new Turba_View_Contact($this->contact); $view->html(false); } if ($this->contact->hasPermission(Horde_Perms::DELETE)) { $delete = new Turba_View_DeleteContact($this->contact); $delete->html(false); } } }
public function renderActive($renderer, $vars, $action, $method) { parent::renderActive($renderer, $vars, $action, $method); $results = new Turba_List($vars->get('objectkeys')); /* Don't show listview if only 1 entry. */ if (count($results) > 1) { /* Read the columns to display from the preferences. */ $source = $vars->get('source'); $sources = Turba::getColumns(); $listView = new Turba_View_List($results, array('Group' => true), isset($sources[$source]) ? $sources[$source] : array()); $numDisplayed = 0; echo '<br />' . $listView->getPage($numDisplayed); } }