function xmlsitemap_get_priority_options in XML sitemap 6.2
Same name and namespace in other branches
- 8 xmlsitemap.module \xmlsitemap_get_priority_options()
- 7.2 xmlsitemap.admin.inc \xmlsitemap_get_priority_options()
- 2.x xmlsitemap.module \xmlsitemap_get_priority_options()
Get a list of priority options.
Parameters
$default: Include a 'default' option.
$guides: Add helpful indicators for the highest, middle and lowest values.
Return value
An array of options.
5 calls to xmlsitemap_get_priority_options()
- xmlsitemap_add_form_entity_summary in ./
xmlsitemap.admin.inc - Add a table summary for an entity and its bundles.
- xmlsitemap_add_form_link_options in ./
xmlsitemap.admin.inc - Add a link's XML sitemap options to the link's form.
- xmlsitemap_add_link_bundle_settings in ./
xmlsitemap.admin.inc - Add the link type XML sitemap options to the link type's form.
- xmlsitemap_custom_edit_link_form in xmlsitemap_custom/
xmlsitemap_custom.admin.inc - xmlsitemap_link_frontpage_settings in ./
xmlsitemap.xmlsitemap.inc - XML sitemap link type settings callback for frontpage link entity.
File
- ./
xmlsitemap.admin.inc, line 799 - Administrative page callbacks for the xmlsitemap module.
Code
function xmlsitemap_get_priority_options($default = NULL, $guides = TRUE) {
$options = array();
$priorities = array(
'1.0' => t('1.0'),
'0.9' => t('0.9'),
'0.8' => t('0.8'),
'0.7' => t('0.7'),
'0.6' => t('0.6'),
'0.5' => t('0.5'),
'0.4' => t('0.4'),
'0.3' => t('0.3'),
'0.2' => t('0.2'),
'0.1' => t('0.1'),
'0.0' => t('0.0'),
);
if (isset($default)) {
$default = number_format($default, 1);
$options['default'] = t('Default (@value)', array(
'@value' => $priorities[$default],
));
}
// Add the rest of the options.
$options += $priorities;
if ($guides) {
$options['1.0'] .= ' ' . t('(highest)');
$options['0.5'] .= ' ' . t('(normal)');
$options['0.0'] .= ' ' . t('(lowest)');
}
return $options;
}