I am trying to theme the user profile edit page using user_profile_form() and need help how to achieve this. In my template.php I have the following code:
function marinelli_theme($existing, $type, $theme, $path) {
$hooks['user_profile_form'] = array(
// Forms always take the form argument.
'arguments' => array('form' => NULL),
'render element' => 'form',
'path' => drupal_get_path('theme','marinelli'),
'template' => 'templates/user-profile-edit',
);
}
function marinelli_preprocess_user_profile_form(&$variables) {
global $user;
$form_id = 'user_profile_form';
$form_state = array();
$form_state['build_info']['args'] = array($user);
// Load user.pages.inc and ensure it is automatically reloaded if
// this form is rebuilt via AJAX or other means.
form_load_include($form_state, 'inc', 'user', 'user.pages');
$variables['rendered'] = drupal_build_form($form_id, $form_state);
}