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