You are here

function linkimagefield_menu in Link Image Field 5

File

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

Code

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

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