'description'=>t("In order to be able to generate sitemaps, the Simple XML sitemap module requires the <em>xmlwriter</em> PHP extension to be enabled."),
'severity'=>REQUIREMENT_ERROR,
);
];
}
switch($phase){
...
...
@@ -25,20 +25,20 @@ function simple_sitemap_requirements($phase) {
$generated_ago=$sitemap->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.",array('@generate'=>$GLOBALS['base_url'].'/admin/config/search/simplesitemap'));
$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']);
$severity=REQUIREMENT_WARNING;
}
else{
$value=t('XML sitemap is available');
$description=t("The <a href='@sitemap'>XML sitemap</a> was generated @ago ago. <a href='@generate'>Regenerate</a>.",array('@ago'=>$generated_ago,'@sitemap'=>$GLOBALS['base_url'].'/sitemap.xml','@generate'=>$GLOBALS['base_url'].'/admin/config/search/simplesitemap'));
$description=t("The <a href='@sitemap'>XML sitemap</a> was generated @ago ago. <a href='@generate'>Regenerate</a>.",['@ago'=>$generated_ago,'@sitemap'=>$GLOBALS['base_url'].'/sitemap.xml','@generate'=>$GLOBALS['base_url'].'/admin/config/search/simplesitemap']);
$severity=REQUIREMENT_INFO;
}
$requirements['simple_sitemap_generated']=array(
$requirements['simple_sitemap_generated']=[
'title'=>'Simple XML sitemap',
'value'=>$value,
'description'=>$description,
'severity'=>$severity,
);
];
break;
}
return$requirements;
...
...
@@ -48,30 +48,30 @@ function simple_sitemap_requirements($phase) {
* Implements hook_schema().
*/
functionsimple_sitemap_schema(){
$schema['simple_sitemap']=array(
$schema['simple_sitemap']=[
'description'=>'Holds XML sitemaps as strings for quick retrieval.',
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>.",array('@sitemap_url'=>"$base_url/sitemap.xml",'@content_type_url'=>"$base_url/admin/structure/types",'@config_url'=>"$base_url/admin/config/search/simplesitemap")));
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"]));
}
/**
...
...
@@ -90,7 +90,7 @@ function simple_sitemap_install() {
$message=t("You may want to <a href='@url'>regenerate</a> your XML sitemap now.",array('@url'=>$GLOBALS['base_url'].'/admin/config/search/simplesitemap'));
$message=t("You may want to <a href='@url'>regenerate</a> your XML sitemap now.",['@url'=>$GLOBALS['base_url'].'/admin/config/search/simplesitemap']);
if($sitemap->getSetting('cron_generate')){
$message.='</br>'.t('Otherwise the sitemap will be regenerated on the next cron run.');
if(!\Drupal::service('path.validator')->isValid($custom_path['path'])){//todo: Change to different function, as this also checks if current user has access. The user however varies depending if process was started from the web interface or via cron/drush.
'#description'=>t("Please specify drupal internal (relative) paths, one per line. Do not forget to prepend the paths with a '/'. You can optionally add a priority (0.0 - 1.0) by appending it to the path after a space. The home page with the highest priority would be <em>/ 1.0</em>, the contact page with the default priority would be <em>/contact 0.5</em>."),
$form_state->setErrorByName('',t("The priority setting <em>@priority</em> for path <em>@path</em> is incorrect. Set the priority from 0.0 to 1.0.",array('@priority'=>$link_config['priority'],'@path'=>$link_config['path'])));
$form_state->setErrorByName('',t("The priority setting <em>@priority</em> for path <em>@path</em> is incorrect. Set the priority from 0.0 to 1.0.",['@priority'=>$link_config['priority'],'@path'=>$link_config['path']]));
}
}
}
...
...
@@ -109,7 +109,7 @@ class SimplesitemapCustomLinksForm extends ConfigFormBase {
'#markup'=>'<p>'.t("Simple XML sitemap settings will be added only to entity forms of entity types enabled here. For all entity types featuring bundles (e.g. <em>node</em>) sitemap settings have to be set on their bundle pages (e.g. <em>page</em>).").'</p>',
$form['simple_sitemap_settings']['#prefix']="<div class='description'>".t("If you would like to say thanks and support the development of this module, a <a target='_blank' href='@url'>donation</a> is always appreciated.",array('@url'=>'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5AFYRSBLGSC3W'))."</div>";
$form['simple_sitemap_settings']['#prefix']="<div class='description'>".t("If you would like to say thanks and support the development of this module, a <a target='_blank' href='@url'>donation</a> is always appreciated.",['@url'=>'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5AFYRSBLGSC3W'])."</div>";
'#description'=>t("The maximum number of links one sitemap can hold. If more links are generated than set here, a sitemap index will be created and the links split into several sub-sitemaps.<br/>50 000 links is the maximum Google will parse per sitemap, however it is advisable to set this to a lower number. If left blank, all links will be shown on a single sitemap."),
'#description'=>t("During sitemap generation, the batch process will issue a page refresh after n links processed to prevent PHP timeouts and memory exhaustion. Increasing this number will reduce the number of times Drupal has to bootstrap (thus speeding up the generation process), but will require more memory and less strict PHP timeout settings."),