You are here

function views_plugin_argument_rr::get_argument in Recently Read 7.2

Return the default argument.

This needs to be overridden by every default argument handler to properly do what is needed.

Overrides views_plugin_argument_default::get_argument

File

includes/views_plugin_argument_rr.inc, line 14
Contains the node from URL argument default plugin.

Class

views_plugin_argument_rr
Default argument plugin to extract a node via menu_get_object

Code

function get_argument() {
  global $user;
  if ($user->uid) {
    return 'all';
  }
  if (empty($_SESSION)) {
    return 0;
  }
  else {
    $node_types = variable_get('recently_read_node_types', array());
    $nids = array();
    foreach ($node_types as $type) {
      if (!empty($_SESSION['recently_read-' . $type])) {

        //$nids .= implode('+',array_keys($_SESSION['recently_read-'. $type]));
        $nids = array_merge($nids, array_keys($_SESSION['recently_read-' . $type]));
      }
    }
    $nids = implode('+', $nids);

    //dsm($nids);
  }
  return $nids;
}