Skip to content

Instantly share code, notes, and snippets.

@dhaley
Created February 4, 2013 18:01
Show Gist options
  • Save dhaley/4708360 to your computer and use it in GitHub Desktop.
Save dhaley/4708360 to your computer and use it in GitHub Desktop.
vcr_menu.install
<?php
/**
* @file
* Programmatically create VCR menus. Oh Yeah!
*
* Will create pages, menus and menu items, beans and more.
* More power!
*/
/**
* Implements hook_install().
*/
function vcr_menu_install() {
_vcr_menu_create_menus();
}
/**
* Create custom menus and set secondary menu.
*/
function _vcr_menu_create_menus() {
$menus = array(
array(
'menu_name' => 'secondary-menu',
'title' => 'Secondary Menu',
'description' => '',
),
);
foreach ($menus as $menu) {
menu_save($menu);
}
variable_set('menu_secondary_links_source', 'secondary-menu');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment