form_get_cache

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 form_get_cache($form_build_id, &$form_state)

Fetch a form from cache.

Verwandte Themen

▾ 4 functions call form_get_cache()

book_form_update in modules/book/book.pages.inc
Renders a new parent page select element when the book selection changes.
drupal_get_form in includes/form.inc
Retrieves a form from a constructor function, or from the cache if the form was built in a previous page-load. The form is then passed on for processing, after and rendered for display if necessary.
poll_choice_js in modules/poll/poll.module
Menu callback for AHAH additions.
upload_js in modules/upload/upload.module
Menu-callback for JavaScript-based uploads.

Code

includes/form.inc, line 239

<?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;
    }
  }
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen