Skip to content

Instantly share code, notes, and snippets.

@ezra-g
Created May 3, 2013 19:47
Show Gist options
  • Save ezra-g/5513346 to your computer and use it in GitHub Desktop.
Save ezra-g/5513346 to your computer and use it in GitHub Desktop.
/**
* Implements hook_form_alter().
*/
function commons_soundcloud_audio_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'soundcloud_audio_node_form') {
dpm($form, 'form');
}
}
function commons_soundcloud_audio_element_info_alter(&$type) {
dpm("altering");
// Decrease the default size of textfields.
if (is_array($type['media']['#process'])) {
dpm($type['media'], 'ima let you finish but this is an array');
$type['media']['#process'][] = 'commons_soundcloud_media_element_process';
}
else {
dpm("whoa, we have else");
$type['media']['#process'] = array($type['media']['#process'], 'commons_soundcloud_media_element_process');
}
}
function commons_soundcloud_media_element_process(&$element, &$form_state, $form) {
dpm("eh eh eh?");
$a = func_get_args();
dpm($a, 'args');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment