Skip to content

Instantly share code, notes, and snippets.

@jec006
Created July 5, 2012 15:11
Show Gist options
  • Save jec006/3054256 to your computer and use it in GitHub Desktop.
Save jec006/3054256 to your computer and use it in GitHub Desktop.
Get the drupal form
<?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');
}
@e2thex
Copy link

e2thex commented Jul 5, 2012

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)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment