Issue #1915026 by steveoliver, 2ndmile, damiankloip, echeese, eromero1, joelpittet, rvilar, waynethayer, Hydra, drupalninja99, dsdeiz: Convert theme_views_ui_container() to Twig.
parent
337b3709b1
commit
637beb94d0
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
namespace Drupal\views_ui\Tests;
|
namespace Drupal\views_ui\Tests;
|
||||||
|
|
||||||
|
use Drupal\Component\Utility\String;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the handling of displays in the UI, adding removing etc.
|
* Tests the handling of displays in the UI, adding removing etc.
|
||||||
*/
|
*/
|
||||||
|
@ -251,7 +253,7 @@ class DisplayTest extends UITestBase {
|
||||||
// Assert that the expected text is found in each area category.
|
// Assert that the expected text is found in each area category.
|
||||||
foreach ($areas as $type => $class) {
|
foreach ($areas as $type => $class) {
|
||||||
$element = $this->xpath('//div[contains(@class, :class)]/div', array(':class' => $class));
|
$element = $this->xpath('//div[contains(@class, :class)]/div', array(':class' => $class));
|
||||||
$this->assertEqual((string) $element[0], "The selected display type does not utilize $type plugins");
|
$this->assertEqual((string) $element[0], String::format('The selected display type does not utilize @type plugins', array('@type' => $type)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
{#
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Default theme implementation for a generic views UI container/wrapper.
|
||||||
|
*
|
||||||
|
* Available variables:
|
||||||
|
* - attributes: HTML attributes to apply to the container element.
|
||||||
|
* - children: The remaining elements such as dropbuttons and tabs.
|
||||||
|
*
|
||||||
|
* @see template_preprocess_views_ui_container()
|
||||||
|
*
|
||||||
|
* @ingroup themeable
|
||||||
|
*/
|
||||||
|
#}
|
||||||
|
<div{{ attributes }}>{{ children }}</div>
|
|
@ -162,7 +162,8 @@ function views_ui_theme() {
|
||||||
// Generic container wrapper, to use instead of theme_container when an id
|
// Generic container wrapper, to use instead of theme_container when an id
|
||||||
// is not desired.
|
// is not desired.
|
||||||
'views_ui_container' => array(
|
'views_ui_container' => array(
|
||||||
'render element' => 'element',
|
'variables' => array('children' => NULL, 'attributes' => array()),
|
||||||
|
'template' => 'views-ui-container',
|
||||||
'file' => 'views_ui.theme.inc',
|
'file' => 'views_ui.theme.inc',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -7,14 +7,6 @@
|
||||||
|
|
||||||
use Drupal\Core\Template\Attribute;
|
use Drupal\Core\Template\Attribute;
|
||||||
|
|
||||||
/**
|
|
||||||
* Generic <div> container function.
|
|
||||||
*/
|
|
||||||
function theme_views_ui_container($variables) {
|
|
||||||
$element = $variables['element'];
|
|
||||||
return '<div' . new Attribute($element['#attributes']) . '>' . $element['#children'] . '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepares variables for Views UI display tab setting templates.
|
* Prepares variables for Views UI display tab setting templates.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue