function _opigno_lms_install_menu in Opigno LMS 7
Helper function to enable default menu entries.
1 call to _opigno_lms_install_menu()
- opigno_lms_install in ./
opigno_lms.install - Implements hook_install().
File
- ./
opigno_lms.install, line 190 - Install, update and uninstall functions for the Opigno LMS installation profile.
Code
function _opigno_lms_install_menu() {
// Create a Home link in the main menu.
$item = array(
'link_title' => st('Home'),
'link_path' => '<front>',
'menu_name' => 'main-menu',
'options' => array(
'attributes' => array(
'id' => 'main-navigation-item-home',
),
),
'weight' => -50,
);
menu_link_save($item);
// Create links for the apps.
$item = array(
'link_title' => st('My trainings'),
'link_path' => 'my-trainings',
'menu_name' => 'main-menu',
'options' => array(
'attributes' => array(
'id' => 'main-navigation-item-my-courses',
),
),
'weight' => -45,
);
menu_link_save($item);
$item = array(
'link_title' => st('Training catalogue'),
'link_path' => 'training-catalogue',
'menu_name' => 'main-menu',
'options' => array(
'attributes' => array(
'id' => 'main-navigation-item-training-catalogue',
),
),
'weight' => -40,
);
menu_link_save($item);
$item = array(
'link_title' => st('Forum'),
'link_path' => 'forum',
'menu_name' => 'main-menu',
'options' => array(
'attributes' => array(
'id' => 'main-navigation-item-forum',
),
),
'weight' => -35,
);
menu_link_save($item);
$item = array(
'link_title' => st('Calendar'),
'link_path' => 'opigno-calendar',
'menu_name' => 'main-menu',
'options' => array(
'attributes' => array(
'id' => 'main-navigation-item-calendar',
),
),
'weight' => -30,
);
menu_link_save($item);
$item = array(
'link_title' => st('Messages'),
'link_path' => 'messages',
'menu_name' => 'main-menu',
'options' => array(
'attributes' => array(
'id' => 'main-navigation-item-messages',
),
),
'weight' => -20,
);
menu_link_save($item);
$item = array(
'link_title' => st('My achievements'),
'link_path' => 'my-achievements',
'menu_name' => 'main-menu',
'options' => array(
'attributes' => array(
'id' => 'main-navigation-item-my-achievements',
),
),
'weight' => -10,
);
menu_link_save($item);
// Create a statistic link in the main menu.
$item = array(
'link_title' => st('Statistics'),
'link_path' => 'admin/opigno-statistics',
'menu_name' => 'main-menu',
'options' => array(
'attributes' => array(
'id' => 'main-navigation-item-statistics',
),
),
'weight' => 48,
);
menu_link_save($item);
// Create an administration link in the main menu.
$item = array(
'link_title' => st('Administration'),
'link_path' => 'admin/opigno',
'menu_name' => 'main-menu',
'options' => array(
'attributes' => array(
'id' => 'main-navigation-item-administration',
),
),
'weight' => 50,
);
menu_link_save($item);
// Update the menu router information.
menu_rebuild();
}