Commit 663eddf2 authored by andrei.dincu's avatar andrei.dincu
Browse files

Issue #2249723 by andrei.dincu: Add t() for messages in...

Issue #2249723 by andrei.dincu: Add t() for messages in XmlSitemapEntitiesSettingsForm, add some documentation in classes
parent cd2fa234
......@@ -111,7 +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())),
'#settings_link' => l($this->t('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)
......
......@@ -38,7 +38,7 @@ class XmlSitemapForm extends EntityForm {
'#title' => $this->t('Label'),
'#maxlength' => 255,
'#default_value' => $xmlsitemap->label(),
'#description' => $this->t("Label for the Example."),
'#description' => $this->t('Label for the Example.'),
'#required' => TRUE,
);
$form['context'] = array(
......
......@@ -123,7 +123,7 @@ class XmlSitemapLinkBundleSettingsForm extends ConfigFormBase implements Contain
$entity_info = $form['xmlsitemap']['#entity_info'];
if (!empty($form['xmlsitemap']['#show_message'])) {
drupal_set_message(t('XML sitemap settings for the %bundle have been saved.', array('%bundle' => $entity_info['bundles'][$bundle]['label'])));
drupal_set_message($this->t('XML sitemap settings for the %bundle have been saved.', array('%bundle' => $entity_info['bundles'][$bundle]['label'])));
}
// Unset the form values since we have already saved the bundle settings and
......
......@@ -75,7 +75,7 @@ class XmlSitemapRebuildForm extends ConfigFormBase {
$rebuild_types = array_combine($rebuild_types, $rebuild_types);
$form['entities'] = array(
'#type' => 'select',
'#title' => t("Select which link types you would like to rebuild"),
'#title' => t('Select which link types you would like to rebuild'),
'#description' => t('If no link types are selected, the sitemap files will just be regenerated.'),
'#multiple' => TRUE,
'#options' => $rebuild_types,
......
......@@ -354,7 +354,7 @@ abstract class XmlSitemapTestBase extends WebTestBase {
if ($verbose) {
array_unshift($verbose, '<h2>Watchdog messages</h2>');
$this->verbose(implode("<br />", $verbose), 'Watchdog messages from test run');
$this->verbose(implode('<br />', $verbose), 'Watchdog messages from test run');
}
// Clear the seen watchdog messages since we've failed on any errors.
......
......@@ -189,7 +189,6 @@ class XmlSitemapGenerator implements XmlSitemapGeneratorInterface {
catch (Exception $e) {
watchdog_exception('xmlsitemap', $e);
throw $e;
return FALSE;
}
return $writer->getSitemapElementCount();
......
......@@ -27,7 +27,7 @@ interface XmlSitemapLinkStorageInterface {
/**
* Saves or updates a sitemap link.
*
* @param $link
* @param array $link
* An array with a sitemap link.
*/
public function save(array $link);
......@@ -35,13 +35,13 @@ interface XmlSitemapLinkStorageInterface {
/**
* Check if there is sitemap link is changed from the existing data.
*
* @param $link
* @param array $link
* An array of the sitemap link.
* @param $original_link
* @param array $original_link
* An optional array of the existing data. This should only contain the
* fields necessary for comparison. If not provided the existing data will be
* loaded from the database.
* @param $flag
* @param bool $flag
* An optional boolean that if TRUE, will set the regenerate needed flag if
* there is a match. Defaults to FALSE.
* @return
......@@ -52,11 +52,14 @@ interface XmlSitemapLinkStorageInterface {
/**
* Check if there is a visible sitemap link given a certain set of conditions.
*
* @param $conditions
* @param array $conditions
* An array of values to match keyed by field.
* @param $flag
* @param array $updates
* Updates to be made.
* @param bool $flag
* An optional boolean that if TRUE, will set the regenerate needed flag if
* there is a match. Defaults to FALSE.
*
* @return
* TRUE if there is a visible link, or FALSE otherwise.
*/
......@@ -68,10 +71,11 @@ interface XmlSitemapLinkStorageInterface {
* If a visible sitemap link was deleted, this will automatically set the
* regenerate needed flag.
*
* @param $entity_type
* @param string $entity_type
* A string with the entity type.
* @param $entity_id
* An integer with the entity ID.
* Entity ID to be deleted.
*
* @return
* The number of links that were deleted.
*/
......@@ -79,13 +83,13 @@ interface XmlSitemapLinkStorageInterface {
/**
* Delete multiple sitemap links from the database.
*
* If visible sitemap links were deleted, this will automatically set the
* regenerate needed flag.
*
* @param $conditions
* @param array $conditions
* An array of conditions on the {xmlsitemap} table in the form
* 'field' => $value.
*
* @return
* The number of links that were deleted.
*/
......@@ -93,14 +97,14 @@ interface XmlSitemapLinkStorageInterface {
/**
* Perform a mass update of sitemap data.
*
* If visible links are updated, this will automatically set the regenerate
* needed flag to TRUE.
*
* @param $updates
* @param array $updates
* An array of values to update fields to, keyed by field name.
* @param $conditions
* @param array $conditions
* An array of values to match keyed by field.
*
* @return
* The number of links that were updated.
*/
......@@ -109,10 +113,11 @@ interface XmlSitemapLinkStorageInterface {
/**
* Load a specific sitemap link from the database.
*
* @param $entity_type
* A string with the entity type.
* @param string $entity_type
* A string with the entity type id.
* @param $entity_id
* An integer with the entity ID.
* Entity ID.
*
* @return
* A sitemap link (array) or FALSE if the conditions were not found.
*/
......@@ -121,9 +126,10 @@ interface XmlSitemapLinkStorageInterface {
/**
* Load sitemap links from the database.
*
* @param $conditions
* @param array $conditions
* An array of conditions on the {xmlsitemap} table in the form
* 'field' => $value.
*
* @return
* An array of sitemap link arrays.
*/
......
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