summaryrefslogtreecommitdiff
path: root/sites/all/modules/ctools/plugins/content_types/page/page_actions.inc
blob: c20c4082299ff268a1e36f18bba903f8cccb4088 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

/**
 * @file
 * Plugin to handle the 'page_actions' content type which allows the local
 * actions template variables to be embedded into a panel.
 */

/**
 * Plugins are described by creating a $plugin array which will be used
 * by the system that includes this file.
 */
$plugin = array(
  'title' => t('Actions'),
  'single' => TRUE,
  'icon' => 'icon_page.png',
  'description' => t('Add the action links (local tasks) as content.'),
  'category' => t('Page elements'),
  'render last' => TRUE,
);

/**
 * Output function for the 'page_actions' content type.
 *
 * Outputs the actions (local tasks) of the current page.
 */
function ctools_page_actions_content_type_render($subtype, $conf, $panel_args) {
  $block = new stdClass();
  $block->content = theme('ctools_menu_local_actions_wrapper', array('links' => menu_local_actions()));

  return $block;
}