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
1
Merge Requests
1
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
9f1a6d3c
Commit
9f1a6d3c
authored
Jan 12, 2020
by
Pawel G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve status display
parent
9f04f3a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
24 deletions
+13
-24
src/Form/SimplesitemapSitemapsForm.php
src/Form/SimplesitemapSitemapsForm.php
+13
-24
No files found.
src/Form/SimplesitemapSitemapsForm.php
View file @
9f1a6d3c
...
...
@@ -153,7 +153,17 @@ class SimplesitemapSitemapsForm extends SimplesitemapFormBase {
];
foreach
(
$variants
as
$variant_name
=>
$variant_definition
)
{
$row
=
[];
$row
[
'name'
][
'data'
][
'#markup'
]
=
'<span title="'
.
$variant_name
.
'">'
.
$this
->
t
(
$variant_definition
[
'label'
])
.
'</span>'
;
switch
(
$sitemap_statuses
[
$variant_name
])
{
case
0
:
$row
[
'name'
][
'data'
][
'#markup'
]
=
'<span title="'
.
$variant_name
.
'">'
.
$this
->
t
(
$variant_definition
[
'label'
])
.
'</span>'
;
break
;
case
1
:
case
2
:
$row
[
'name'
][
'data'
][
'#markup'
]
=
$this
->
t
(
'<a href="@url" target="_blank">@variant</a>'
,
[
'@url'
=>
$sitemap_generator
->
setSitemapVariant
(
$variant_name
)
->
getSitemapUrl
(),
'@variant'
=>
$this
->
t
(
$variant_definition
[
'label'
])]
);
break
;
}
if
(
!
isset
(
$sitemap_statuses
[
$variant_name
]))
{
$row
[
'status'
]
=
$this
->
t
(
'pending'
);
}
...
...
@@ -163,12 +173,11 @@ class SimplesitemapSitemapsForm extends SimplesitemapFormBase {
$row
[
'status'
]
=
$this
->
t
(
'generating'
);
break
;
case
1
:
$row
[
'status'
][
'data'
][
'#markup'
]
=
$this
->
t
(
'<a href="@url" target="_blank">published on @time</a>'
,
[
'@url'
=>
$sitemap_generator
->
setSitemapVariant
(
$variant_name
)
->
getSitemapUrl
(),
'@time'
=>
$this
->
dateFormatter
->
format
(
$published_timestamps
[
$variant_name
])]
$row
[
'status'
]
=
$this
->
t
(
'published on @time'
,
[
'@time'
=>
$this
->
dateFormatter
->
format
(
$published_timestamps
[
$variant_name
])]
);
break
;
case
2
:
$row
[
'status'
]
=
$this
->
t
(
'
<a href="@url" target="_blank">published on @time</a>
, regenerating'
,
$row
[
'status'
]
=
$this
->
t
(
'
published on @time
, regenerating'
,
[
'@url'
=>
$sitemap_generator
->
setSitemapVariant
(
$variant_name
)
->
getSitemapUrl
(),
'@time'
=>
$this
->
dateFormatter
->
format
(
$published_timestamps
[
$variant_name
])]
);
break
;
...
...
@@ -183,26 +192,6 @@ class SimplesitemapSitemapsForm extends SimplesitemapFormBase {
$form
[
'simple_sitemap_settings'
][
'status'
][
'types'
][
'#markup'
]
=
$this
->
t
(
'No variants have been defined'
);
}
/* if (!empty($sitemap_statuses)) {
$form['simple_sitemap_settings']['status']['types']['&orphans'] = [
'#type' => 'details',
'#title' => $this->t('Orphans'),
'#open' => TRUE,
];
$form['simple_sitemap_settings']['status']['types']['&orphans']['table'] = [
'#type' => 'table',
'#header' => [$this->t('Variant'), $this->t('Status'), $this->t('Actions')],
];
foreach ($sitemap_statuses as $orphan_name => $orphan_info) {
$form['simple_sitemap_settings']['status']['types']['&orphans']['table']['#rows'][$orphan_name] = [
'name' => $orphan_name,
'status' => $this->t('orphaned'),
'actions' => '',
];
}
}*/
return
$form
;
}
...
...
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