Created
July 5, 2012 15:11
-
-
Save jec006/3054256 to your computer and use it in GitHub Desktop.
Get the drupal form
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
<?php | |
/** | |
* Passthrough from Drupal form to the correct condition for building the preview form | |
* | |
* @param $form | |
* The form array used in hook_form | |
* @param $form_state | |
* The form_state array as used in hook_form | |
* | |
* @return | |
* A drupal form array created but the root condition | |
*/ | |
public function getPreviewForm(&$form, &$form_state) { | |
$root_condition = $this->getRootCondition(); | |
function sps_preview_manager_get_condition_form ($form, $form_state) { | |
return $root_condition->getElement($form, $form_state); | |
} | |
return drupal_get_form('sps_preview_manager_get_condition_form'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i was thinking it would be like this
function sps_preview_manager_get_condition_form ($form, $form_state) {
$manager = sps_get_manager();
return $manager->getPreviewForm($form, $form_state)
}