function shortcut_install
shortcut_install()
Implements hook_install().
File
- modules/shortcut/shortcut.install, line 11
- Install, update and uninstall functions for the shortcut module.
Code
function shortcut_install() { $t = get_t(); // Create an initial default shortcut set. $shortcut_set = new stdClass(); $shortcut_set->title = $t('Default'); $shortcut_set->links = array( array( 'link_path' => 'node/add', 'link_title' => $t('Add content'), 'weight' => -20, ), array( 'link_path' => 'admin/content', 'link_title' => $t('Find content'), 'weight' => -19, ), ); // If Drupal is being installed, rebuild the menu before saving the shortcut // set, to make sure the links defined above can be correctly saved. (During // installation, the menu might not have been built at all yet, or it might // have been built but without the node module's links in it.) if (drupal_installation_attempted()) { menu_rebuild(); } shortcut_set_save($shortcut_set); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!shortcut!shortcut.install/function/shortcut_install/7.x