Commit 57981ba3 authored by Dave Reid's avatar Dave Reid

by Dave Reid: Simplified strings and logic for xmlsitemap_help().

parent cf66d052
......@@ -495,7 +495,7 @@ function _xmlsitemap_get_blurb($check_version = TRUE) {
l('Coupons Dealuxe', 'http://couponsdealuxe.com/'),
);
// Don't extract the following string for translation.
$blurb = '<p>Thank you for helping test the XML sitemap module rewrite. Please consider helping offset developer free time by <a href="http://davereid.chipin.com/">donating</a> or if your company is interested in sponsoring the rewrite or a specific feature, please <a href="http://davereid.net/contact">contact the developer</a>.</p><p>Thank you to the following current sponsors: ' . implode(', ', $sponsors) . ', and all the indivduals that have donated. This message will not be seen in the stable versions.</p>';
$blurb = '<div class="description"><p>Thank you for helping test the XML sitemap module rewrite. Please consider helping offset developer free time by <a href="http://davereid.chipin.com/">donating</a> or if your company is interested in sponsoring the rewrite or a specific feature, please <a href="http://davereid.net/contact">contact the developer</a>. Thank you to the following current sponsors: ' . implode(', ', $sponsors) . ', and all the indivduals that have donated. This message will not be seen in the stable versions.</p></div>';
//http://drupalmodules.com/module/xml-sitemap
}
}
......
......@@ -113,9 +113,17 @@ function xmlsitemap_check_status() {
}
}
}
if ($messages) {
$message = t('One or more problems were detected with your XML sitemap configuration: !messages', array('!messages' => theme('item_list', array('items' => $messages))));
if (user_access('access site reports')) {
$message .= t('Check the <a href="@status-report">status report</a> for more information.', array('@status-report' => url('admin/reports/status')));
}
drupal_set_message($message, 'warning', FALSE);
}
}
return $messages;
return !empty($messages);
}
/**
......
......@@ -39,9 +39,11 @@ function xmlsitemap_help($path, $arg) {
$output = '';
switch ($path) {
case 'admin/help/xmlsitemap':
return;
case 'admin/help#xmlsitemap':
$sitemaps = xmlsitemap_get_sitemaps(TRUE);
$output .= format_plural(count($sitemaps), 'Your sitemap is located at: !sitemaps', 'Your sitemaps are located at: !sitemaps', array('!sitemaps' => theme('item_list', $sitemaps)));
$output .= '<p>' . format_plural(count($sitemaps), 'Your sitemap is located at !sitemap.', 'Your sitemaps are located at: !sitemaps', array('!sitemaps' => theme('item_list', array('items' => $sitemaps)), '!sitemap' => current($sitemaps))) . '</p>';
break;
case 'admin/config/search/xmlsitemap':
break;
......@@ -49,17 +51,14 @@ function xmlsitemap_help($path, $arg) {
$output .= '<p>' . t("This action rebuilds your site's XML sitemap and regenerates the cached files, and may be a lengthy process. If you just installed XML sitemap, this can be helpful to import all your site's content into the sitemap. Otherwise, this should only be used in emergencies.") . '</p>';
}
// Use a static variable because this code may be called more than once.
static $checked = FALSE;
if (!$checked && arg(0) == 'admin' && strpos($path, 'xmlsitemap') !== FALSE) {
$checked = TRUE;
module_load_install('xmlsitemap');
if (user_access('administer site configuration') && $messages = xmlsitemap_check_status()) {
drupal_set_message(t('One or more problems were detected with your XML sitemap configuration. Check the <a href="@status-report">status report</a> for more information.<br />!list', array('@status-report' => url('admin/reports/status'), '!list' => theme('item_list', array('items' => $messages)))), 'warning', FALSE);
if (arg(0) == 'admin' && strpos($path, 'xmlsitemap') !== FALSE) {
if ($arg[1] == 'config' && user_access('administer xmlsitemap')) {
module_load_install('xmlsitemap');
xmlsitemap_check_status();
}
module_load_include('inc', 'xmlsitemap');
if ($blurb = _xmlsitemap_get_blurb()) {
$output .= '<div class="form-item"><div class="description">' . $blurb . '</div></div>';
$output .= $blurb;
}
}
......
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