You are here

function panels_ajax_tab_get_context in Panels Ajax Tabs 7

Get a context from a context_string.

1 call to panels_ajax_tab_get_context()
panels_ajax_tab_prepare_mini in ./panels_ajax_tab.module
Prepares the mini-panel.

File

./panels_ajax_tab.module, line 262
Allows users to create and manage Panels Ajax Tabs.

Code

function panels_ajax_tab_get_context($context_string) {
  if (empty($context_string) || $context_string == 'none') {
    return FALSE;
  }
  $parts = explode(':', $context_string);
  $entity_type = strtolower($parts[0]);
  $entity_ids = array(
    (int) $parts[1],
  );
  $entities = entity_load($entity_type, $entity_ids);
  $entity = array_pop($entities);
  $entity->entity_type = $entity_type;
  return $entity;
}