I am attempting to pass an array as a page argument in a page callback in one of my modules. The scenario is this: The user selects some photo prints and I'm trying to add all the selected photo prints to the cart. So I'm trying to pass an array through a url to use it in a function. And the photo prints can be from different photo albums. There is code to do it if all the photos are from the same album so Im currently perusing that as well. This is code I "inherited" by the way.
The URL looks like /add_selected_prints_to_cart/Array. As you can see, instead of an array of values, it's just Array.
This is the page callback:
// Add the selected prints to the cart.
$items['add_selected_prints_to_cart/%'] = array(
'page callback' => 'add_selected_prints_cart',
'page arguments' => array(1),
'access callback' => TRUE,
'access arguments' => array('view own gallery'),
'type' => MENU_CALLBACK
);
Like I said, I am just trying to figure out how to pass the array. Once I figure out that, the other part is easy.
Maybe there is an easier way to do this.