/**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state)
 {
     $sitemap = new Simplesitemap();
     $setting_string = '';
     foreach ($sitemap->get_custom_links() as $custom_link) {
         // todo: remove this statement after removing the index key from the configuration.
         if (isset($custom_link['index']) && $custom_link['index'] == 0) {
             continue;
         }
         $setting_string .= isset($custom_link['priority']) ? $custom_link['path'] . ' ' . $custom_link['priority'] : $custom_link['path'];
         $setting_string .= "\r\n";
     }
     $form['simplesitemap_custom'] = array('#title' => t('Custom links'), '#type' => 'fieldset', '#markup' => '<p>' . t('Add custom internal drupal paths and their priorities to the XML sitemap.') . '</p>');
     $form['simplesitemap_custom']['custom_links'] = array('#type' => 'textarea', '#title' => t('Relative Drupal paths'), '#default_value' => $setting_string, '#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</em>, the contact page with a medium priority would be <em>/contact 0.5</em>."));
     $form['simplesitemap_custom']['simplesitemap_rebuild_now'] = array('#type' => 'checkbox', '#title' => t('Rebuild sitemap after hitting Save'), '#description' => t('This setting will rebuild the whole sitemap including the above changes.<br/>Otherwise the sitemap will be rebuilt on next cron run.'), '#default_value' => FALSE);
     return parent::buildForm($form, $form_state);
 }