Commit b38a60d1 authored by gbyte.co's avatar gbyte.co

Clean up some

parent 1c2cdead
......@@ -13,7 +13,8 @@ CONTENTS OF THIS FILE
INTRODUCTION
------------
Author and maintainer: Pawel Ginalski (gbyte.co) https://www.drupal.org/u/gbyte.co
Author and maintainer: Pawel Ginalski (gbyte.co)
https://www.drupal.org/u/gbyte.co
The module generates a multilingual XML sitemap which adheres to Google's new
hreflang standard. Out of the box the sitemap is able to index most of Drupal's
......
......@@ -51,7 +51,7 @@ function hook_simple_sitemap_arbitrary_links_alter(&$arbitrary_links) {
'lastmod' => '2012-10-12T17:40:30+02:00',
'changefreq' => 'weekly',
'images' => [
['path' =>'http://path-to-image.png']
['path' => 'http://path-to-image.png']
]
];
}
......
......@@ -24,12 +24,12 @@ class UrlGenerator extends Plugin {
public $id;
/**
* @var integer
* @var int
*/
public $weight;
/**
* @var boolean
* @var bool
*/
public $instantiateForEachDataSet;
}
......@@ -6,7 +6,6 @@ use Drupal\Core\Entity\ContentEntityTypeInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Database\Connection;
use Drupal\Core\Entity\Entity;
use Drupal\Core\Url;
/**
......
......@@ -13,7 +13,7 @@ class SimplesitemapCustomLinksForm extends SimplesitemapFormBase {
/**
* {@inheritdoc}
*/
public function getFormID() {
public function getFormId() {
return 'simple_sitemap_custom_links_form';
}
......@@ -33,7 +33,7 @@ class SimplesitemapCustomLinksForm extends SimplesitemapFormBase {
'#type' => 'textarea',
'#title' => $this->t('Relative Drupal paths'),
'#default_value' => $this->customLinksToString($this->generator->getCustomLinks(FALSE)),
'#description' => $this->t('Please specify drupal internal (relative) paths, one per line. Do not forget to prepend the paths with a \'/\'.<br/>Optionally link priority <em>(0.0 - 1.0)</em> can be added by appending it after a space.<br/> Optionally link change frequency <em>(always / hourly / daily / weekly / monthly / yearly / never)</em> can be added by appending it after a space.<br/><br/><strong>Examples:</strong><br/><em>/ 1.0 daily</em> -> home page with the highest priority and daily change frequency<br/><em>/contact</em> -> contact page with the default priority and no change frequency information'),
'#description' => $this->t("Please specify drupal internal (relative) paths, one per line. Do not forget to prepend the paths with a '/'.<br/>Optionally link priority <em>(0.0 - 1.0)</em> can be added by appending it after a space.<br/> Optionally link change frequency <em>(always / hourly / daily / weekly / monthly / yearly / never)</em> can be added by appending it after a space.<br/><br/><strong>Examples:</strong><br/><em>/ 1.0 daily</em> -> home page with the highest priority and daily change frequency<br/><em>/contact</em> -> contact page with the default priority and no change frequency information"),
];
$form['simple_sitemap_custom']['include_images'] = [
......@@ -72,7 +72,7 @@ class SimplesitemapCustomLinksForm extends SimplesitemapFormBase {
// Making sure the paths start with a slash.
if ($link_config['path'][0] != '/') {
$form_state->setErrorByName('', $this->t('<strong>Line @line</strong>: The path <em>@path</em> needs to start with a \'/\'.', $placeholders));
$form_state->setErrorByName('', $this->t("<strong>Line @line</strong>: The path <em>@path</em> needs to start with a '/'.", $placeholders));
}
// Making sure the priority is formatted correctly.
......
......@@ -13,7 +13,7 @@ class SimplesitemapEntitiesForm extends SimplesitemapFormBase {
/**
* {@inheritdoc}
*/
public function getFormID() {
public function getFormId() {
return 'simple_sitemap_entities_form';
}
......@@ -61,7 +61,7 @@ class SimplesitemapEntitiesForm extends SimplesitemapFormBase {
if ($form['simple_sitemap_entities']['entities'][$entity_type_id][$entity_type_id . '_enabled']['#default_value']) {
$form['simple_sitemap_entities']['entities'][$entity_type_id][$entity_type_id . '_enabled']['#suffix']
= '<div id="warning-' . $css_entity_type_id . '">'
. $this->t('<strong>Warning:</strong> This entity type\'s sitemap settings including per-entity overrides will be deleted after hitting <em>Save</em>.')
. $this->t("<strong>Warning:</strong> This entity type's sitemap settings including per-entity overrides will be deleted after hitting <em>Save</em>.")
. '</div>';
}
......
......@@ -14,7 +14,7 @@ class SimplesitemapSettingsForm extends SimplesitemapFormBase {
/**
* {@inheritdoc}
*/
public function getFormID() {
public function getFormId() {
return 'simple_sitemap_settings_form';
}
......
......@@ -436,8 +436,8 @@ abstract class UrlGeneratorBase extends SimplesitemapPluginBase implements UrlGe
*/
protected function getImages($entity_type_name, $entity_id) {
$images = [];
foreach ($this->entityHelper->getEntityImageUrls($entity_type_name, $entity_id) as $Url) {
$images[]['path'] = $this->replaceBaseUrlWithCustom($Url);
foreach ($this->entityHelper->getEntityImageUrls($entity_type_name, $entity_id) as $url) {
$images[]['path'] = $this->replaceBaseUrlWithCustom($url);
}
return $images;
}
......
......@@ -191,7 +191,7 @@ class SimplesitemapTest extends SimplesitemapTestBase {
* @todo On second generation too many links in XML output here?
*/
public function testRemoveDuplicatesSetting() {
$this->generator->setBundleSettings('node', 'page', ['index' => true])
$this->generator->setBundleSettings('node', 'page', ['index' => TRUE])
->addCustomLink('/node/1')
->saveSetting('remove_duplicates', TRUE)
->generateSitemap('nobatch');
......@@ -233,7 +233,7 @@ class SimplesitemapTest extends SimplesitemapTestBase {
public function testBatchProcessLimitSetting() {
// Create some nodes.
for ($i = 3; $i <=50; $i++) {
for ($i = 3; $i <= 50; $i++) {
$this->createNode(['title' => "Node{$i}", 'type' => 'page']);
}
......
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