function panelizer_panelizer_task_admin_summary in Panelizer 7.2
Same name and namespace in other branches
- 6 plugins/task_handlers/panelizer_node.inc \panelizer_panelizer_task_admin_summary()
- 7.3 plugins/task_handlers/panelizer_node.inc \panelizer_panelizer_task_admin_summary()
- 7 plugins/task_handlers/panelizer_node.inc \panelizer_panelizer_task_admin_summary()
Callback to provide administrative summary of the task handler.
1 string reference to 'panelizer_panelizer_task_admin_summary'
- panelizer_node.inc in plugins/
task_handlers/ panelizer_node.inc - This is the task handler plugin to handle an entity view. NOTE: This is named panelizer_node for historical reasons. It is too much of a pain to change the name of a task handler. This panelizes any entity not just a node.
File
- plugins/
task_handlers/ panelizer_node.inc, line 165 - This is the task handler plugin to handle an entity view. NOTE: This is named panelizer_node for historical reasons. It is too much of a pain to change the name of a task handler. This panelizes any entity not just a node.
Code
function panelizer_panelizer_task_admin_summary($handler, $task, $subtask, $page, $show_title = TRUE) {
ctools_include('context');
ctools_include('context-task-handler');
$output = '';
$output .= '<div class="clear-block">';
if ($show_title) {
// Get the operations
$operations = page_manager_get_operations($page);
// Get operations for just this handler.
$operations = $operations['handlers']['children'][$handler->name]['children']['actions']['children'];
$args = array(
'handlers',
$handler->name,
'actions',
);
$rendered_operations = page_manager_render_operations($page, $operations, array(), array(
'class' => array(
'actions',
),
), 'actions', $args);
$output .= '<div class="handler-title clear-block">';
$output .= '<div class="actions handler-actions">' . $rendered_operations['actions'] . '</div>';
$output .= '<span class="title-label">' . t('Panelizer') . '</span>';
$output .= '</div>';
}
$plugin = page_manager_get_task_handler($handler->handler);
$object = ctools_context_handler_get_task_object($task, $subtask, $handler);
$context = ctools_context_load_contexts($object, TRUE);
$access = ctools_access_group_summary(!empty($handler->conf['access']) ? $handler->conf['access'] : array(), $context);
if ($access) {
$access = t('This variant will be selected if the entity being viewed is panelized AND @conditions. This variant must be enabled and selected for panelizer to work!', array(
'@conditions' => $access,
));
}
else {
$access = t('This variant will be selected if the entity being viewed is panelized. This variant must be enabled and selected for panelizer to work!');
}
$rows[] = array(
array(
'class' => array(
'page-summary-label',
),
'data' => t('Selection rule'),
),
array(
'class' => array(
'page-summary-data',
),
'data' => $access,
),
array(
'class' => array(
'page-summary-operation',
),
'',
),
);
$output .= theme('table', array(
'header' => array(),
'rows' => $rows,
'attributes' => array(
'class' => array(
'page-manager-handler-summary',
),
),
));
$output .= '</div>';
return $output;
}