Created
June 20, 2013 07:51
-
-
Save opalsignum-snippets/5820954 to your computer and use it in GitHub Desktop.
PHP: Views Embedding in the User Profile Form with hook_form_alter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_form_alter(). | |
* - Extends the User Profile Form with the calendar view | |
*/ | |
function pw_profile_extender_form_alter(&$form, &$form_state, $form_id) { | |
if ($form_id == 'user_profile_form') { | |
$form['calendar admin'] = array( | |
'#type' => 'markup', | |
'#markup' =>views_embed_view('calendar','calendar_admin_block'), | |
'#weight' => 1, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment