Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function nppa_profile_form_alter(&$form, &$form_state, $form_id){
- global $user;
- switch($form_id){
- case "user_profile_form":
- drupal_add_library('system','ui.datepicker');
- drupal_add_css((drupal_get_path('module', 'nppa_profile') . '/css/edit-profile.css'),array("type"=>"file","weight"=>"1000", "preprocess"=>FALSE, "group"=> CSS_THEME));
- $nid=73; // grab this from preferences in the future...
- $node = node_load($nid);
- webform_node_view($node,"full");
- //jtools_out($node->content['webform']["#form"]);
- // lets remove some unnecessary items:
- $form['account']['mail']['#description'] = "Your email address";
- $form['account']['pass']['#description'] = "";
- unset($form['field_skill_set']);
- $form['#attached'] = $node->content['webform']["#form"]['#attached'];
- $form["#node"] = $node;
- $append = $node->content['webform']["#form"]['submitted'];
- nppa_profile_add_validation($append);
- $form['submitted'] = $append;
- // Finally add our event handlers and send this off!
- $form['#submit'][] = "nppa_profile_user_profile_form_submit";
- $form['#validate'][] = "nppa_profile_user_profile_form_validate";
- $form["#suffix"] = "<style>
- #webform-component-civicrm-1-contact-1-fieldset-fieldset--civicrm-2-contact-1-fieldset-fieldset--civicrm-2-contact-1-contact-existing,
- #webform-component-civicrm-1-contact-1-fieldset-fieldset--civicrm-2-contact-1-fieldset-fieldset--civicrm-2-contact-1-contact-organization-name{display:none;}
- </style>
- <script>
- jQuery('#webform-component-civicrm-1-contact-1-fieldset-fieldset--civicrm-2-contact-1-fieldset-fieldset--civicrm-2-contact-1-contact-existing').css('display','block');
- jQuery('#user-profile-form').addClass('webform-client-form');
- jQuery('#user-profile-form').attr('id','webform-client-form-" . $nid . "');
- jQuery('#edit-submitted-civicrm-1-contact-1-fieldset-fieldset-civicrm-1-contact-1-contact-birth-date').datepicker();
- </script>";
- fl($form);
- break;
- }
- }
Add Comment
Please, Sign In to add comment