Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
simple_sitemap
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
simple_sitemap
Commits
3002bf4a
Commit
3002bf4a
authored
Nov 17, 2018
by
gbyte
Committed by
Pawel G
Nov 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#3012860
by gbyte.co: Review state of hooks for 3.x
parent
1119396a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 addition
and
56 deletions
+1
-56
simple_sitemap.api.php
simple_sitemap.api.php
+0
-24
src/Form/SimplesitemapSettingsForm.php
src/Form/SimplesitemapSettingsForm.php
+1
-1
src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php
...itemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php
+0
-15
src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php
...Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php
+0
-15
src/Queue/QueueWorker.php
src/Queue/QueueWorker.php
+0
-1
No files found.
simple_sitemap.api.php
View file @
3002bf4a
...
@@ -18,8 +18,6 @@
...
@@ -18,8 +18,6 @@
* Array containing multilingual links generated for each path to be indexed
* Array containing multilingual links generated for each path to be indexed
*
*
* @param string|null $sitemap_variant
* @param string|null $sitemap_variant
*
* @todo Make work for sitemap types.
*/
*/
function
hook_simple_sitemap_links_alter
(
array
&
$links
,
$sitemap_variant
)
{
function
hook_simple_sitemap_links_alter
(
array
&
$links
,
$sitemap_variant
)
{
...
@@ -139,28 +137,6 @@ function hook_simple_sitemap_sitemap_types_alter(array &$sitemap_types) {
...
@@ -139,28 +137,6 @@ function hook_simple_sitemap_sitemap_types_alter(array &$sitemap_types) {
}
}
/**
* @param array $variants
*/
function
hook_simple_sitemap_variants_alter
(
array
&
$variants
)
{
// Add a new sitemap variant of the 'fight_club_sitemap_type' type.
$variants
[
'fight_club'
]
=
[
'type'
=>
'fight_club_sitemap_type'
,
'label'
=>
t
(
'Fight Club'
),
];
}
/**
* @param array $bundle_settings
* @param array $bundle_context
* @param string|null $sitemap_variant
*/
function
hook_simple_sitemap_bundle_settings_alter
(
array
&
$bundle_settings
,
$bundle_context
,
$sitemap_variant
)
{
}
/**
/**
* @} End of "addtogroup hooks".
* @} End of "addtogroup hooks".
*/
*/
src/Form/SimplesitemapSettingsForm.php
View file @
3002bf4a
...
@@ -115,7 +115,7 @@ class SimplesitemapSettingsForm extends SimplesitemapFormBase {
...
@@ -115,7 +115,7 @@ class SimplesitemapSettingsForm extends SimplesitemapFormBase {
$row
[
'status'
][
'data'
][
'#markup'
]
=
$this
->
t
(
'<a href="@url" target="_blank">published</a>'
,
[
'@url'
=>
$url
]);
$row
[
'status'
][
'data'
][
'#markup'
]
=
$this
->
t
(
'<a href="@url" target="_blank">published</a>'
,
[
'@url'
=>
$url
]);
break
;
break
;
case
2
:
case
2
:
$row
[
'status'
]
=
$this
->
t
(
'<a href="@url" target="_blank">published</a>
|
regenerating'
,
[
'@url'
=>
$url
]);
$row
[
'status'
]
=
$this
->
t
(
'<a href="@url" target="_blank">published</a>
,
regenerating'
,
[
'@url'
=>
$url
]);
break
;
break
;
}
}
}
}
...
...
src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php
View file @
3002bf4a
...
@@ -110,21 +110,6 @@ class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase {
...
@@ -110,21 +110,6 @@ class EntityMenuLinkContentUrlGenerator extends UrlGeneratorBase {
->
getBundleSettings
();
->
getBundleSettings
();
if
(
!
empty
(
$bundle_settings
[
'menu_link_content'
]))
{
if
(
!
empty
(
$bundle_settings
[
'menu_link_content'
]))
{
foreach
(
$bundle_settings
[
'menu_link_content'
]
as
$bundle_name
=>
$bundle_settings
)
{
foreach
(
$bundle_settings
[
'menu_link_content'
]
as
$bundle_name
=>
$bundle_settings
)
{
// Skip this bundle if it is to be generated in a different sitemap variant.
if
(
NULL
!==
$this
->
sitemapVariant
&&
isset
(
$bundle_settings
[
'variant'
])
&&
$bundle_settings
[
'variant'
]
!==
$this
->
sitemapVariant
)
{
$bundle_settings
[
'index'
]
=
FALSE
;
}
unset
(
$bundle_settings
[
'variant'
]);
$bundle_context
=
[
'entity_type_id'
=>
'menu_link_content'
,
'bundle_name'
=>
$bundle_name
,
];
$sitemap_variant
=
$this
->
sitemapVariant
;
$this
->
moduleHandler
->
alter
(
'simple_sitemap_bundle_settings'
,
$bundle_settings
,
$bundle_context
,
$sitemap_variant
);
if
(
!
empty
(
$bundle_settings
[
'index'
]))
{
if
(
!
empty
(
$bundle_settings
[
'index'
]))
{
// Retrieve the expanded tree.
// Retrieve the expanded tree.
...
...
src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php
View file @
3002bf4a
...
@@ -115,21 +115,6 @@ class EntityUrlGenerator extends UrlGeneratorBase {
...
@@ -115,21 +115,6 @@ class EntityUrlGenerator extends UrlGeneratorBase {
$keys
=
$sitemap_entity_types
[
$entity_type_name
]
->
getKeys
();
$keys
=
$sitemap_entity_types
[
$entity_type_name
]
->
getKeys
();
foreach
(
$bundles
as
$bundle_name
=>
$bundle_settings
)
{
foreach
(
$bundles
as
$bundle_name
=>
$bundle_settings
)
{
// Skip this bundle if it is to be generated in a different sitemap variant.
if
(
NULL
!==
$this
->
sitemapVariant
&&
isset
(
$bundle_settings
[
'variant'
])
&&
$bundle_settings
[
'variant'
]
!==
$this
->
sitemapVariant
)
{
$bundle_settings
[
'index'
]
=
FALSE
;
}
unset
(
$bundle_settings
[
'variant'
]);
$bundle_context
=
[
'entity_type_id'
=>
$entity_type_name
,
'bundle_name'
=>
$bundle_name
,
];
$sitemap_variant
=
$this
->
sitemapVariant
;
$this
->
moduleHandler
->
alter
(
'simple_sitemap_bundle_settings'
,
$bundle_settings
,
$bundle_context
,
$sitemap_variant
);
if
(
!
empty
(
$bundle_settings
[
'index'
]))
{
if
(
!
empty
(
$bundle_settings
[
'index'
]))
{
$query
=
$entityTypeStorage
->
getQuery
();
$query
=
$entityTypeStorage
->
getQuery
();
...
...
src/Queue/QueueWorker.php
View file @
3002bf4a
...
@@ -138,7 +138,6 @@ class QueueWorker {
...
@@ -138,7 +138,6 @@ class QueueWorker {
public
function
rebuildQueue
(
$variants
=
NULL
)
{
public
function
rebuildQueue
(
$variants
=
NULL
)
{
$all_data_sets
=
[];
$all_data_sets
=
[];
$sitemap_variants
=
$this
->
manager
->
getSitemapVariants
();
$sitemap_variants
=
$this
->
manager
->
getSitemapVariants
();
$this
->
moduleHandler
->
alter
(
'simple_sitemap_variants'
,
$sitemap_variants
);
$type_definitions
=
$this
->
manager
->
getSitemapTypes
();
$type_definitions
=
$this
->
manager
->
getSitemapTypes
();
$this
->
deleteQueue
();
$this
->
deleteQueue
();
...
...
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