Commit ced08bf2 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#166586 by hswong3i: move literal values out of menu module queries (for...

#166586 by hswong3i: move literal values out of menu module queries (for better db compatibility, ie. easier query rewriting)
parent 85509811
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
function menu_install() { function menu_install() {
// Create tables. // Create tables.
drupal_install_schema('menu'); drupal_install_schema('menu');
db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('navigation', 'Navigation', 'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.')"); db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'navigation', 'Navigation', 'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.');
db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('primary-links', 'Primary links', 'Primary links are often used at the theme layer to show the major sections of a site. A typical representation for primary links would be tabs along the top.')"); db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'primary-links', 'Primary links', 'Primary links are often used at the theme layer to show the major sections of a site. A typical representation for primary links would be tabs along the top.');
db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('secondary-links', 'Secondary links', 'Secondary links are often used for pages like legal notices, contact details, and other secondary navigation items that play a lesser role than primary links')"); db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'secondary-links', 'Secondary links', 'Secondary links are often used for pages like legal notices, contact details, and other secondary navigation items that play a lesser role than primary links');
} }
/** /**
......
...@@ -131,7 +131,7 @@ function menu_enable() { ...@@ -131,7 +131,7 @@ function menu_enable() {
menu_rebuild(); menu_rebuild();
$result = db_query("SELECT * FROM {menu_custom}"); $result = db_query("SELECT * FROM {menu_custom}");
$link['module'] = 'menu'; $link['module'] = 'menu';
$link['plid'] = db_result(db_query("SELECT mlid from {menu_links} WHERE menu_name = 'navigation' AND link_path = 'admin/build/menu'")); $link['plid'] = db_result(db_query("SELECT mlid FROM {menu_links} WHERE menu_name = '%s' AND link_path = '%s'", 'navigation', 'admin/build/menu'));
$link['router_path'] = 'admin/build/menu-customize/%'; $link['router_path'] = 'admin/build/menu-customize/%';
while ($menu = db_fetch_array($result)) { while ($menu = db_fetch_array($result)) {
...@@ -582,7 +582,7 @@ function menu_edit_menu_submit($form, &$form_state) { ...@@ -582,7 +582,7 @@ function menu_edit_menu_submit($form, &$form_state) {
$link['link_path'] = $path . $menu['menu_name']; $link['link_path'] = $path . $menu['menu_name'];
$link['router_path'] = $path .'%'; $link['router_path'] = $path .'%';
$link['module'] = 'menu'; $link['module'] = 'menu';
$link['plid'] = db_result(db_query("SELECT mlid from {menu_links} WHERE menu_name = 'navigation' AND link_path = 'admin/build/menu'")); $link['plid'] = db_result(db_query("SELECT mlid FROM {menu_links} WHERE menu_name = '%s' AND link_path = '%s'", 'navigation', 'admin/build/menu'));
menu_link_save($link); menu_link_save($link);
db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", $menu['menu_name'], $menu['title'], $menu['description']); db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", $menu['menu_name'], $menu['title'], $menu['description']);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment