You are here

function _popup_node in Popup 6.x

Same name and namespace in other branches
  1. 8 includes/popup.api.inc \_popup_node()
  2. 7 includes/popup.api.inc \_popup_node()
  3. 7.x includes/popup.api.inc \_popup_node()
1 call to _popup_node()
theme_popup_field in modules/popup_ui/popup_ui.module
Implementation of theme_popup_field

File

includes/popup.api.inc, line 284

Code

function _popup_node($attributes, $return = FALSE) {
  $node = node_load($attributes['node']);
  $title = $attributes['title'] ? $attributes['title'] : $node->title;
  if ($return == 'title') {
    return $title;
  }
  if ($attributes['panel-display'] && module_exists('ctools')) {
    require_once drupal_get_path('module', 'ctools') . '/page_manager/plugins/tasks/node_view.inc';
    $body = page_manager_node_view($node);
  }
  else {
    $body = node_view($node, $attributes['teaser-display'] == TRUE, $attributes['page-display'] == TRUE, $attributes['links'] == TRUE);
  }
  if ($return == 'body') {
    return $body;
  }
  return popup_element($title, $body, $attributes);
}