You are here

function biblio_arg_handler in Bibliography Module 7

Same name and namespace in other branches
  1. 7.2 includes/biblio.pages.inc \biblio_arg_handler()
1 call to biblio_arg_handler()
biblio_page in includes/biblio.pages.inc

File

includes/biblio.pages.inc, line 20
Copyright (C) 2006-2011 Ron Jerome.

Code

function biblio_arg_handler($arg_info) {
  $arg_list = array();
  if (count($arg_info['func_args']) == 1 && is_array($arg_info['func_args'][0])) {
    return $arg_info['func_args'][0];
  }
  while ($arg_info['func_args']) {
    $arg = array_shift($arg_info['func_args']);
    $value = array_shift($arg_info['func_args']);
    if ($arg == 'sort') {
      $arg_list['s'] = $value;
    }
    elseif ($arg == 'order') {
      $arg_list['o'] = strtolower($value) == 'desc' ? 'desc' : 'asc';
    }
    else {
      $arg_list['f'][$arg] = $value;
    }
  }
  $arg_list = array_merge_recursive($arg_list, $arg_info['uri']['query']);
  return $arg_list;
}