function room_preferences_builder() { if (!$this->input->is_ajax_request()) { exit('Opps.Trying to hack. What a brave!'); } $data = $this->input->post('data'); //print_r($data);exit; $options = array('id' => $this->input->post('room_id'), 'name' => 'pref', 'button' => false); echo form_builder(json_encode($data), $options); }
<?php } ?> </span> </div> <div class="extra-overlay"> <a class="btn-close"></a> <div class="extra-desc"> <?php echo $extra_content; ?> </div> <?php $extra_options = array('id' => $extra['id'], 'extra_name' => $extra_title, 'currency' => $options['currency'], 'user_currency' => $options['user_currency'], 'currency_rate' => $options['currency_rate'], 'price' => $price); echo form_builder($extra['forms'], $extra_options); ?> </div> </div> </div> <?php } } ?> </div> <?php } ?>
/** * (AHAH) Build the form again with new altered definition and submitted values */ protected function rebuildForm($form, &$form_state) { $form += array('#post' => $_POST, '#programmed' => FALSE); return form_builder($this->nodeType . '_node_form', $form, $form_state); }
/** * Select channel by protocol * * URL: http://guifi.net/guifi/js/channel/% * * @param $rid */ function guifi_ahah_select_channel($rid) { $rid = arg(3); $cid = 'form_' . $_POST['form_build_id']; $cache = cache_get($cid, 'cache_form'); $protocol = $_POST['radios'][$rid]['protocol']; $curr_channel = $_POST['radios'][$rid]['channel']; if ($cache) { $form = $cache->data; $form['r']['radios'][$rid]['s']['channel'] = guifi_radio_channel_field($rid, $curr_channel, $protocol); cache_set($cid, $form, 'cache_form', $cache->expire); // Build and render the new select element, then return it in JSON format. $form_state = array(); $form['#post'] = array(); $form = form_builder($form['form_id']['#value'], $form, $form_state); $output = drupal_render($form['r']['radios'][$rid]['s']['channel']); drupal_json(array('status' => TRUE, 'data' => $output)); } else { drupal_json(array('status' => FALSE, 'data' => '')); } exit; }