Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function productmenu_menu() {
- global $base_url;
- $top_level = array('Color Printers','Black & White Printers','Color MFP','Black & White MFP','Wide Format','Fax Machines');
- $items['productmenu/products'] = array(
- 'title' => 'New Products',
- 'access callback' => TRUE,
- // 'menu_name' => 'Test Menu',
- 'expanded' => TRUE,
- 'page callback' => '_productmenu_menu_page',
- 'page arguments' => array('Top Level'),
- 'type' => MENU_NORMAL_ITEM,
- );
- $id = 10000;
- foreach ($top_level as $cat) {
- $items["productmenu/products/" . urlencode($cat)] = array(
- 'title' => $cat,
- 'page callback' => '_productmenu_menu_page',
- 'page arguments' => array(url("$base_url/productscategory/$id")),
- 'access callback' => TRUE,
- 'expanded' => TRUE,
- );
- $id++;
- }
- dpm($items);
- // file_put_contents('/tmp/drupal.debug',print_r($items,true));
- return $items;
- }
- function _productmenu_menu_page($arg1 = NULL, $arg2 = NULL) {
- $output = '';
- if ($arg1 != '') {
- $output = "location: $arg1";
- }
- return $output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement