You are here

function imagefield_menu in ImageField 5

Same name and namespace in other branches
  1. 5.2 imagefield.module \imagefield_menu()

File

./imagefield.module, line 20
Defines an image field type. imagefield uses content.module to store the fid, and the drupal files table to store the actual file data.

Code

function imagefield_menu($maycache) {
  $items = array();
  if (!$maycache && $_SESSION['imagefield']) {

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