diff --git c/theme/views_infinite_scroll_theme.inc w/theme/views_infinite_scroll_theme.inc index e4921cf..02667e5 100644 --- c/theme/views_infinite_scroll_theme.inc +++ w/theme/views_infinite_scroll_theme.inc @@ -70,7 +70,7 @@ function theme_views_infinite_scroll_pager($variables) { 'data' => $li_next, ); - // Build javascript settings array and sendt it to the front-end. + // Build javascript settings array and send it to the front-end. $settings = array( 'views_infinite_scroll' => array( array( diff --git c/views_plugin_pager_infinite_scroll.inc w/views_plugin_pager_infinite_scroll.inc index 859e1fa..4ad0492 100644 --- c/views_plugin_pager_infinite_scroll.inc +++ w/views_plugin_pager_infinite_scroll.inc @@ -1,7 +1,12 @@ options['offset'])) { return format_plural($this->options['items_per_page'], 'Infinite scroll pager, @count item, skip @skip', 'Infinite scroll pager, @count items, skip @skip', array('@count' => $this->options['items_per_page'], '@skip' => $this->options['offset'])); } @@ -21,10 +25,12 @@ class views_plugin_pager_infinite_scroll extends views_plugin_pager_full { function option_definition() { $options = parent::option_definition(); - // Added extra options + // Adds the load method options. $options['infinite_scroll'] = array( - 'method' => array('default' => 0), - 'link_text' => array('default' => 'Load more items'), + 'contains' => array( + 'method' => array('default' => '0'), + 'link_text' => array('default' => 'Load more items', 'translatable' => TRUE), + ), ); return $options; @@ -47,26 +53,29 @@ class views_plugin_pager_infinite_scroll extends views_plugin_pager_full { $form['infinite_scroll']['method'] = array( '#type' => 'radios', - '#title' => t('Scroll method'), - '#description' => t('The method to use when loading more elements. Automatically will load more elments when the page is scroll to the buttom of the page. The Link method requires the user to click a link below the view to load more elements.'), - '#options' => array(t('Automatically'), t('Link')), + '#title' => t('Load method'), + '#description' => t('The method to use when loading more elements. Automatically will load more elments when the page is scroll to the buttom of the page. The On Click method requires the user to click a link below the view to load more elements.'), + '#options' => array(t('Automatically'), t('On Click')), '#default_value' => $this->options['infinite_scroll']['method'], ); $form['infinite_scroll']['link_text'] = array( '#type' => 'textfield', '#title' => t('Link text'), - '#description' => t('The link tekst to display, which user will click to load more elements.'), + '#required' => TRUE, + '#description' => t('The link text to display, which user will click to load more elements.'), '#default_value' => $this->options['infinite_scroll']['link_text'], + '#dependency' => array( + 'radio:pager_options[infinite_scroll][method]' => array('1'), + ), '#states' => array( 'visible' => array( - ':input[name="pager_options[infinite_scroll][method]"]' => array('value' => '1'), + ':input[name="pager_options[infinite_scroll][method]"]' => array('value' => 1), ), ), ); } - function render($input) { global $base_url; $content_selector = '';