1: <?php
2: 3: 4: 5: 6:
7: class Turba_Form_Contact extends Turba_Form_ContactBase
8: {
9: 10: 11: 12:
13: public function __construct($vars, Turba_Object $contact, $tabs = true, $title = null)
14: {
15: global $conf, $notification;
16:
17: if (is_null($title)) {
18: $title = 'Turba_View_Contact';
19: }
20: parent::__construct($vars, '', $title);
21:
22:
23: $object = array();
24:
25: foreach ($contact->driver->getCriteria() as $info_key => $info_val) {
26: $object[$info_key] = $contact->getValue($info_key);
27: }
28: $vars->set('object', $object);
29:
30: $this->_addFields($contact, $tabs);
31:
32:
33: $v_params = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Vfs')->getConfig('documents');
34: if ($v_params['type'] != 'none') {
35: try {
36: $files = $contact->listFiles();
37: $this->addVariable(_("Files"), '__vfs', 'html', false);
38: $vars->set('__vfs', implode('<br />', array_map(array($contact, 'vfsEditUrl'), $files)));
39: } catch (Turba_Exception $e) {
40: $notification->push($files, 'horde.error');
41: }
42: }
43: }
44:
45: }
46: