From: Tim Mallezie Date: Thu, 21 May 2015 15:52:05 +0000 (+0200) Subject: use addfield in website form X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ee8424c1ba924c08c1d08cacab746def1e0d89ca;p=civicrm-core.git use addfield in website form --- diff --git a/CRM/Contact/Form/Edit/Website.php b/CRM/Contact/Form/Edit/Website.php index ffa3244fa4..faf7c292c6 100644 --- a/CRM/Contact/Form/Edit/Website.php +++ b/CRM/Contact/Form/Edit/Website.php @@ -59,18 +59,13 @@ class CRM_Contact_Form_Edit_Website { $form->applyFilter('__ALL__', 'trim'); //Website type select - $form->addSelect("website[$blockId][website_type_id]", array('entity' => 'website', 'class' => 'eight')); - + $form->addField("website[$blockId][website_type_id]", array('entity' => 'website', 'class' => 'eight')); //Website box - $form->addElement('text', "website[$blockId][url]", ts('Website'), - array_merge( - CRM_Core_DAO::getAttribute('CRM_Core_DAO_Website', 'url'), - array( - 'onfocus' => "if (!this.value) { this.value='http://';} else return false", - 'onblur' => "if ( this.value == 'http://') { this.value='';} else return false", - ) - ) - ); + $form->addField("website[$blockId][url]", array( + 'entity' => 'website', + 'onfocus' => "if (!this.value) { this.value='http://';} else return false", + 'onblur' => "if ( this.value == 'http://') { this.value='';} else return false", + )); $form->addRule("website[$blockId][url]", ts('Enter a valid web location beginning with \'http://\' or \'https://\'. EXAMPLE: http://www.mysite.org/'), 'url'); }