Commit 28bdcca2 authored by dawehner's avatar dawehner Committed by tim.plunkett

Issue #1790320 by dawehner: Let views_field_rewrite_elements() use config().

parent 76c51dc7
......@@ -21,3 +21,15 @@ ui:
always_live_preview: '1'
always_live_preview_button: '1'
exposed_filter_any_label: 'new_any'
field_rewrite_elements:
div: DIV
span: SPAN
h1: H1
h2: H2
h3: H3
h4: H4
h5: H5
h6: H6
p: P
strong: STRONG
em: EM
......@@ -270,21 +270,11 @@ function get_elements() {
static $elements = NULL;
if (!isset($elements)) {
// @todo Add possible html5 elements.
$elements = variable_get('views_field_rewrite_elements', array(
'' => t('- Use default -'),
'0' => t('- None -'),
'div' => 'DIV',
'span' => 'SPAN',
'h1' => 'H1',
'h2' => 'H2',
'h3' => 'H3',
'h4' => 'H4',
'h5' => 'H5',
'h6' => 'H6',
'p' => 'P',
'strong' => 'STRONG',
'em' => 'EM',
));
$elements = array(
'' => t(' - Use default -'),
'0' => t('- None -')
);
$elements += config('views.settings')->get('field_rewrite_elements');
}
return $elements;
......
......@@ -476,6 +476,8 @@ public function testFieldClasses() {
'em',
'marquee'
);
sort($expected_elements);
$this->assertEqual(array_keys($element_types), $expected_elements);
}
......
......@@ -17,9 +17,7 @@ function views_test_data_schema() {
*/
function views_test_data_install() {
// Add the marquee tag to possible html elements to test the field handler.
$default_values = array(
'' => t('- Use default -'),
'0' => t('- None -'),
$values = array(
'div' => 'DIV',
'span' => 'SPAN',
'h1' => 'H1',
......@@ -31,7 +29,7 @@ function views_test_data_install() {
'p' => 'P',
'strong' => 'STRONG',
'em' => 'EM',
'marquee' => 'MARQUEE'
);
$default_values['marquee'] = 'MARQUEE';
variable_set('views_field_rewrite_elements', $default_values);
config('views.settings')->set('field_rewrite_elements', $values)->save();
}
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