You are here

function globallink_add_to_cart in GlobalLink Connect for Drupal 7.7

Function to add list of contents to Globallink submission.

1 string reference to 'globallink_add_to_cart'
globallink_node_operations in ./globallink.module
Implements hook_node_operations().

File

./globallink.module, line 1811
GlobalLink translation module.

Code

function globallink_add_to_cart($nodes) {
  module_load_include('inc', 'globallink', 'globallink');
  $node_types = globallink_get_translatable_node_types(TRUE);
  $result = db_select(GLOBALLINK_ENTITY_TYPE_NODE, 'n')
    ->fields('n', array(
    'nid',
    'vid',
    'type',
  ))
    ->condition('nid', $nodes, 'IN')
    ->execute();
  foreach ($result as $row) {
    if (in_array($row->type, $node_types)) {
      $_SESSION['nids'][$row->nid . '-' . $row->vid] = $row->nid . '-' . $row->vid;
    }
    else {
      $_SESSION['eids'][$row->nid . '-' . $row->vid] = $row->nid . '-' . $row->vid;
    }
  }
  drupal_set_message(t('Content added to Globallink Submission.'));
}