Fix passing parameters to Turba_Form const'rs
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 27 Jan 2011 22:48:19 +0000 (17:48 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 27 Jan 2011 22:48:38 +0000 (17:48 -0500)
turba/lib/Form/AddContact.php
turba/lib/Form/Contact.php
turba/lib/Form/EditContact.php

index a388a89..2532f1c 100644 (file)
@@ -11,7 +11,7 @@ class Turba_Form_AddContact extends Turba_Form_Contact
         // @TODO: $addSources should be injected
         global $addSources, $notification;
 
-        parent::Horde_Form($vars, _("Add Contact"));
+        parent::__construct($vars, $contact, true, _("Add Contact"));
         $this->_contact = $contact;
 
         $this->setButtons(_("Add"));
index 4956e65..c684a77 100644 (file)
@@ -8,14 +8,18 @@ class Turba_Form_Contact extends Horde_Form
      * @param array $vars  Array of form variables
      * @param Turba_Object $contact
      */
-    public function __construct($vars, Turba_Object $contact, $tabs = true)
+    public function __construct($vars, Turba_Object $contact, $tabs = true, $title = null)
     {
         global $conf, $notification;
 
-        parent::__construct($vars, '', 'Turba_View_Contact');
+        if (is_null($title)) {
+            $title = 'Turba_View_Contact';
+        }
+        parent::__construct($vars, '', $title);
 
         /* Get the values through the Turba_Object class. */
         $object = array();
+
         foreach ($contact->driver->getCriteria() as $info_key => $info_val) {
             $object[$info_key] = $contact->getValue($info_key);
         }
index be06989..99f6c52 100644 (file)
@@ -15,7 +15,7 @@ class Turba_Form_EditContact extends Turba_Form_Contact
     {
         global $conf;
 
-        parent::Horde_Form($vars, '', 'Turba_View_EditContact');
+        parent::__construct($vars, $contact, true, 'Turba_View_EditContact');
         $this->_contact = $contact;
 
         $this->setButtons(_("Save"));