Created
August 18, 2012 20:34
-
-
Save paolomainardi/3389706 to your computer and use it in GitHub Desktop.
asdfa
This file contains 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
/** | |
* Helper function for cloning and drupal_render()'ing elements. | |
*/ | |
function aquaknow_render_clone($elements) { | |
static $instance; | |
if (!isset($instance)) { | |
$instance = 1; | |
} | |
foreach (element_children($elements) as $key) { | |
if (isset($elements[$key]['#id'])) { | |
$elements[$key]['#id'] = "{$elements[$key]['#id']}-{$instance}"; | |
} | |
} | |
$instance++; | |
return drupal_render($elements); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment