Commit ab61b252 authored by catch's avatar catch

Issue #2024681 by jenlampton: Remove theme_meter() from core.

parent 2c4e8fe6
......@@ -2399,49 +2399,6 @@ function theme_progress_bar($variables) {
return $output;
}
/**
* Returns HTML for a meter.
*
* @param $variables
* An associative array containing:
* - display_value: The textual representation of the meter bar.
* - form: A string specifying one or more forms to which the <meter> element
* belongs separated by spaces.
* - high: A number specifying the range that is considered to be a high
* value.
* - low: A number specifying the range that is considered to be a low value.
* - max: A number specifying the maximum value of the range.
* - min: A number specifying the minimum value of the range.
* - optimum: A number specifying what value is the optimal value for the
* gauge.
* - value: A number specifying the current value of the gauge.
* - percentage: A number specifying the current percentage of the gauge.
* - attributes: Associative array of attributes to be placed in the meter
* tag.
*/
function theme_meter($variables) {
$attributes = $variables['attributes'];
foreach (array('form', 'high', 'low', 'max', 'min', 'optimum', 'value') as $attribute) {
if (!empty($variables[$attribute])) {
// This function was initially designed for the <meter> tag, but due to
// the lack of browser and styling support for it, we're currently using
// it's attributes as HTML5 data attributes.
$attributes['data-' . $attribute] = $variables[$attribute];
}
}
$output = '<div' . new Attribute($attributes) . '>';
$output .= ' <div style="width: '. $variables['percentage'] .'%;" class="foreground"></div>';
$output .= "</div>\n";
if (!empty($variables['display_value'])) {
$output .= '<div class="percent">' . $variables['display_value'] . '</div>';
}
return $output;
}
/**
* Returns HTML for an indentation div; used for drag and drop tables.
*
......@@ -3118,9 +3075,6 @@ function drupal_common_theme() {
'table' => array(
'variables' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'sticky' => TRUE, 'responsive' => TRUE, 'empty' => ''),
),
'meter' => array(
'variables' => array('display_value' => NULL, 'form' => NULL, 'high' => NULL, 'low' => NULL, 'max' => NULL, 'min' => NULL, 'optimum' => NULL, 'value' => NULL, 'percentage' => NULL, 'attributes' => array()),
),
'tablesort_indicator' => array(
'variables' => array('style' => NULL),
'template' => 'tablesort-indicator',
......
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