function template_preprocess_weight_view_weight_form in Weight 7
Prepare the weight form for its template file.
File
- ./
weight.module, line 370 - This module uses the sticky column of the node table to add weighting to nodes.
Code
function template_preprocess_weight_view_weight_form(&$vars) {
$form = $vars['form'];
$vars['title'] = $form['#variables']['title'];
$vars['header'] = $form['#variables']['header'];
$vars['class'] = $form['#variables']['class'];
$vars['id'] = $form['#variables']['id'];
$vars['fields'] = $form['#variables']['fields'];
foreach ($form['rows'] as $count => $item) {
if (is_numeric($count)) {
foreach ($item as $field => $value) {
if (drupal_substr($field, 0, 1) != '#' && $value['#type'] != 'hidden') {
if (drupal_substr($field, 0, 6) == 'weight') {
$value['#attributes']['class'] = array(
'weight_dragger',
);
}
if ($value['#type'] == 'value') {
$vars['rows'][$count][$field] = $value['#value'];
}
else {
$vars['rows'][$count][$field] = drupal_render($value);
}
}
}
}
}
unset($form['rows']);
$vars['submit'] = drupal_render_children($form);
}