form_get_cache
Definition
form_get_cache($form_build_id, &$form_state)
includes/form.inc, line 237
Description
Fetch a form from cache.
Related topics
| Name | Description |
|---|---|
| Form generation | Functions to enable the processing and display of HTML forms. |
Code
<?php
function form_get_cache($form_build_id, &$form_state) {
global $user;
if ($cached = cache_get('form_'. $form_build_id, 'cache_form')) {
$form = $cached->data;
if ((isset($form['#cache_token']) && drupal_valid_token($form['#cache_token'])) || (!isset($form['#cache_token']) && !$user->uid)) {
if ($cached = cache_get('storage_'. $form_build_id, 'cache_form')) {
$form_state['storage'] = $cached->data;
}
return $form;
}
}
}
?> 