Commit fdec77fc authored by alexpott's avatar alexpott

Issue #2382543 by rpayanm, ianthomas_uk: Remove usage of drupal_html_class()...

Issue #2382543 by rpayanm, ianthomas_uk: Remove usage of drupal_html_class() and drupal_clean_css_identifier()
parent ee0b5439
......@@ -9,6 +9,7 @@
*/
use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Unicode;
......@@ -1352,7 +1353,7 @@ function template_preprocess_html(&$variables) {
}
else {
$segment = explode('/', $path);
$variables['attributes']['class'][] = 'path-' . drupal_html_class($segment[1]);
$variables['attributes']['class'][] = 'path-' . Html::getClass($segment[1]);
}
$site_config = \Drupal::config('system.site');
......@@ -1638,7 +1639,7 @@ function template_preprocess_field(&$variables, $hook) {
// Add default CSS classes. Since there can be many fields rendered on a page,
// save some overhead by calling strtr() directly instead of
// drupal_html_class().
// \Drupal\Component\Utility\Html::getClass().
$variables['entity_type_css'] = strtr($element['#entity_type'], '_', '-');
$variables['field_name_css'] = strtr($element['#field_name'], '_', '-');
$variables['field_type_css'] = strtr($element['#field_type'], '_', '-');
......
......@@ -7,6 +7,7 @@
namespace Drupal\Core\Field;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Utility\SortArray;
use Drupal\Component\Utility\String;
......@@ -126,9 +127,9 @@ public function form(FieldItemListInterface $items, array &$form, FormStateInter
'#parents' => array_merge($parents, array($field_name . '_wrapper')),
'#attributes' => array(
'class' => array(
'field-type-' . drupal_html_class($this->fieldDefinition->getType()),
'field-name-' . drupal_html_class($field_name),
'field-widget-' . drupal_html_class($this->getPluginId()),
'field-type-' . Html::getClass($this->fieldDefinition->getType()),
'field-name-' . Html::getClass($field_name),
'field-widget-' . Html::getClass($this->getPluginId()),
),
),
'widget' => $elements,
......
......@@ -107,7 +107,7 @@ public function getFilters() {
new \Twig_SimpleFilter('without', 'twig_without'),
// CSS class and ID filters.
new \Twig_SimpleFilter('clean_class', 'drupal_html_class'),
new \Twig_SimpleFilter('clean_class', '\Drupal\Component\Utility\Html::getClass'),
new \Twig_SimpleFilter('clean_id', 'drupal_clean_id_identifier'),
);
}
......
......@@ -9,6 +9,7 @@
use Drupal\block\Event\BlockContextEvent;
use Drupal\block\Event\BlockEvents;
use Drupal\Component\Utility\Html;
use Drupal\Core\Entity\EntityForm;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Executable\ExecutableManagerInterface;
......@@ -337,7 +338,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
array(
'theme' => $form_state->getValue('theme'),
),
array('query' => array('block-placement' => drupal_html_class($this->entity->id())))
array('query' => array('block-placement' => Html::getClass($this->entity->id())))
);
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\block;
use Drupal\Component\Utility\Html;
use Drupal\Core\Block\BlockManagerInterface;
use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\String;
......@@ -245,7 +246,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'class' => array('draggable'),
),
);
if ($placement && $placement == drupal_html_class($entity_id)) {
if ($placement && $placement == Html::getClass($entity_id)) {
$form['blocks'][$entity_id]['#attributes']['id'] = 'block-placed';
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\block\Tests;
use Drupal\Component\Utility\Html;
use Drupal\simpletest\WebTestBase;
/**
......@@ -74,7 +75,7 @@ function testBlockRenderOrder() {
$id = $return_block->get('id');
if ($return_block_weight = $return_block->get('weight')) {
$this->assertTrue($test_blocks[$id]['weight'] == $return_block_weight, 'Block weight is set as "' . $return_block_weight . '" for ' . $id . ' block.');
$position[$id] = strpos($test_content, drupal_html_class('block-' . $test_blocks[$id]['id']));
$position[$id] = strpos($test_content, Html::getClass('block-' . $test_blocks[$id]['id']));
}
}
$this->assertTrue($position['stark_powered'] < $position['stark_by'], 'Blocks with different weight are rendered in the correct order.');
......
......@@ -7,6 +7,7 @@
namespace Drupal\block\Tests;
use Drupal\Component\Utility\Html;
use Drupal\Core\Cache\Cache;
use Drupal\simpletest\WebTestBase;
use Drupal\Component\Utility\String;
......@@ -200,7 +201,7 @@ public function testBlockThemeSelector() {
$block['region'] = 'content';
$this->drupalPostForm('admin/structure/block/add/system_powered_by_block', $block, t('Save block'));
$this->assertText(t('The block configuration has been saved.'));
$this->assertUrl('admin/structure/block/list/' . $theme . '?block-placement=' . drupal_html_class($block['id']));
$this->assertUrl('admin/structure/block/list/' . $theme . '?block-placement=' . Html::getClass($block['id']));
// Set the default theme and ensure the block is placed.
$theme_settings->set('default', $theme)->save();
......@@ -288,10 +289,10 @@ function moveBlockToRegion(array $block, $region) {
// Confirm that the custom block was found at the proper region.
$xpath = $this->buildXPathQuery('//div[@class=:region-class]//div[@id=:block-id]/*', array(
':region-class' => 'region region-' . drupal_html_class($region),
':region-class' => 'region region-' . Html::getClass($region),
':block-id' => 'block-' . str_replace('_', '-', strtolower($block['id'])),
));
$this->assertFieldByXPath($xpath, NULL, t('Block found in %region_name region.', array('%region_name' => drupal_html_class($region))));
$this->assertFieldByXPath($xpath, NULL, t('Block found in %region_name region.', array('%region_name' => Html::getClass($region))));
}
/**
......
......@@ -7,6 +7,7 @@
namespace Drupal\block\Tests;
use Drupal\Component\Utility\Html;
use Drupal\simpletest\WebTestBase;
/**
......@@ -200,7 +201,7 @@ public function testBlockPlacementIndicator() {
// After adding a block, it will indicate which block was just added.
$this->drupalPostForm('admin/structure/block/add/system_powered_by_block', $block, t('Save block'));
$this->assertUrl('admin/structure/block/list/classy?block-placement=' . drupal_html_class($block['id']));
$this->assertUrl('admin/structure/block/list/classy?block-placement=' . Html::getClass($block['id']));
// Resaving the block page will remove the block indicator.
$this->drupalPostForm(NULL, array(), t('Save blocks'));
......
......@@ -8,6 +8,7 @@
namespace Drupal\block\Tests\Views;
use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\String;
use Drupal\views\Views;
use Drupal\views\Tests\ViewTestBase;
......@@ -63,7 +64,7 @@ public function testBlockCategory() {
// base table.
$arguments = array(
':id' => 'edit-category-lists-views',
':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-1',
':li_class' => 'views-block' . Html::getClass($edit['id']) . '-block-1',
':href' => \Drupal::Url('block.admin_add', array(
'plugin_id' => 'views_block:' . $edit['id'] . '-block_1',
'theme' => 'classy',
......@@ -102,7 +103,7 @@ public function testBlockCategory() {
$arguments = array(
':id' => 'edit-category-lists-views',
':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-2',
':li_class' => 'views-block' . Html::getClass($edit['id']) . '-block-2',
':href' => \Drupal::Url('block.admin_add', array(
'plugin_id' => 'views_block:' . $edit['id'] . '-block_2',
'theme' => 'classy',
......@@ -114,7 +115,7 @@ public function testBlockCategory() {
$arguments = array(
':id' => $category_id,
':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-3',
':li_class' => 'views-block' . Html::getClass($edit['id']) . '-block-3',
':href' => \Drupal::Url('block.admin_add', array(
'plugin_id' => 'views_block:' . $edit['id'] . '-block_3',
'theme' => 'classy',
......
......@@ -7,6 +7,7 @@
namespace Drupal\block_content;
use Drupal\Component\Utility\Html;
use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\EntityStorageInterface;
......@@ -102,7 +103,7 @@ public function form(array $form, FormStateInterface $form_state) {
// Override the default CSS class name, since the user-defined custom block
// type name in 'TYPE-block-form' potentially clashes with third-party class
// names.
$form['#attributes']['class'][0] = drupal_html_class('block-' . $block->bundle() . '-form');
$form['#attributes']['class'][0] = 'block-' . Html::getClass($block->bundle()) . '-form';
$form['langcode'] = array(
'#title' => $this->t('Language'),
......
......@@ -6,6 +6,7 @@
*/
namespace Drupal\block_content\Tests;
use Drupal\Component\Utility\Html;
/**
* Ensures that custom block type functions work correctly.
......@@ -179,7 +180,7 @@ public function testsBlockContentAddTypes() {
$block = reset($blocks);
$this->assertUrl(\Drupal::url('block.admin_add', array('plugin_id' => 'block_content:' . $block->uuid(), 'theme' => $theme), array('absolute' => TRUE)));
$this->drupalPostForm(NULL, array(), t('Save block'));
$this->assertUrl(\Drupal::url('block.admin_display_theme', array('theme' => $theme), array('absolute' => TRUE, 'query' => array('block-placement' => drupal_html_class($edit['info[0][value]'])))));
$this->assertUrl(\Drupal::url('block.admin_display_theme', array('theme' => $theme), array('absolute' => TRUE, 'query' => array('block-placement' => Html::getClass($edit['info[0][value]'])))));
}
else {
$this->fail('Could not load created block.');
......
......@@ -5,6 +5,7 @@
* Callbacks and theming for the CKEditor toolbar configuration UI.
*/
use Drupal\Component\Utility\Html;
use Drupal\Core\Template\Attribute;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Core\Language\LanguageInterface;
......@@ -115,7 +116,7 @@ function template_preprocess_ckeditor_settings_toolbar(&$variables) {
foreach ($active_buttons as $row_number => $button_row) {
foreach ($button_groups[$row_number] as $group_name) {
$variables['active_buttons'][$row_number][$group_name] = array(
'group_name_class' => drupal_html_class($group_name),
'group_name_class' => Html::getClass($group_name),
'buttons' => array(),
);
$buttons = array_filter($button_row, function ($button) use ($group_name) {
......
......@@ -8,6 +8,7 @@
namespace Drupal\comment\Plugin\Field\FieldWidget;
use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
use Drupal\Component\Utility\Html;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\WidgetBase;
use Drupal\Core\Form\FormStateInterface;
......@@ -76,7 +77,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
'#open' => ($items->status != $field_default_values[0]['status']),
'#group' => 'advanced',
'#attributes' => array(
'class' => array('comment-' . drupal_html_class($entity->getEntityTypeId()) . '-settings-form'),
'class' => array('comment-' . Html::getClass($entity->getEntityTypeId()) . '-settings-form'),
),
'#attached' => array(
'library' => array('comment/drupal.comment'),
......
......@@ -7,6 +7,7 @@
namespace Drupal\contextual\Element;
use Drupal\Component\Utility\Html;
use Drupal\Core\Render\Element\RenderElement;
use Drupal\Core\Url;
......@@ -79,7 +80,7 @@ public static function preRenderLinks(array $element) {
// Transform contextual links into parameters suitable for links.html.twig.
$links = array();
foreach ($items as $class => $item) {
$class = drupal_html_class($class);
$class = Html::getClass($class);
$links[$class] = array(
'title' => $item['title'],
'url' => Url::fromRoute(isset($item['route_name']) ? $item['route_name'] : '', isset($item['route_parameters']) ? $item['route_parameters'] : []),
......
......@@ -7,6 +7,7 @@
namespace Drupal\dblog\Controller;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Unicode;
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Xss;
......@@ -199,7 +200,7 @@ public function overview() {
Xss::filter($dblog->link),
),
// Attributes for table row.
'class' => array(drupal_html_class('dblog-' . $dblog->type), $classes[$dblog->severity]),
'class' => array(Html::getClass('dblog-' . $dblog->type), $classes[$dblog->severity]),
);
}
......
......@@ -5,6 +5,7 @@
* Allows administrators to attach custom fields to fieldable types.
*/
use Drupal\Component\Utility\Html;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element;
......@@ -228,7 +229,7 @@ function theme_field_ui_table($variables) {
// Render rows, region by region.
foreach ($elements['#regions'] as $region_name => $region) {
$region_name_class = drupal_html_class($region_name);
$region_name_class = Html::getClass($region_name);
// Add region rows.
if (isset($region['title']) && empty($region['invisible'])) {
......
......@@ -7,6 +7,7 @@
namespace Drupal\field_ui;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\EntityListBuilderInterface;
......@@ -127,7 +128,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $entity_t
);
$table[$name] = array(
'#attributes' => array(
'id' => drupal_html_class($name),
'id' => Html::getClass($name),
),
'label' => array(
'#markup' => String::checkPlain($field->getLabel()),
......
......@@ -7,6 +7,7 @@
namespace Drupal\field_ui;
use Drupal\Component\Utility\Html;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
......@@ -192,7 +193,7 @@ public function tablePreRender($elements) {
}
// Add row id and associate JS settings.
$id = drupal_html_class($name);
$id = Html::getClass($name);
$row['#attributes']['id'] = $id;
if (isset($row['#js_settings'])) {
$row['#js_settings'] += array(
......
......@@ -8,6 +8,7 @@
namespace Drupal\file\Tests;
use Drupal\comment\Entity\Comment;
use Drupal\Component\Utility\Html;
use Drupal\field\Entity\FieldConfig;
use Drupal\field_ui\Tests\FieldUiTestTrait;
......@@ -74,7 +75,7 @@ function testSingleValuedWidget() {
$this->assertNoFieldByXPath('//input[@type="submit"]', t('Remove'), 'After clicking the "Remove" button, it is no longer displayed.');
$this->assertFieldByXpath('//input[@type="submit"]', t('Upload'), 'After clicking the "Remove" button, the "Upload" button is displayed.');
// Test label has correct 'for' attribute.
$label = $this->xpath("//label[@for='edit-" . drupal_clean_css_identifier($field_name) . "-0-upload']");
$label = $this->xpath("//label[@for='edit-" . Html::cleanCssIdentifier($field_name) . "-0-upload']");
$this->assertTrue(isset($label[0]), 'Label for upload found.');
// Save the node and ensure it does not have the file.
......
......@@ -8,6 +8,7 @@
* API pattern.
*/
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Form\FormStateInterface;
......@@ -520,7 +521,7 @@ function node_is_page(NodeInterface $node) {
function node_preprocess_html(&$variables) {
// If on an individual node page, add the node type to body classes.
if (($node = \Drupal::routeMatch()->getParameter('node')) && $node instanceof NodeInterface) {
$variables['attributes']['class'][] = drupal_html_class('node--type-' . $node->getType());
$variables['attributes']['class'][] = Html::getClass('node--type-' . $node->getType());
}
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Form;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\String;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
......@@ -116,7 +117,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
$form['#action'] = _url($view->display_handler->getUrl());
$form['#theme'] = $view->buildThemeFunctions('views_exposed_form');
$form['#id'] = drupal_clean_css_identifier('views_exposed_form-' . String::checkPlain($view->storage->id()) . '-' . String::checkPlain($display['id']));
$form['#id'] = Html::cleanCssIdentifier('views_exposed_form-' . String::checkPlain($view->storage->id()) . '-' . String::checkPlain($display['id']));
// $form['#attributes']['class'] = array('views-exposed-form');
/** @var \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase $exposed_form_plugin */
......
......@@ -325,7 +325,7 @@ public function elementClasses($row_index = NULL) {
$classes = explode(' ', $this->options['element_class']);
foreach ($classes as &$class) {
$class = $this->tokenizeValue($class, $row_index);
$class = drupal_clean_css_identifier($class);
$class = Html::cleanCssIdentifier($class);
}
return implode(' ', $classes);
}
......@@ -375,7 +375,7 @@ public function elementLabelClasses($row_index = NULL) {
$classes = explode(' ', $this->options['element_label_class']);
foreach ($classes as &$class) {
$class = $this->tokenizeValue($class, $row_index);
$class = drupal_clean_css_identifier($class);
$class = Html::cleanCssIdentifier($class);
}
return implode(' ', $classes);
}
......@@ -387,7 +387,7 @@ public function elementWrapperClasses($row_index = NULL) {
$classes = explode(' ', $this->options['element_wrapper_class']);
foreach ($classes as &$class) {
$class = $this->tokenizeValue($class, $row_index);
$class = drupal_clean_css_identifier($class);
$class = Html::cleanCssIdentifier($class);
}
return implode(' ', $classes);
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Plugin\views\style;
use Drupal\Component\Utility\Html;
use Drupal\Core\Form\FormStateInterface;
/**
......@@ -122,7 +123,7 @@ public function getCustomClass($result_index, $type) {
$classes = explode(' ', $class);
foreach ($classes as &$class) {
$class = drupal_clean_css_identifier($class);
$class = Html::cleanCssIdentifier($class);
}
return implode(' ', $classes);
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Plugin\views\style;
use Drupal\Component\Utility\Html;
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Plugin\views\PluginBase;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
......@@ -217,7 +218,7 @@ public function getRowClass($row_index) {
$classes = explode(' ', $class);
foreach ($classes as &$class) {
$class = drupal_clean_css_identifier($class);
$class = Html::cleanCssIdentifier($class);
}
return implode(' ', $classes);
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\views\Tests\Plugin;
use Drupal\Component\Utility\Html;
use Drupal\views\Tests\ViewTestBase;
use Drupal\views\ViewExecutable;
use Drupal\views\Views;
......@@ -189,7 +190,7 @@ public function testInputRequired() {
* The form ID.
*/
protected function getExpectedExposedFormId(ViewExecutable $view) {
return drupal_clean_css_identifier('views-exposed-form-' . $view->storage->id() . '-' . $view->current_display);
return Html::cleanCssIdentifier('views-exposed-form-' . $view->storage->id() . '-' . $view->current_display);
}
}
......@@ -9,6 +9,7 @@
* incoming page and block requests.
*/
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\String;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Database\Query\AlterableInterface;
......@@ -194,7 +195,7 @@ function views_theme($existing, $type, $theme, $path) {
// implement hook_theme() by itself.
if (!function_exists('theme_' . $def['theme'])) {
$hooks[$def['theme']]['path'] .= '/templates';
$hooks[$def['theme']]['template'] = drupal_clean_css_identifier($def['theme']);
$hooks[$def['theme']]['template'] = Html::cleanCssIdentifier($def['theme']);
}
else {
$hooks[$def['theme']]['function'] = 'theme_' . $def['theme'];
......
......@@ -135,7 +135,7 @@ function template_preprocess_views_view_fields(&$variables) {
$object->separator = Xss::filterAdmin($variables['options']['separator']);
}
$object->class = drupal_clean_css_identifier($id);
$object->class = Html::cleanCssIdentifier($id);
$previous_inline = $object->inline;
$object->inline_html = $object->handler->elementWrapperType(TRUE, TRUE);
......@@ -453,7 +453,7 @@ function template_preprocess_views_view_table(&$variables) {
foreach ($columns as $field => $column) {
// Create a second variable so we can easily find what fields we have and
// what the CSS classes should be.
$variables['fields'][$field] = drupal_clean_css_identifier($field);
$variables['fields'][$field] = Html::cleanCssIdentifier($field);
if ($active == $field) {
$variables['fields'][$field] .= ' active';
}
......@@ -508,7 +508,7 @@ function template_preprocess_views_view_table(&$variables) {
}
// Add a CSS align class to each field if one was set.
if (!empty($options['info'][$field]['align'])) {
$variables['header'][$field]['attributes']['class'][] = drupal_clean_css_identifier($options['info'][$field]['align']);
$variables['header'][$field]['attributes']['class'][] = Html::cleanCssIdentifier($options['info'][$field]['align']);
}
// Add a header label wrapper if one was selected.
if ($variables['header'][$field]['content']) {
......@@ -529,7 +529,7 @@ function template_preprocess_views_view_table(&$variables) {
// Add a CSS align class to each field if one was set.
if (!empty($options['info'][$field]['align'])) {
$variables['fields'][$field] .= ' ' . drupal_clean_css_identifier($options['info'][$field]['align']);
$variables['fields'][$field] .= ' ' . Html::cleanCssIdentifier($options['info'][$field]['align']);
}
// Render each field into its appropriate column.
......@@ -835,7 +835,7 @@ function template_preprocess_views_view_list(&$variables) {
// Fetch classes from handler options.
if ($handler->options['class']) {
$class = explode(' ', $handler->options['class']);
$class = array_map('drupal_clean_css_identifier', $class);
$class = array_map('\Drupal\Component\Utility\Html::cleanCssIdentifier', $class);
// Initialize a new attribute class for $class.
$variables['list']['attributes'] = new Attribute(array('class' => $class));
......@@ -844,7 +844,7 @@ function template_preprocess_views_view_list(&$variables) {
// Fetch wrapper classes from handler options.
if ($handler->options['wrapper_class']) {
$wrapper_class = explode(' ', $handler->options['wrapper_class']);
$variables['attributes']['class'] = array_map('drupal_clean_css_identifier', $wrapper_class);
$variables['attributes']['class'] = array_map('\Drupal\Component\Utility\Html::cleanCssIdentifier', $wrapper_class);
}
$variables['list']['type'] = $handler->options['type'];
......
......@@ -7,6 +7,7 @@
namespace Drupal\views_ui;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Ajax\AjaxResponse;
......@@ -910,7 +911,7 @@ public function buildOptionForm(ViewUI $view, $id, $option, $display) {
}
}
}
$option_build['#attributes']['class'][] = drupal_clean_css_identifier($display_id . '-' . $id);
$option_build['#attributes']['class'][] = Html::cleanCssIdentifier($display_id . '-' . $id);
return $option_build;
}
......@@ -1080,7 +1081,7 @@ public function getFormBucket(ViewUI $view, $type, $display) {
'type' => $type,
'id' => $id,
), array('attributes' => $link_attributes, 'html' => TRUE)));
$build['fields'][$id]['#class'][] = drupal_clean_css_identifier($display['id']. '-' . $type . '-' . $id);
$build['fields'][$id]['#class'][] = Html::cleanCssIdentifier($display['id']. '-' . $type . '-' . $id);
if ($executable->display_handler->useGroupBy() && $handler->usesGroupBy()) {
$build['fields'][$id]['#settings_links'][] = $this->l('<span class="label">' . $this->t('Aggregation settings') . '</span>', new Url('views_ui.form_handler_group', array(
......
......@@ -18,7 +18,7 @@ function seven_preprocess_html(&$variables) {
if ($suggestions = theme_get_suggestions($path_args, 'page', '-')) {
foreach ($suggestions as $suggestion) {
if ($suggestion === 'page-node-edit' || strpos($suggestion, 'page-node-add') !== FALSE) {
$variables['attributes']['class'][] = drupal_html_class('node-form-layout');
$variables['attributes']['class'][] = 'node-form-layout';
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment