diff --git a/src/Form/Pagingform.php b/src/Form/Pagingform.php index b4d9916..3389ee8 100644 --- a/src/Form/Pagingform.php +++ b/src/Form/Pagingform.php @@ -39,7 +39,7 @@ class Pagingform extends FormBase { '#maxlength' => 255, '#description' => t('Use an HTML tag that will render reasonably when paging is not enabled, such as %pagebreak or %hr.'), -// '#default_value' => \Drupal::config('paging.separator')->get('paging.separator') + '#default_value' => \Drupal::config('paging.separator')->get('paging.separator') ); $form['paging_general']['paging_pager_count'] = array( @@ -50,7 +50,7 @@ class Pagingform extends FormBase { 'two' => t('Two'), ), '#attributes' => array('class' => array('paging-pager')), -// '#default_value' => \Drupal::config('paging.pagerCount')->get('paging.pagerCount') + '#default_value' => \Drupal::config('paging.pagerCount')->get('paging.pagerCount') ); $contentTypesList = []; @@ -77,7 +77,7 @@ class Pagingform extends FormBase { '#type' => 'checkbox', '#title' => 'Enable paging', '#attributes' => array('class' => array('paging-enabled')), -// '#default_value' => \Drupal::config('paging.enabled_' . $content_type)->get('paging.enabled_' . $content_type) + '#default_value' => \Drupal::config('paging.enabled_' . $content_type)->get('paging.enabled_' . $content_type) ); // Paging toggle checkbox. @@ -91,7 +91,7 @@ class Pagingform extends FormBase { ':input[name="paging_enabled_' . $content_type . '"]' => array('checked' => TRUE), ), ), -// '#default_value' => \Drupal::config('paging.field_' . $content_type)->get('paging.field_' . $content_type) + '#default_value' => \Drupal::config('paging.field_' . $content_type)->get('paging.field_' . $content_type) ); // Change "Read more" path when first page is greater than or equal to the teaser. @@ -106,7 +106,7 @@ class Pagingform extends FormBase { ':input[name="paging_enabled_' . $content_type . '"]' => array('checked' => TRUE), ), ), -// '#default_value' => \Drupal::config('paging.readMore_' . $content_type)->get('paging.readMore_' . $content_type) + '#default_value' => \Drupal::config('paging.readMore_' . $content_type)->get('paging.readMore_' . $content_type) ); // Set the browser's title to current page's name. @@ -120,7 +120,7 @@ class Pagingform extends FormBase { ':input[name="paging_enabled_' . $content_type . '"]' => array('checked' => TRUE), ), ), -// '#default_value' => \Drupal::config('paging.changeTitle_' . $content_type)->get('paging.changeTitle_' . $content_type) + '#default_value' => \Drupal::config('paging.changeTitle_' . $content_type)->get('paging.changeTitle_' . $content_type) ); // Right column fieldset. @@ -151,7 +151,7 @@ class Pagingform extends FormBase { ':input[name="paging_enabled_' . $content_type . '"]' => array('checked' => TRUE), ), ), -// '#default_value' => \Drupal::config('paging.automaticMethod_' . $content_type)->get('paging.automaticMethod_' . $content_type) + '#default_value' => \Drupal::config('paging.automaticMethod_' . $content_type)->get('paging.automaticMethod_' . $content_type) ); $char_len_options = array(-1 => 750) + range(500, 7500, 500); @@ -173,7 +173,7 @@ class Pagingform extends FormBase { ':input[name="paging_automatic_method_' . $content_type . '"]' => array('value' => 'chars'), ), ), -// '#default_value' => \Drupal::config('paging.automaticMethodChars_' . $content_type)->get('paging.automaticMethodChars_' . $content_type) + '#default_value' => \Drupal::config('paging.automaticMethodChars_' . $content_type)->get('paging.automaticMethodChars_' . $content_type) ); // Automatic paging method. Text box to choose orphan size. @@ -191,7 +191,7 @@ class Pagingform extends FormBase { ':input[name="paging_automatic_method_' . $content_type . '"]' => array('value' => 'chars'), ), ), -// '#default_value' => \Drupal::config('paging.automaticMethodCharsOrphan_' . $content_type)->get('paging.automaticMethodCharsOrphan_' . $content_type) + '#default_value' => \Drupal::config('paging.automaticMethodCharsOrphan_' . $content_type)->get('paging.automaticMethodCharsOrphan_' . $content_type) ); // Automatic paging method. Select list to choose the number of words per page. @@ -209,7 +209,7 @@ class Pagingform extends FormBase { ':input[name="paging_automatic_method_' . $content_type . '"]' => array('value' => 'words'), ), ), -// '#default_value' => \Drupal::config('paging.automaticMethodWords_' . $content_type)->get('paging.automaticMethodWords_' . $content_type) + '#default_value' => \Drupal::config('paging.automaticMethodWords_' . $content_type)->get('paging.automaticMethodWords_' . $content_type) ); // Automatic paging method. Text box to set orphan page size. @@ -229,7 +229,7 @@ class Pagingform extends FormBase { ':input[name="paging_automatic_method_' . $content_type . '"]' => array('value' => 'words'), ), ), -// '#default_value' => \Drupal::config('paging.automaticMethodWordsOrphan_' . $content_type)->get('paging.automaticMethodWordsOrphan_' . $content_type) + '#default_value' => \Drupal::config('paging.automaticMethodWordsOrphan_' . $content_type)->get('paging.automaticMethodWordsOrphan_' . $content_type) ); } @@ -249,7 +249,6 @@ class Pagingform extends FormBase { * An associative array containing the structure of the form. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. - * @author suraj@valuebound.com */ public function submitForm(array &$form, FormStateInterface $form_state) { $contentTypes = \Drupal::service('entity.manager')->getStorage('node_type')->loadMultiple();