You are here

function filebrowser_node_view in Filebrowser 7.4

Same name and namespace in other branches
  1. 8.2 filebrowser.module \filebrowser_node_view()
  2. 8 filebrowser.module \filebrowser_node_view()
  3. 7.2 filebrowser.module \filebrowser_node_view()
  4. 7.3 filebrowser.module \filebrowser_node_view()
  5. 3.x filebrowser.module \filebrowser_node_view()

Implements hook_node_view(). @inheritdoc

File

./filebrowser.module, line 538

Code

function filebrowser_node_view($node, $view_mode) {
  if ($node->type == 'dir_listing' && $view_mode == 'full') {
    $links = array();
    if (_filebrowser_metadata_access($node->file_listing['.']['fid'])) {
      $links['file_browser_metadata'] = array(
        'href' => "filebrowser/metadata/{$node->file_listing['.']['fid']}",
        'title' => t("Edit Metadatas"),
        'query' => drupal_get_destination(),
      );
    }
    $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(),
      );
    }
    $node->content['links']['filebrowser'] = array(
      '#theme' => 'links',
      '#links' => $links,
    );
  }
}