Commit ee9f7ed7 authored by Dave Reid's avatar Dave Reid

Issue #1176526: Fixed hook_field_extra_fields() integration for node and...

Issue #1176526: Fixed hook_field_extra_fields() integration for node and taxonomy terms entities, as well as added integration for user entities.
parent f731b47d
......@@ -101,12 +101,8 @@ function xmlsitemap_node_comment_delete(stdClass $comment) {
*/
function xmlsitemap_node_field_extra_fields() {
$extras = array();
$bundles = xmlsitemap_get_link_type_enabled_bundles('node');
foreach (node_type_get_names() as $type => $name) {
if (!in_array($type, $bundles)) {
continue;
}
$extras['node'][$type]['xmlsitemap'] = array(
$extras['node'][$type]['form']['xmlsitemap'] = array(
'label' => t('XML sitemap'),
'description' => t('XML sitemap module element'),
'weight' => 30,
......
......@@ -130,12 +130,8 @@ function xmlsitemap_taxonomy_term_delete(stdClass $term) {
*/
function xmlsitemap_taxonomy_field_extra_fields() {
$extras = array();
$bundles = xmlsitemap_get_link_type_enabled_bundles('taxonomy_term');
foreach (taxonomy_vocabulary_get_names() as $machine_name => $vocabulary) {
if (!in_array($vocabulary->machine_name, $bundles)) {
continue;
}
$extras['taxonomy_term'][$machine_name]['xmlsitemap'] = array(
$extras['taxonomy_term'][$machine_name]['form']['xmlsitemap'] = array(
'label' => t('XML sitemap'),
'description' => t('XML sitemap module element'),
'weight' => 30,
......
......@@ -78,6 +78,18 @@ function xmlsitemap_user_user_delete($account) {
xmlsitemap_link_delete('user', $account->uid);
}
/**
* Implements hook_field_extra_fields().
*/
function xmlsitemap_user_field_extra_fields() {
$extras['user']['user']['form']['xmlsitemap'] = array(
'label' => t('XML sitemap'),
'description' => t('XML sitemap module element'),
'weight' => 30,
);
return $extras;
}
/**
* Implements hook_form_FORM_ID_alter().
*
......
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