You are here

function emthumb_menu in Embedded Media Field 5

Same name and namespace in other branches
  1. 6.3 contrib/emthumb/emthumb.module \emthumb_menu()
  2. 6.2 contrib/emthumb/emthumb.module \emthumb_menu()

File

contrib/emthumb/emthumb.module, line 3

Code

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

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