Commit 76e709e9 authored by Dave Reid's avatar Dave Reid

by Dave Reid: Renamed xmlsitemap_save_link() to xmlsitemap_link_save() for consistency.

parent bc2ff6e7
......@@ -423,7 +423,7 @@ function xmlsitemap_settings_form_validate($form, &$form_state) {
*/
function xmlsitemap_settings_form_submit($form, $form_state) {
// Save any changes to the frontpage link.
xmlsitemap_save_link(array('type' => 'frontpage', 'id' => 0, 'loc' => ''));
xmlsitemap_link_save(array('type' => 'frontpage', 'id' => 0, 'loc' => ''));
}
/**
......
......@@ -618,7 +618,7 @@ function xmlsitemap_link_load_multiple(array $conditions = array()) {
* @param $link
* An array with a sitemap link.
*/
function xmlsitemap_save_link(array $link) {
function xmlsitemap_link_save(array $link) {
$link += array(
'access' => 1,
'status' => 1,
......
......@@ -168,7 +168,7 @@ class XMLSitemapTestHelper extends DrupalWebTestCase {
$link += array('loc' => $link['type'] . '-' . $link['id']);
$last_id = max($last_id, $link['id']) + 1;
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
return $link;
}
......@@ -459,51 +459,51 @@ class XMLSitemapUnitTest extends XMLSitemapTestHelper {
//}
/**
* Tests for xmlsitemap_save_link().
* Tests for xmlsitemap_link_save().
*/
function testSaveLink() {
$link = array('type' => 'testing', 'id' => 1, 'loc' => 'testing', 'status' => 1);
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
$this->assertFlag('regenerate_needed', TRUE);
$link['status'] = 0;
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
$this->assertFlag('regenerate_needed', TRUE);
$link['priority'] = 0.5;
$link['loc'] = 'new_location';
$link['status'] = 1;
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
$this->assertFlag('regenerate_needed', TRUE);
$link['priority'] = 0.0;
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
$this->assertFlag('regenerate_needed', TRUE);
$link['priority'] = 0.1;
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
$this->assertFlag('regenerate_needed', TRUE);
$link['priority'] = 1.0;
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
$this->assertFlag('regenerate_needed', TRUE);
$link['priority'] = 1;
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
$this->assertFlag('regenerate_needed', FALSE);
$link['priority'] = 0;
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
$this->assertFlag('regenerate_needed', TRUE);
$link['priority'] = 0.5;
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
$this->assertFlag('regenerate_needed', TRUE);
$link['priority'] = 0.5;
$link['priority_override'] = 0;
$link['status'] = 1;
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
$this->assertFlag('regenerate_needed', FALSE);
}
......
......@@ -169,7 +169,7 @@ function xmlsitemap_custom_edit_link_form_validate($form, &$form_state) {
function xmlsitemap_custom_edit_link_form_submit($form, &$form_state) {
$link = $form_state['values'];
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
drupal_set_message(t('The custom link for %loc was saved.', array('%loc' => $link['loc'])));
$form_state['redirect'] = 'admin/config/search/xmlsitemap/custom';
}
......
......@@ -67,7 +67,7 @@ function xmlsitemap_menu_xmlsitemap_process_menu_links(array $mlids) {
foreach ($mlids as $mlid) {
$menu_item = menu_link_load($mlid);
$link = xmlsitemap_menu_create_link($menu_item);
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
}
// Set the global user variable back to the original user.
......
......@@ -41,7 +41,7 @@ function xmlsitemap_node_xmlsitemap_process_node_links(array $nids) {
$nodes = node_load_multiple($nids);
foreach ($nodes as $node) {
$link = xmlsitemap_node_create_link($node);
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
}
}
......@@ -57,7 +57,7 @@ function xmlsitemap_node_node_insert($node) {
*/
function xmlsitemap_node_node_update($node) {
$link = xmlsitemap_node_create_link($node);
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
}
/**
......
......@@ -56,7 +56,7 @@ function xmlsitemap_taxonomy_xmlsitemap_process_taxonomy_term_links(array $tids)
$terms = taxonomy_term_load_multiple($tids);
foreach ($terms as $term) {
$link = xmlsitemap_taxonomy_create_link($term);
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
}
}
......@@ -117,7 +117,7 @@ function xmlsitemap_taxonomy_vocabulary_delete(stdClass $vocabulary) {
*/
function xmlsitemap_taxonomy_term_insert(stdClass $term) {
$link = xmlsitemap_taxonomy_create_link($term);
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
}
/**
......@@ -125,7 +125,7 @@ function xmlsitemap_taxonomy_term_insert(stdClass $term) {
*/
function xmlsitemap_taxonomy_term_update(stdClass $term) {
$link = xmlsitemap_taxonomy_create_link($term);
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
}
/**
......
......@@ -38,7 +38,7 @@ function xmlsitemap_user_xmlsitemap_process_user_links(array $uids) {
$accounts = user_load_multiple($uids);
foreach ($accounts as $account) {
$link = xmlsitemap_user_create_link($account);
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
}
}
......@@ -51,7 +51,7 @@ function xmlsitemap_user_user_presave(&$edit, $account, $category) {
$link = $edit['xmlsitemap'] + $link;
unset($edit['xmlsitemap']);
}
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
}
/**
......@@ -59,7 +59,7 @@ function xmlsitemap_user_user_presave(&$edit, $account, $category) {
*/
function xmlsitemap_user_user_insert(&$edit, $account, $category) {
$link = xmlsitemap_user_create_link($account);
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
}
/**
......@@ -67,7 +67,7 @@ function xmlsitemap_user_user_insert(&$edit, $account, $category) {
*/
function xmlsitemap_user_user_update(&$edit, $account, $category) {
$link = xmlsitemap_user_create_link($account);
xmlsitemap_save_link($link);
xmlsitemap_link_save($link);
}
/**
......
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