- Patch #637702 by jhodgdon, David_Rothstein: get rid of Administration Shortcuts menu. Left-over code.
parent
65163fc48e
commit
b8eb08d514
|
@ -1,56 +0,0 @@
|
|||
<?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++;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue