Commit 076bac0f authored by gbyte.co's avatar gbyte.co

Code cleanup

parent 22f0e398
......@@ -22,6 +22,5 @@ function simple_sitemap_drush_command() {
* Regenerate sitemap for all languages.
*/
function drush_simple_sitemap_generate() {
$generator = \Drupal::service('simple_sitemap.generator');
$generator->generateSitemap('drush');
\Drupal::service('simple_sitemap.generator')->generateSitemap('drush');
}
name: Simple XML Sitemap
name: 'Simple XML Sitemap'
type: module
description: 'Creates a standard conform XML sitemap of your content.'
configure: simple_sitemap.settings
......
......@@ -21,8 +21,7 @@ function simple_sitemap_requirements($phase) {
switch($phase) {
case 'runtime':
$generator = \Drupal::service('simple_sitemap.generator');
$generated_ago = $generator->getGeneratedAgo();
$generated_ago = \Drupal::service('simple_sitemap.generator')->getGeneratedAgo();
if (!$generated_ago) {
$value = t('Not available');
$description = t("The sitemap has not been generated yet. Run cron, or <a href='@generate'>generate</a> the sitemap manually.", ['@generate' => $GLOBALS['base_url'] . '/admin/config/search/simplesitemap']);
......@@ -79,8 +78,7 @@ function simple_sitemap_schema() {
* Implements hook_install().
*/
function simple_sitemap_install() {
$generator = \Drupal::service('simple_sitemap.generator');
$generator->generateSitemap('nobatch');
\Drupal::service('simple_sitemap.generator')->generateSitemap('nobatch');
$base_url = $GLOBALS['base_url'];
drupal_set_message(t("You can now include content into the <a href='@sitemap_url' target='_blank'>XML sitemap</a> by visiting the corresponding entity type edit pages (e.g. <a href='@content_type_url' target='_blank'>node type edit pages</a>) These settings can then be overridden for single entities.<br/> Support for additional entity types and custom links can be added on <a href='@config_url' target='_blank'>the module's configuration pages</a>.", ['@sitemap_url' => "$base_url/sitemap.xml", '@content_type_url' => "$base_url/admin/structure/types", '@config_url' => "$base_url/admin/config/search/simplesitemap"]));
}
......
......@@ -2,7 +2,6 @@
namespace Drupal\simple_sitemap\Form;
use Drupal\Core\Form\ConfigFormBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......
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