function crm_core_activity_crm_core_activity_view_page_manager_tasks in CRM Core 7
Implements hook_page_manager_task_tasks().
Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for more information.
File
- modules/
crm_core_activity/ plugins/ tasks/ crm_core_activity_view.inc, line 17 - Handle the 'crm_core_activity view' override task.
Code
function crm_core_activity_crm_core_activity_view_page_manager_tasks() {
$text = 'When enabled, this overrides the default Drupal behavior for displaying activities at ' . '<em>crm-core/contact/%crm_core_contact/activities/%activity_id</em>. If you add variants, you ' . 'may use selection criteria such as contact type or language or user access to provide different ' . 'views of contacts. If no variant is selected, the default Drupal contact view will be used. ' . 'This page only affects contacts viewed as pages, it will not affect contacts viewed in lists or ' . 'at other locations. Also please note that if you are using pathauto, aliases may make a contact ' . 'to be somewhere else, but as far as Drupal is concerned, they are still at ' . 'crm-core/contact/%crm_core_contact/activities/%activity_id.';
$prefs = array(
// This is a 'page' task and will fall under the page admin UI.
'task type' => 'page',
'title' => t('Activity template'),
'admin title' => t('Activity template'),
'admin description' => t($text),
'admin path' => 'crm-core/contact/%crm_core_contact/activity/%crm_core_activity',
// Menu hooks so that we can alter the crm-core/activity/%crm_core_activity menu entry to point to us.
'hook menu' => 'crm_core_activity_crm_core_activity_view_menu',
'hook menu alter' => 'crm_core_activity_crm_core_activity_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' => 'crm_core_activity_crm_core_activity_view_get_arguments',
'get context placeholders' => 'crm_core_activity_crm_core_activity_view_get_contexts',
// Allow this to be enabled or disabled:
'disabled' => variable_get('page_manager_crm_core_activity_view_disabled', TRUE),
'enable callback' => 'crm_core_activity_crm_core_activity_view_enable',
'access callback' => 'crm_core_activity_crm_core_activity_view_access_check',
);
return $prefs;
}