Commit 600d503e authored by Dave Reid's avatar Dave Reid
Browse files

by Dave Reid: Removed obsolete xmlsitemap_menu_menu_link_load().

parent f54ee273
...@@ -22,7 +22,7 @@ function xmlsitemap_menu_xmlsitemap_index_links($limit) { ...@@ -22,7 +22,7 @@ function xmlsitemap_menu_xmlsitemap_index_links($limit) {
$mlids = db_query_range($sql, 0, $limit, array(':menus' => $menus)); $mlids = db_query_range($sql, 0, $limit, array(':menus' => $menus));
foreach ($mlids as $mlid) { foreach ($mlids as $mlid) {
$menu_item = xmlsitemap_menu_menu_link_load($mlid); $menu_item = menu_link_load($mlid);
$link = xmlsitemap_menu_create_link($menu_item); $link = xmlsitemap_menu_create_link($menu_item);
xmlsitemap_save_link($link); xmlsitemap_save_link($link);
} }
...@@ -47,7 +47,7 @@ function xmlsitemap_menu_xmlsitemap_links($offset = 0, $limit = 0) { ...@@ -47,7 +47,7 @@ function xmlsitemap_menu_xmlsitemap_links($offset = 0, $limit = 0) {
$mlids = ($limit ? db_query_range($sql, 0, $limit, $args) : db_query($sql, $args)); $mlids = ($limit ? db_query_range($sql, 0, $limit, $args) : db_query($sql, $args));
foreach ($mlids as $mlid) { foreach ($mlids as $mlid) {
$menu_item = xmlsitemap_menu_menu_link_load($mlid); $menu_item = menu_link_load($mlid);
$links[] = xmlsitemap_menu_create_link($menu_item); $links[] = xmlsitemap_menu_create_link($menu_item);
} }
...@@ -83,17 +83,6 @@ function xmlsitemap_menu_xmlsitemap_link_info() { ...@@ -83,17 +83,6 @@ function xmlsitemap_menu_xmlsitemap_link_info() {
); );
} }
/**
* Load a menu link and its associated sitemap link data.
*/
function xmlsitemap_menu_menu_link_load($mlid) {
$menu_item = menu_link_load($mlid);
if ($data = xmlsitemap_link_load('menu', $mlid)) {
$menu_item['xmlsitemap'] = $data;
}
return $menu_item;
}
/** /**
* Implements hook_form_FORM_ID_alter(). * Implements hook_form_FORM_ID_alter().
* *
...@@ -234,7 +223,7 @@ function xmlsitemap_menu_form_menu_edit_item_alter(&$form, $form_state) { ...@@ -234,7 +223,7 @@ function xmlsitemap_menu_form_menu_edit_item_alter(&$form, $form_state) {
*/ */
function xmlsitemap_menu_menu_edit_item_submit($form, $form_state) { function xmlsitemap_menu_menu_edit_item_submit($form, $form_state) {
xmlsitemap_switch_user(0); xmlsitemap_switch_user(0);
$menu_item = xmlsitemap_menu_menu_link_load($form_state['values']['menu']['mlid']); $menu_item = menu_link_load($form_state['values']['menu']['mlid']);
xmlsitemap_restore_user(); xmlsitemap_restore_user();
xmlsitemap_menu_item_update($menu_item); xmlsitemap_menu_item_update($menu_item);
} }
...@@ -270,6 +259,9 @@ function xmlsitemap_menu_get_menus() { ...@@ -270,6 +259,9 @@ function xmlsitemap_menu_get_menus() {
function xmlsitemap_menu_create_link(array $menu_item) { function xmlsitemap_menu_create_link(array $menu_item) {
if (!isset($menu_item['xmlsitemap'])) { if (!isset($menu_item['xmlsitemap'])) {
$menu_item['xmlsitemap'] = array(); $menu_item['xmlsitemap'] = array();
if ($menu_item['mlid'] && $link = xmlsitemap_load_link('menu', $menu_item['mlid'])) {
$menu_item['xmlsitemap'] = $link;
}
} }
$menu_item['xmlsitemap'] += array( $menu_item['xmlsitemap'] += array(
......
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