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