You are here

function filebrowser_link in Filebrowser 6.2

Implementation of hook_link().

File

./filebrowser.module, line 243

Code

function filebrowser_link($type, $node = NULL, $teaser = FALSE) {
  if (isset($node->type) && $node->type == 'dir_listing') {
    $links = array();
    if (user_access(FILEBROWSER_EDIT_META_DATA)) {
      $links['file_browser_metadata'] = array(
        'href' => "filebrowser/metadata/{$node->file_listing['.']['fid']}",
        'title' => t("Edit Metadatas"),
        'query' => drupal_get_destination(),
      );
    }
    if (user_access(FILEBROWSER_UPDATE_THUMBNAILS)) {
      $thumbnailers = module_implements("filebrowser_thumbnailer_prepare");
      if (count($thumbnailers) != 0) {
        $links['file_browser_update_thumbnails'] = array(
          'href' => "filebrowser/thumbnails/{$node->file_listing['.']['fid']}",
          'title' => t("Update thumbnails"),
          'query' => drupal_get_destination(),
        );
      }
    }
    return $links;
  }
}