예제 #1
0
파일: Full.php 프로젝트: nsp15/Drupal8
 /**
  * Overrides \Drupal\views\Plugin\views\SqlBase::buildOptionsForm().
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $form['quantity'] = array('#type' => 'number', '#title' => $this->t('Number of pager links visible'), '#description' => $this->t('Specify the number of links to pages to display in the pager.'), '#default_value' => $this->options['quantity']);
     $form['tags']['first'] = array('#type' => 'textfield', '#title' => $this->t('First page link text'), '#default_value' => $this->options['tags']['first'], '#weight' => -10);
     $form['tags']['last'] = array('#type' => 'textfield', '#title' => $this->t('Last page link text'), '#default_value' => $this->options['tags']['last'], '#weight' => 10);
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $form['tags']['#access'] = FALSE;
     $options = $this->options['views_infinite_scroll'];
     $form['views_infinite_scroll'] = ['#title' => $this->t('Infinite Scroll Options'), '#type' => 'details', '#open' => TRUE, '#tree' => TRUE, '#input' => TRUE, '#weight' => -100, 'button_text' => ['#type' => 'textfield', '#title' => $this->t('Button Text'), '#default_value' => $options['button_text']], 'automatically_load_content' => ['#type' => 'checkbox', '#title' => $this->t('Automatically Load Content'), '#description' => $this->t('Automatically load subsequent pages as the user scrolls.'), '#default_value' => $options['automatically_load_content']]];
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     unset($form['tags']);
     //    unset($form['expose']);
     unset($form['total_pages']);
     $form['tags']['#description'] = $this->t('While these links are not visible during infinite scrolling, they are used by search engines and browsers without JavaScript.');
     $form['options'] = array('#title' => $this->t('Infinite Scroll Options'), '#type' => 'details', '#open' => TRUE, '#tree' => TRUE, '#input' => TRUE, '#weight' => -100);
     $form['options']['type'] = array('#title' => $this->t('Fetch type'), '#type' => 'select', '#options' => array('infinite_scroll' => t('Infinite scroll'), 'manual_load' => t('Manual load'), 'click_scroll' => t('Click scroll')), '#default_value' => $this->options['options']['type'], '#description' => $this->t('Choose what kind of fetch handler you want.'));
     $form['options']['loading_text'] = array('#type' => 'textfield', '#title' => $this->t('Loading Text'), '#description' => $this->t('The text displayed to the user when the next page is loading.'), '#default_value' => $this->options['options']['loading_text']);
     $form['options']['load_more_text'] = array('#type' => 'textfield', '#title' => $this->t('Click to Load Button'), '#description' => $this->t('The text inside the manually load button.'), '#default_value' => $this->options['options']['load_more_text'], '#states' => array('invisible' => array(':input[name="pager_options[options][type]"]' => array('value' => 'infinite_scroll'))));
     $form['element_settings'] = array('#title' => $this->t('Element settings'), '#type' => 'details', '#open' => TRUE, '#tree' => TRUE, '#input' => TRUE, '#weight' => -100);
     $form['element_settings']['row_class'] = array('#type' => 'textfield', '#title' => $this->t('Row class'), '#description' => $this->t('Change the row class from the default one (views-row).'), '#default_value' => $this->options['element_settings']['row_class']);
     $form['element_settings']['loader_class'] = array('#type' => 'textfield', '#title' => $this->t('Container class'), '#description' => $this->t('Change the loader class from the default one (js-AmazingPager-spinner).'), '#default_value' => $this->options['element_settings']['loader_class']);
     $form['element_settings']['trigger_class'] = array('#type' => 'textfield', '#title' => $this->t('Trigger class'), '#description' => $this->t('Change the trigger class from the default one (js-AmazingPager-trigger).'), '#default_value' => $this->options['element_settings']['trigger_class']);
     $form['output'] = array('#title' => $this->t('Infinite Scroll Output Options'), '#type' => 'details', '#open' => TRUE, '#tree' => TRUE, '#input' => TRUE, '#weight' => -100, 'animate' => array('#type' => 'checkbox', '#title' => $this->t('Animate'), '#description' => $this->t('Animate the output and make each row be displayed at diffrent times.'), '#default_value' => $this->options['output']['animate']), 'animate_effect' => array('#type' => 'select', '#title' => $this->t('Animate effect'), '#description' => $this->t('Choose effect on how the items will be displayed.'), '#options' => array('fadeIn' => t('fadeIn'), 'fadeInUp' => t('fadeInUp'), 'bounceIn' => t('bounceIn'), 'flipInX' => t('flipInX')), '#default_value' => $this->options['output']['animate_effect'], '#states' => array('visible' => array(':input[name="pager_options[output][animate]"]' => array('checked' => TRUE)))));
 }