diff --git a/xmlsitemap.admin.inc b/xmlsitemap.admin.inc index bb05b44..9015c28 100644 --- a/xmlsitemap.admin.inc +++ b/xmlsitemap.admin.inc @@ -499,6 +499,7 @@ function xmlsitemap_add_form_entity_summary(&$form, $entity, array $entity_info) $priorities = xmlsitemap_get_priority_options(NULL, FALSE); $statuses = xmlsitemap_get_status_options(NULL); $destination = drupal_get_destination(); + $changefreqs = xmlsitemap_get_changefreq_options(); $rows = array(); $totals = array('total' => 0, 'indexed' => 0, 'visible' => 0); @@ -520,6 +521,7 @@ function xmlsitemap_add_form_entity_summary(&$form, $entity, array $entity_info) } $row[] = $statuses[$bundle_info['xmlsitemap']['status'] ? 1 : 0]; $row[] = $priorities[number_format($bundle_info['xmlsitemap']['priority'], 1)]; + $row[] = $changefreqs[$bundle_info['xmlsitemap']['changefreq']]; $row[] = $status['total']; $row[] = $status['indexed']; $row[] = $status['visible']; @@ -531,6 +533,7 @@ function xmlsitemap_add_form_entity_summary(&$form, $entity, array $entity_info) isset($entity_info['bundle label']) ? $entity_info['bundle label'] : '', t('Inclusion'), t('Priority'), + t('Change frequency'), t('Available'), t('Indexed'), t('Visible'), @@ -538,7 +541,7 @@ function xmlsitemap_add_form_entity_summary(&$form, $entity, array $entity_info) $rows[] = array( array( 'data' => t('Totals'), - 'colspan' => 3, + 'colspan' => 4, 'header' => TRUE, ), array( diff --git a/xmlsitemap_node/xmlsitemap_node.module b/xmlsitemap_node/xmlsitemap_node.module index 5464073..f30dd7d 100644 --- a/xmlsitemap_node/xmlsitemap_node.module +++ b/xmlsitemap_node/xmlsitemap_node.module @@ -112,6 +112,24 @@ function xmlsitemap_node_field_extra_fields() { } /** + * Implements hook_xmlsitemap_element_alter(). + */ +function xmlsitemap_node_xmlsitemap_element_alter(array &$element, array $link, $sitemap) { + if ($link['type'] == 'node') { + if ($link['changefreq_override']) { + $element['changefreq'] = xmlsitemap_get_changefreq($link['changefreq']); + } + else { + module_load_include('inc', 'xmlsitemap', 'xmlsitemap.admin'); + $settings = xmlsitemap_link_bundle_load('node', $link['subtype']); + $changefreqs = xmlsitemap_get_changefreq_options(); + + $element['changefreq'] = drupal_strtolower($changefreqs[$settings['changefreq']]); + } + } +} + +/** * Implements hook_form_FORM_ID_alter(). * * @see node_type_form()