You are here

function filefield_menu in FileField 5

Same name and namespace in other branches
  1. 5.2 filefield.module \filefield_menu()
  2. 6.3 filefield.module \filefield_menu()
  3. 6.2 filefield.module \filefield_menu()

@file Defines a file field type.

uses content.module to store the fid, and the drupal files table to store the actual file data.

File

./filefield.module, line 12
Defines a file field type.

Code

function filefield_menu($maycache) {
  $items = array();
  if (!$may_cache && $_SESSION['filefield']) {

    // Add handlers for previewing new uploads.
    foreach ($_SESSION['filefield'] as $fieldname => $files) {
      if (is_array($files)) {
        foreach ($files as $delta => $file) {
          if ($file['preview']) {
            $items[] = array(
              'path' => $file['preview'],
              'callback' => '_filefield_preview',
              'access' => TRUE,
              'type' => MENU_CALLBACK,
            );
          }
        }
      }
    }
  }
  return $items;
}