function theme_wsclient_ui_global_parameter_form in Web service client 7
Themes the global parameters form for editing the used parameters.
1 theme call to theme_wsclient_ui_global_parameter_form()
- wsclient_service_form in wsclient_ui/
wsclient_ui.inc - Provides a form to add, edit and clone web service descriptions.
File
- wsclient_ui/
wsclient_ui.inc, line 986 - WSClient UI - implements service description management and configuration screens.
Code
function theme_wsclient_ui_global_parameter_form($variables) {
$elements = $variables['element'];
$table['#theme'] = 'table';
$table['#header'] = array(
t('Name'),
t('Default value'),
);
$table['#attributes']['id'] = 'rules-' . drupal_html_id($elements['#title']) . '-id';
foreach (element_children($elements['items']) as $key) {
$element =& $elements['items'][$key];
// Add special classes to be used for tabledrag.js.
$element['weight']['#attributes']['class'] = array(
'rules-element-weight',
);
$row = array();
$row[] = array(
'data' => $element['name'],
);
$row[] = array(
'data' => $element['default_value'],
);
$row = array(
'data' => $row,
) + $element['#attributes'];
$row['class'][] = 'draggable';
$table['#rows'][] = $row;
}
$elements['items']['#printed'] = TRUE;
// Theme it like a form item, but with the description above the content.
$attributes['class'][] = 'form-item';
$attributes['class'][] = 'rules-variables-form';
$output = '<div' . drupal_attributes($attributes) . '>' . "\n";
$output .= theme('form_element_label', $variables);
if (!empty($elements['#description'])) {
$output .= ' <div class="description">' . $elements['#description'] . "</div>\n";
}
$output .= ' ' . drupal_render($table) . "\n";
// Add in any further children elements.
foreach (element_children($elements, TRUE) as $key) {
$output .= drupal_render($elements[$key]);
}
$output .= "</div>\n";
return $output;
}