Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
xmlsitemap
Commits
c830cbd4
Commit
c830cbd4
authored
Mar 28, 2010
by
Dave Reid
Browse files
by Dave Reid: Updated for 'object keys' renamed to 'entity keys'.
parent
d9e2608b
Changes
7
Hide whitespace changes
Inline
Side-by-side
xmlsitemap.admin.inc
View file @
c830cbd4
...
...
@@ -393,7 +393,7 @@ function xmlsitemap_rebuild_form() {
// If the entity is missing a rebuild callback, skip.
continue
;
}
if
(
!
empty
(
$info
[
'
object
keys'
][
'bundle'
])
&&
!
xmlsitemap_get_link_type_enabled_bundles
(
$entity
))
{
if
(
!
empty
(
$info
[
'
entity
keys'
][
'bundle'
])
&&
!
xmlsitemap_get_link_type_enabled_bundles
(
$entity
))
{
// If the entity has bundles, but no enabled bundles, skip since
// rebuilding wouldn't get any links.
continue
;
...
...
xmlsitemap.api.php
View file @
c830cbd4
...
...
@@ -24,7 +24,7 @@ function hook_xmlsitemap_link_info() {
'mymodule'
=>
array
(
'label'
=>
'My module'
,
'base table'
=>
'mymodule'
,
'
object
keys'
=>
array
(
'
entity
keys'
=>
array
(
// Primary ID key on {base table}
'id'
=>
'myid'
,
// Subtype key on {base table}
...
...
xmlsitemap.drush.inc
View file @
c830cbd4
...
...
@@ -65,7 +65,7 @@ function drush_xmlsitemap_rebuild() {
// If the entity is missing a rebuild callback, skip.
continue
;
}
if
(
!
empty
(
$info
[
'
object
keys'
][
'bundle'
])
&&
!
xmlsitemap_get_link_type_enabled_bundles
(
$entity
))
{
if
(
!
empty
(
$info
[
'
entity
keys'
][
'bundle'
])
&&
!
xmlsitemap_get_link_type_enabled_bundles
(
$entity
))
{
// If the entity has bundles, but no enabled bundles, skip since
// rebuilding wouldn't get any links.
continue
;
...
...
xmlsitemap.generate.inc
View file @
c830cbd4
...
...
@@ -448,11 +448,11 @@ function xmlsitemap_rebuild_batch_fetch($entity, &$context) {
$info
=
$context
[
'sandbox'
][
'info'
];
$query
=
db_select
(
$info
[
'base table'
]);
$query
->
addField
(
$info
[
'base table'
],
$info
[
'
object
keys'
][
'id'
]);
$query
->
condition
(
$info
[
'
object
keys'
][
'id'
],
$context
[
'sandbox'
][
'last_id'
],
'>'
);
if
(
!
empty
(
$info
[
'
object
keys'
][
'bundle'
]))
{
$query
->
addField
(
$info
[
'base table'
],
$info
[
'
entity
keys'
][
'id'
]);
$query
->
condition
(
$info
[
'
entity
keys'
][
'id'
],
$context
[
'sandbox'
][
'last_id'
],
'>'
);
if
(
!
empty
(
$info
[
'
entity
keys'
][
'bundle'
]))
{
$bundles
=
xmlsitemap_get_link_type_enabled_bundles
(
$entity
);
$query
->
condition
(
$info
[
'
object
keys'
][
'bundle'
],
$bundles
);
$query
->
condition
(
$info
[
'
entity
keys'
][
'bundle'
],
$bundles
);
}
$query
->
addTag
(
'xmlsitemap_rebuild'
);
$query
->
addMetaData
(
'entity'
,
$entity
);
...
...
@@ -467,7 +467,7 @@ function xmlsitemap_rebuild_batch_fetch($entity, &$context) {
}
// PostgreSQL cannot have the ORDERED BY in the count query.
$query
->
orderBy
(
$info
[
'
object
keys'
][
'id'
]);
$query
->
orderBy
(
$info
[
'
entity
keys'
][
'id'
]);
$query
->
range
(
0
,
variable_get
(
'xmlsitemap_batch_limit'
,
100
));
...
...
xmlsitemap.module
View file @
c830cbd4
...
...
@@ -821,7 +821,7 @@ function xmlsitemap_get_link_info($type = NULL, $reset = FALSE) {
'bundles'
=>
array
(),
'xmlsitemap'
=>
array
(),
);
if
(
!
isset
(
$info
[
'xmlsitemap'
][
'rebuild callback'
])
&&
!
empty
(
$info
[
'base table'
])
&&
!
empty
(
$info
[
'
object
keys'
][
'id'
])
&&
!
empty
(
$info
[
'xmlsitemap'
][
'process callback'
]))
{
if
(
!
isset
(
$info
[
'xmlsitemap'
][
'rebuild callback'
])
&&
!
empty
(
$info
[
'base table'
])
&&
!
empty
(
$info
[
'
entity
keys'
][
'id'
])
&&
!
empty
(
$info
[
'xmlsitemap'
][
'process callback'
]))
{
$info
[
'xmlsitemap'
][
'rebuild callback'
]
=
'xmlsitemap_rebuild_batch_fetch'
;
}
foreach
(
$info
[
'bundles'
]
as
$bundle
=>
&
$bundle_info
)
{
...
...
@@ -954,10 +954,10 @@ function xmlsitemap_get_link_type_indexed_status($entity_type, $bundle = '') {
$status
[
'visible'
]
=
$visible
->
countQuery
()
->
execute
()
->
fetchField
();
$total
=
db_select
(
$info
[
'base table'
]);
$total
->
addField
(
'xmlsitemap'
,
$info
[
'
object
keys'
][
'id'
]);
$total
->
condition
(
$info
[
'
object
keys'
][
'id'
],
0
,
'>'
);
if
(
!
empty
(
$info
[
'
object
keys'
][
'bundle'
]))
{
$total
->
condition
(
$info
[
'
object
keys'
][
'bundle'
],
$bundle
);
$total
->
addField
(
'xmlsitemap'
,
$info
[
'
entity
keys'
][
'id'
]);
$total
->
condition
(
$info
[
'
entity
keys'
][
'id'
],
0
,
'>'
);
if
(
!
empty
(
$info
[
'
entity
keys'
][
'bundle'
]))
{
$total
->
condition
(
$info
[
'
entity
keys'
][
'bundle'
],
$bundle
);
}
$status
[
'total'
]
=
$total
->
countQuery
()
->
execute
()
->
fetchField
();
...
...
xmlsitemap_menu/xmlsitemap_menu.module
View file @
c830cbd4
...
...
@@ -9,7 +9,7 @@ function xmlsitemap_menu_xmlsitemap_link_info() {
'label'
=>
t
(
'Menu'
),
'bundle label'
=>
t
(
'Menu'
),
'base table'
=>
'menu_links'
,
'
object
keys'
=>
array
(
'
entity
keys'
=>
array
(
'id'
=>
'mlid'
,
'bundle'
=>
'menu_name'
,
),
...
...
xmlsitemap_taxonomy/xmlsitemap_taxonomy.module
View file @
c830cbd4
...
...
@@ -16,7 +16,7 @@ function xmlsitemap_taxonomy_entity_info_alter(&$entity_info) {
*/
function
xmlsitemap_taxonomy_xmlsitemap_link_info_alter
(
&
$link_info
)
{
// Change taxonomy term bundle type from machine name to vid.
$link_info
[
'taxonomy_term'
][
'
object
keys'
][
'bundle'
]
=
'vid'
;
$link_info
[
'taxonomy_term'
][
'
entity
keys'
][
'bundle'
]
=
'vid'
;
foreach
(
taxonomy_vocabulary_get_names
()
as
$machine_name
=>
$vocabulary
)
{
// Adjust the edit path to the *real* edit path.
$link_info
[
'taxonomy_term'
][
'bundles'
][
$machine_name
][
'admin'
][
'path'
]
.
=
'/edit'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment