function theme_webform_workflow_state_color in Webform Workflow 7
Simple theme function to add color to some text.
3 theme calls to theme_webform_workflow_state_color()
- theme_webform_workflow_state in ./
webform_workflow.module - Theme a webform workflow state.
- WebformWorkflowStateInlineEntityFormController::formatColor in includes/
webform_workflow_state.inline_entity_form.inc - Formatter callback for a state color.
- webform_workflow_views_handler_field_state::render in includes/
views/ handlers/ webform_workflow_views_handler_field_state.inc - Overrides parent::get_value().
File
- ./
webform_workflow.module, line 843 - A simple workflow module for webforms.
Code
function theme_webform_workflow_state_color($variables) {
$content = $variables['content'];
if (empty($variables['html'])) {
$content = check_plain($content);
}
$attributes = array(
'class' => array(
'webform-workflow-state-label',
),
);
$color_suffix = $variables['color'] ? $variables['color'] : 'none';
$attributes['class'][] = drupal_html_class('webform-workflow-state-color-' . $color_suffix);
$attributes['class'] = array_merge($variables['classes_array'], $attributes['class']);
return '<span' . drupal_attributes($attributes) . '>' . $content . '</span>';
}