You are here

function file_entity_file_view_page_manager_tasks in File Entity (fieldable files) 7.2

Same name and namespace in other branches
  1. 7.3 plugins/tasks/file_view.inc \file_entity_file_view_page_manager_tasks()

Specialized implementation of hook_page_manager_task_tasks().

File

plugins/tasks/file_view.inc, line 15
Handle the 'file view' override task.

Code

function file_entity_file_view_page_manager_tasks() {
  return array(
    // This is a 'page' task and will fall under the page admin UI
    'task type' => 'page',
    'title' => t('File template'),
    'admin title' => t('File template'),
    'admin description' => t('When enabled, this overrides the default Drupal behavior for displaying files at <em>file/%file</em>. If you add variants, you may use selection criteria such as file types or user access to provide different views of files. If no variant is selected, the default Drupal file view will be used. This page only affects files viewed as pages, it will not affect files viewed in lists or at other locations. Also please note that if you are using Pathauto, aliases may make a file to be available somewhere else, but as far as Drupal is concerned, they are still at file/%file.'),
    'admin path' => 'file/%file',
    // Menu hooks so that we can alter the file/%file menu entry to point to us.
    'hook menu' => 'file_entity_file_view_menu',
    'hook menu alter' => 'file_entity_file_view_menu_alter',
    // This is task uses 'context' handlers and must implement these to give the
    // handler data it needs.
    'handler type' => 'context',
    'get arguments' => 'file_entity_file_view_get_arguments',
    'get context placeholders' => 'file_entity_file_view_get_contexts',
    // Allow this to be enabled or disabled:
    'disabled' => variable_get('file_entity_file_view_disabled', TRUE),
    'enable callback' => 'file_entity_file_view_enable',
    'access callback' => 'file_entity_file_view_access_check',
  );
}