Skip to content

Instantly share code, notes, and snippets.

@illmatix
Created June 24, 2015 20:18
Show Gist options
  • Select an option

  • Save illmatix/e64102ad195d283f3077 to your computer and use it in GitHub Desktop.

Select an option

Save illmatix/e64102ad195d283f3077 to your computer and use it in GitHub Desktop.
<?php
function ss_menu_location_menu() {
$items['location/%/edit'] = array(
'title' => 'Edit',
'page callback' => 'ss_menu_location_edit_redirect',
'page arguments' => array(1),
'access callback' => 'ss_menu_location_access',
'access arguments' => array('edit', 1),
'weight' => -10,
'type' => MENU_LOCAL_TASK,
);
$items['location/%ss_menu_location_name/menu'] = array(
'title' => 'Menu',
'page callback' => 'ss_menu_location_menu_view',
'page arguments' => array(1),
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK,
);
$day_of_the_week = date('l');
$items['location/%ss_menu_location_name/drink/%ss_menu_location_term_name/' . $day_of_the_week] = array(
'title' => 'Drinks',
'page callback' => 'ss_menu_location_menu_view',
'page arguments' => array(1,3,4),
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK,
);
$items['location/%ss_menu_location_name/drink/%ss_menu_location_term_name'] = array(
'title' => 'Drinks',
'page callback' => 'ss_menu_location_menu_view',
'page arguments' => array(1, 3),
'access arguments' => array('access content'),
'type' => MENU_SUGGESTED_ITEM,
);
$items['location/%ss_menu_location_name/drink/%ss_menu_location_term_name/%ss_menu_location_term_name'] = array(
'title' => 'Drinks',
'page callback' => 'ss_menu_location_menu_view',
'page arguments' => array(1, 3, 4),
'access arguments' => array('access content'),
'type' => MENU_SUGGESTED_ITEM,
);
return $items;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment