Commit e369cae4 authored by Dave Reid's avatar Dave Reid

by Dave Reid: Synchronize code with D6.

parent 14dd88ce
......@@ -794,7 +794,7 @@ function _xmlsitemap_delete_recursive($path, $delete_root = FALSE) {
file_unmanaged_delete_recursive($entry_path, TRUE);
}
$dir->close();
return $delete_root ? rmdir($path) : TRUE;
return $delete_root ? drupal_rmdir($path) : TRUE;
}
return file_unmanaged_delete($path);
}
......@@ -908,25 +908,6 @@ function xmlsitemap_get_link_type_indexed_status($entity_type, $bundle = '') {
return $status;
}
/**
* Implements hook_query_TAG_alter().
*/
function xmlsitemap_query_xmlsitemap_link_bundle_access_alter(QueryAlterableInterface $query) {
if ($entity = $query->getMetaData('entity_info')) {
$bundle = $query->getMetaData('bundle');
if (empty($bundle)) {
$bundle = xmlsitemap_get_link_type_enabled_bundles($entity);
}
if (!empty($info['bundle keys']['bundle'])) {
$query->condition($info['bundle keys']['bundle'], $bundle);
}
if (!empty($info['entity keys']['bundle'])) {
$query->condition($info['entity keys']['bundle'], $bundles);
}
}
}
function xmlsitemap_link_bundle_settings_save($entity, $bundle, array $settings, $update_links = TRUE) {
if ($update_links) {
$old_settings = xmlsitemap_link_bundle_load($entity, $bundle);
......@@ -1414,3 +1395,22 @@ function xmlsitemap_get_operation_link($url, $options = array()) {
drupal_alter('xmlsitemap_operation_link', $link);
return $link;
}
/**
* Implements hook_query_TAG_alter().
*/
function xmlsitemap_query_xmlsitemap_link_bundle_access_alter(QueryAlterableInterface $query) {
if ($entity = $query->getMetaData('entity_info')) {
$bundle = $query->getMetaData('bundle');
if (empty($bundle)) {
$bundle = xmlsitemap_get_link_type_enabled_bundles($entity);
}
if (!empty($info['bundle keys']['bundle'])) {
$query->condition($info['bundle keys']['bundle'], $bundle);
}
if (!empty($info['entity keys']['bundle'])) {
$query->condition($info['entity keys']['bundle'], $bundles);
}
}
}
......@@ -109,7 +109,7 @@ function xmlsitemap_file_transfer($uri, $headers) {
}
drupal_send_headers();
$scheme = $scheme = variable_get('file_default_scheme', 'public');
$scheme = variable_get('file_default_scheme', 'public');
// Transfer file in 16 KB chunks to save memory usage.
if ($scheme && file_stream_wrapper_valid_scheme($scheme) && $fd = fopen($uri, 'rb')) {
while (!feof($fd)) {
......
......@@ -153,7 +153,7 @@ function xmlsitemap_node_form_node_type_form_alter(array &$form, array $form_sta
*
* @see xmlsitemap_add_form_link_options()
*/
function xmlsitemap_node_form_alter(array &$form, array $form_state, $form_id) {
function xmlsitemap_node_form_alter(array &$form, array &$form_state, $form_id) {
if (!empty($form['#node_edit_form'])) {
// Add the link options.
module_load_include('inc', 'xmlsitemap', 'xmlsitemap.admin');
......
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