diff --git a/core/modules/views_ui/css/views-admin.theme.css b/core/modules/views_ui/css/views-admin.theme.css index 59bed90..930ae2c 100644 --- a/core/modules/views_ui/css/views-admin.theme.css +++ b/core/modules/views_ui/css/views-admin.theme.css @@ -795,7 +795,6 @@ ul#views-display-menu-tabs li.add ul.action-list li{ } .views-filterable-options .form-type-checkbox { - border: 1px solid #ccc; padding: 5px 8px; border-top: none; } diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js index f695e77..23a44fe 100644 --- a/core/modules/views_ui/js/views-admin.js +++ b/core/modules/views_ui/js/views-admin.js @@ -211,7 +211,7 @@ Drupal.viewsUi.addItemForm.prototype.handleCheck = function (event) { "use strict"; var $target = jQuery(event.target); - var label = jQuery.trim($target.next().text()); + var label = jQuery.trim($target.closest('td').next().text()); // Add/remove the checked item to the list. if ($target.is(':checked')) { this.$selected_div.show(); @@ -372,13 +372,14 @@ Drupal.viewsUi.OptionsSearch.prototype.getOptions = function ($allOptions) { "use strict"; var $ = jQuery; - var i, $label, $description, $option; + var i, $label, $description, $option, $cell; var options = []; var length = $allOptions.length; for (i = 0; i < length; i++) { $option = $($allOptions[i]); - $label = $option.find('label'); - $description = $option.find('div.description'); + $cell = $option.find('td'); + $label = $($cell[1]); + $description = $($cell[2]); options[i] = { // Search on the lowercase version of the label text + description. 'searchText': $label.text().toLowerCase() + " " + $description.text().toLowerCase(), diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php index 1c8d13e..cb1fd8e 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php @@ -104,8 +104,14 @@ public function buildForm(array $form, array &$form_state) { $form['options']['name'] = array( '#prefix' => '
', '#suffix' => '
', + '#type' => 'table', + '#header' => array( + t('Title'), + t('Description'), + t('Category'), + ), + '#tableselect' => TRUE, '#tree' => TRUE, - '#default_value' => 'all', ); // Group options first to simplify the usage of #states. @@ -131,18 +137,11 @@ public function buildForm(array $form, array &$form_state) { } } } - foreach ($grouped_options as $group => $group_options) { $zebra = 0; foreach ($group_options as $key => $option) { - $zebra_class = ($zebra % 2) ? 'odd' : 'even'; $form['options']['name'][$key] = array( - '#type' => 'checkbox', - '#title' => t('!group: !field', array('!group' => $option['group'], '!field' => $option['title'])), - '#description' => $option['help'], - '#return_value' => $key, - '#prefix' => "
", - '#suffix' => '
', + '#tree' => TRUE, '#states' => array( 'visible' => array( array( @@ -151,13 +150,25 @@ public function buildForm(array $form, array &$form_state) { array( ':input[name="override[controls][group]"]' => array('value' => $group), ), - ) - ) + ), + ), + '#attributes' => array( + 'class' => array( + 'filterable-option', + ), + ), + ); + $form['options']['name'][$key]['title'] = array( + '#markup' => $option['title'], + ); + $form['options']['name'][$key]['help'] = array( + '#markup' => $option['help'], + ); + $form['options']['name'][$key]['group'] = array( + '#markup' => $option['group'], ); - $zebra++; } } - $form['override']['controls']['group']['#options'] = $groups; } else { diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php old mode 100644 new mode 100755