Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function buy_art_callback($ajax) {
- if ($ajax) {
- ctools_include('ajax');
- ctools_include('modal');
- $form_state = array(
- 'ajax' => TRUE,
- 'title' => t('Buy now with 1-Click'),
- );
- // Use ctools to generate ajax instructions for the browser to create
- // a form in a modal popup.
- $output = ctools_modal_form_wrapper('buy_art_buy_one_click_form', $form_state);
- // If the form has been submitted, there may be additional instructions
- // such as dismissing the modal popup.
- if (!empty($form_state['ajax_commands'])) {
- $output = $form_state['ajax_commands'];
- }
- // Return the ajax instructions to the browser via ajax_render().
- print ajax_render($output);
- drupal_exit();
- }
- else {
- return drupal_get_form('buy_art_buy_one_click_form');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement