You are here

function _views_maintenance_panel_node_pane_use_case in Views Maintenance 6

Same name and namespace in other branches
  1. 7 includes/ctools.inc \_views_maintenance_panel_node_pane_use_case()

Builds use case as pane in panel node.

Use case should be confirmed outside of this function, it only builds use case array based on states of passed objects.

Parameters

object $node:

object $pane:

Return value

array

1 call to _views_maintenance_panel_node_pane_use_case()
_views_maintenance_panel_node_use_cases in includes/ctools.inc
Returns displays use cases in all panel nodes.

File

includes/ctools.inc, line 516
Provides integration with Page Manager and Panels Mini.

Code

function _views_maintenance_panel_node_pane_use_case($node, $pane) {
  $links = array();
  if (user_access('administer nodes') || user_access('administer panel-nodes')) {
    $links[] = l(t('Edit panel content'), "node/{$node->nid}/panel_content");
  }
  $description = array();
  if (empty($node->status)) {
    $status = 'unused';
    $description[] = t('Node %title is unpublished', array(
      '%title' => $node->title,
    ));
  }
  else {
    $description[] = t('Node %title is published', array(
      '%title' => $node->title,
    ));
    $pane_title = _views_maintenance_content_pane_title($pane);
    if (empty($pane->shown)) {
      $status = 'unused';
      $description[] = t('Pane !title is hidden', array(
        '!title' => $pane_title,
      ));
    }
    else {
      $status = 'ok';
      $description[] = t('Pane !title is visible', array(
        '!title' => $pane_title,
      ));
    }
  }
  return array(
    'type' => t('Content Pane in Panel Node'),
    'status' => $status,
    'description' => $description,
    'links' => $links,
  );
}