Commit cd2fa234 authored by andrei.dincu's avatar andrei.dincu

Issue #2249723 by andrei.dincu: Add xmlsitemap configuration link at...

Issue #2249723 by andrei.dincu: Add xmlsitemap configuration link at /admin/config/search/xmlsitemap/entities/settings
parent 477d1057
......@@ -111,6 +111,7 @@ class XmlSitemapEntitiesSettingsForm extends ConfigFormBase implements Container
$form['settings'][$entity_type_id][$bundle]['settings'] = array(
'#type' => 'item',
'#label' => $bundle_info['label'],
'#settings_link' => l('Configure', 'admin/config/search/xmlsitemap/settings/' . $entity_type_id . '/' . $bundle, array('query' => drupal_get_destination())),
'bundle' => array(
'#type' => 'checkbox',
'#default_value' => xmlsitemap_link_bundle_check_enabled($entity_type_id, $bundle)
......
......@@ -69,9 +69,6 @@ class XmlSitemapLinkBundleSettingsForm extends ConfigFormBase implements Contain
$config = $this->config('xmlsitemap.settings');
$request = $this->getRequest();
if (!xmlsitemap_link_bundle_check_enabled($entity, $bundle)) {
throw new NotFoundHttpException();
}
if (!$request->isXmlHttpRequest() && $admin_path = xmlsitemap_get_bundle_path($entity, $bundle)) {
// If this is a non-ajax form, redirect to the bundle administration page.
$destination = drupal_get_destination();
......
......@@ -28,47 +28,47 @@ use Symfony\Component\HttpFoundation\Response;
/**
* The maximum number of links in one sitemap chunk file.
*/
const XMLSITEMAP_MAX_SITEMAP_LINKS = 50000;
const XMLSITEMAP_MAX_SITEMAP_LINKS = 50000;
/**
* The maximum filesize of a sitemap chunk file.
*/
const XMLSITEMAP_MAX_SITEMAP_FILESIZE = 10485760;
const XMLSITEMAP_MAX_SITEMAP_FILESIZE = 10485760;
/**
* Xmlsitemap Frequencies
*/
const XMLSITEMAP_FREQUENCY_YEARLY = 31449600; // 60 * 60 * 24 * 7 * 52
const XMLSITEMAP_FREQUENCY_MONTHLY = 2419200; // 60 * 60 * 24 * 7 * 4
const XMLSITEMAP_FREQUENCY_WEEKLY = 604800; // 60 * 60 * 24 * 7
const XMLSITEMAP_FREQUENCY_DAILY = 86400; // 60 * 60 * 24
const XMLSITEMAP_FREQUENCY_HOURLY = 3600; // 60 * 60
const XMLSITEMAP_FREQUENCY_ALWAYS = 60;
const XMLSITEMAP_FREQUENCY_YEARLY = 31449600; // 60 * 60 * 24 * 7 * 52
const XMLSITEMAP_FREQUENCY_MONTHLY = 2419200; // 60 * 60 * 24 * 7 * 4
const XMLSITEMAP_FREQUENCY_WEEKLY = 604800; // 60 * 60 * 24 * 7
const XMLSITEMAP_FREQUENCY_DAILY = 86400; // 60 * 60 * 24
const XMLSITEMAP_FREQUENCY_HOURLY = 3600; // 60 * 60
const XMLSITEMAP_FREQUENCY_ALWAYS = 60;
/**
* Short lastmod timestamp format.
*/
const XMLSITEMAP_LASTMOD_SHORT = 'Y-m-d';
const XMLSITEMAP_LASTMOD_SHORT = 'Y-m-d';
/**
* Medium lastmod timestamp format.
*/
const XMLSITEMAP_LASTMOD_MEDIUM = 'Y-m-d\TH:i\Z';
const XMLSITEMAP_LASTMOD_MEDIUM = 'Y-m-d\TH:i\Z';
/**
* Long lastmod timestamp format.
*/
const XMLSITEMAP_LASTMOD_LONG = 'c';
const XMLSITEMAP_LASTMOD_LONG = 'c';
/**
* The default inclusion status for link types in the sitemaps.
*/
const XMLSITEMAP_STATUS_DEFAULT = 0;
const XMLSITEMAP_STATUS_DEFAULT = 0;
/**
* The default priority for link types in the sitemaps.
*/
const XMLSITEMAP_PRIORITY_DEFAULT = 0.5;
const XMLSITEMAP_PRIORITY_DEFAULT = 0.5;
/**
* Implements hook_hook_info().
......@@ -1508,6 +1508,10 @@ function template_preprocess_xmlsitemap_content_settings_table(&$variables) {
'data' => t('Configuration'),
'class' => array('operations'),
),
array(
'data' => t('Sitemap settings'),
'class' => array('operations'),
),
);
$rows = array();
......@@ -1526,6 +1530,10 @@ function template_preprocess_xmlsitemap_content_settings_table(&$variables) {
'data' => $element[$bundle]['settings'],
'class' => array('operations'),
),
array(
'data' => $element[$bundle]['settings']['#settings_link'],
'class' => array('link'),
),
),
'class' => array('bundle-settings'),
);
......@@ -1624,7 +1632,7 @@ function xmlsitemap_xmlsitemap_index_links($limit) {
xmlsitemap_xmlsitemap_process_entity_links($entity_type_id, $ids);
}
catch (QueryException $e) {
}
}
}
......
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