Skip to content
Snippets Groups Projects
Commit b8eb08d5 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #637702 by jhodgdon, David_Rothstein: get rid of Administration...

- Patch #637702 by jhodgdon, David_Rothstein: get rid of Administration Shortcuts menu. Left-over code.
parent 65163fc4
No related branches found
No related tags found
No related merge requests found
<?php
// $Id$
/**
* @file
* Installation functions for admin toolbar.
*/
/**
* Implementation of hook_install().
*
* @todo
* Implement role based shortcut bars.
*/
function toolbar_install() {
$t = get_t();
$menu = array(
'menu_name' => 'admin_shortcuts',
'title' => $t('Administration shortcuts'),
'description' => $t('The <em>Administration shortcuts</em> menu contains commonly used links for administrative tasks.'),
);
menu_save($menu);
// Add starter convenience shortcuts.
menu_rebuild();
$items = array(
'node/add' => 'Add content',
'admin/content' => 'Find content',
'admin/dashboard' => 'Dashboard',
);
$weight = -20;
foreach ($items as $path => $title) {
$link = array(
'mlid' => 0,
'link_title' => $title,
'link_path' => $path,
'router_path' => $path,
'menu_name' => 'admin_shortcuts',
'module' => 'menu',
'weight' => $weight,
);
// Check for an existing menu item before attempting to create a new one.
$menu_link = db_query("SELECT mlid FROM {menu_links} WHERE link_path = :path AND menu_name = :menu_name", array(
':path' => $link['link_path'],
':menu_name' => $link['menu_name']
))
->fetchField();
if (!$menu_link) {
menu_link_save($link);
}
// Increment weight so items can be displayed in desired order.
$weight++;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment