3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * Form helper class for an OpenID object.
21 class CRM_Contact_Form_Edit_OpenID
{
24 * Build the form object elements for an open id object.
26 * @param CRM_Core_Form $form
27 * Reference to the form object.
28 * @param int $blockCount
29 * Block number to build.
30 * @param bool $blockEdit
33 public static function buildQuickForm(&$form, $blockCount = NULL, $blockEdit = FALSE) {
35 $blockId = ($form->get('OpenID_Block_Count')) ?
$form->get('OpenID_Block_Count') : 1;
38 $blockId = $blockCount;
40 $form->applyFilter('__ALL__', 'trim');
42 $form->addElement('text', "openid[$blockId][openid]", ts('OpenID'),
43 CRM_Core_DAO
::getAttribute('CRM_Core_DAO_OpenID', 'openid')
45 $form->addRule("openid[$blockId][openid]", ts('OpenID is not a valid URL.'), 'url');
48 $form->addElement('select', "openid[$blockId][location_type_id]", '', CRM_Core_PseudoConstant
::get('CRM_Core_DAO_Address', 'location_type_id'));
51 $js = ['id' => "OpenID_" . $blockId . "_IsPrimary"];
53 $js['onClick'] = 'singleSelect( this.id );';
56 $form->addElement('radio', "openid[$blockId][is_primary]", '', '', '1', $js);