Commit 12ab9851 authored by gbyte.co's avatar gbyte.co

Clean up

parent 50ecd055
{
"name": "drupal/simple_sitemap",
"description": "Simple XML sitemap creates a standard conform XML sitemap of your content.",
"description": "Creates a standard conform hreflang XML sitemap of the site content and provides a framework for developing other sitemap types.",
"type": "drupal-module",
"homepage": "https://drupal.org/project/simple_sitemap",
"authors": [
......@@ -9,11 +9,6 @@
"email": "contact@gbyte.co",
"homepage": "https://www.drupal.org/u/gbyte.co",
"role": "Maintainer"
},
{
"name": "Sam Becker (Sam152)",
"homepage": "https://www.drupal.org/u/sam152",
"role": "Co-maintainer"
}
],
"support": {
......@@ -23,7 +18,9 @@
},
"license": "GPL-2.0+",
"minimum-stability": "dev",
"require": { },
"require": {
"ext-xmlwriter": "*"
},
"extra": {
"drush": {
"services": {
......
name: 'Simple XML Sitemap'
type: module
description: 'Creates a standard conform hreflang XML sitemap of your content.'
description: 'Creates a standard conform hreflang XML sitemap of the site content and provides a framework for developing other sitemap types.'
configure: simple_sitemap.settings
package: SEO
core: 8.x
......@@ -63,6 +63,8 @@ class SimplesitemapSettingsForm extends SimplesitemapFormBase {
'#suffix' => '</div>',
];
$form['simple_sitemap_settings']['status']['progress']['title']['#markup'] = $this->t('Progress of sitemap regeneration');
$queue_worker = $this->generator->getQueueWorker();
$total_count = $queue_worker->getInitialElementCount();
if (!empty($total_count)) {
......@@ -77,10 +79,10 @@ class SimplesitemapSettingsForm extends SimplesitemapFormBase {
'#percent' => $percent,
'#message' => t('@indexed out of @total items have been processed.', ['@indexed' => $indexed_count, '@total' => $total_count]),
];
$form['simple_sitemap_settings']['status']['progress']['#markup'] = render($index_progress);
$form['simple_sitemap_settings']['status']['progress']['bar']['#markup'] = render($index_progress);
}
else {
$form['simple_sitemap_settings']['status']['progress']['#markup'] = $this->t('There are no items to be indexed.');
$form['simple_sitemap_settings']['status']['progress']['bar']['#markup'] = '<div class="description">' . $this->t('There are no items to be indexed.') . '</div>';
}
$sitemap_manager = $this->generator->getSitemapManager();
......@@ -101,7 +103,7 @@ class SimplesitemapSettingsForm extends SimplesitemapFormBase {
];
foreach ($variants as $variant_name => $variant_definition) {
$row = [];
$row['name'] = $variant_definition['label'];
$row['name']['data']['#markup'] = '<span title="' . $variant_name . '">' . $variant_definition['label'] . '</span>';
if (!isset($sitemap_statuses[$variant_name])) {
$row['status'] = $this->t('pending');
}
......@@ -126,6 +128,9 @@ class SimplesitemapSettingsForm extends SimplesitemapFormBase {
}
}
}
if (empty($form['simple_sitemap_settings']['status']['types'])) {
$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'] = [
......@@ -258,7 +263,7 @@ class SimplesitemapSettingsForm extends SimplesitemapFormBase {
'#type' => 'number',
'#title' => $this->t('Sitemap generation max duration'),
'#min' => 1,
'#description' => $this->t('The maximum duration in seconds the generation task can run during a single cron run or during one batch process iteration.<br/>The higher the number, the quicker the generation process, but higher the risk of PHP timeout errors.'),
'#description' => $this->t('The maximum duration <strong>in seconds</strong> the generation task can run during a single cron run or during one batch process iteration.<br/>The higher the number, the quicker the generation process, but higher the risk of PHP timeout errors.'),
'#default_value' => $this->generator->getSetting('generate_duration', 10000) / 1000,
'#required' => TRUE,
];
......
......@@ -34,7 +34,7 @@ class SimplesitemapVariantsForm extends SimplesitemapFormBase {
'#type' => 'textarea',
'#title' => $this->t('Variants'),
'#default_value' => $this->variantsToString($this->generator->getSitemapManager()->getSitemapVariants(NULL, TRUE)),
'#description' => $this->t("Please specify sitemap variants, one per line.<br/>A variant definition consists of the variant name (used as the variant's path), the sitemap type it belongs to (optional) and the variant label (optional).<br/>These three values have to be separated by the | pipe | symbol.<br/><br/><strong>Examples:</strong><br/><em>default | default_hreflang | Default</em> -> variant of the <em>default_hreflang</em> sitemap type and <em>Default</em> as label; accessible under <em>/default/sitemap.xml</em><br/><em>test</em> -> variant of the <em>@default_sitemap_type</em> sitemap type and <em>test</em> as label; accessible under <em>/test/sitemap.xml</em><br/><br/><strong>Available sitemap types:</strong>", ['@default_sitemap_type' => SimplesitemapManager::DEFAULT_SITEMAP_TYPE]),
'#description' => $this->t("Please specify sitemap variants, one per line. <strong>Caution: </strong>Removing variants here will delete their bundle settings, custom links and corresponding sitemap instances.<br/><br/>A variant definition consists of the variant name (used as the variant's path), the sitemap type it belongs to (optional) and the variant label (optional). These three values have to be separated by the | pipe | symbol.<br/><br/><strong>Examples:</strong><br/><em>default | default_hreflang | Default</em> -> variant of the <em>default_hreflang</em> sitemap type and <em>Default</em> as label; accessible under <em>/default/sitemap.xml</em><br/><em>test</em> -> variant of the <em>@default_sitemap_type</em> sitemap type and <em>test</em> as label; accessible under <em>/test/sitemap.xml</em><br/><br/><strong>Available sitemap types:</strong>", ['@default_sitemap_type' => SimplesitemapManager::DEFAULT_SITEMAP_TYPE]),
];
foreach ($this->generator->getSitemapManager()->getSitemapTypes() as $sitemap_type => $definition) {
......
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