| 1 |
<?php // $Id: send.theme.inc,v 1.4 2009/05/22 17:18:35 vauxia Exp $ |
<?php // $Id: send.theme.inc,v 1.5 2009/08/07 01:00:05 vauxia Exp $ |
| 2 |
|
|
| 3 |
function send_theme_theme() { |
function send_theme_theme() { |
| 4 |
$path = drupal_get_path('module', 'send') .'/theme'; |
$path = drupal_get_path('module', 'send') .'/theme'; |
| 123 |
|
|
| 124 |
function theme_send_draggable($element) { |
function theme_send_draggable($element) { |
| 125 |
$id = $element['#id'] .'-table'; |
$id = $element['#id'] .'-table'; |
| 126 |
|
$weight_class = $element['#id'] .'-weight'; |
| 127 |
|
|
| 128 |
$rows = array(); |
$rows = array(); |
| 129 |
foreach (element_children($element) as $key) { |
foreach (element_children($element) as $key) { |
| 130 |
|
$weight = ""; |
| 131 |
|
if (isset($element[$key]['weight'])) { |
| 132 |
|
$element[$key]['weight']['#attributes']['class'] = $weight_class; |
| 133 |
|
$weight = drupal_render($element[$key]['weight']); |
| 134 |
|
} |
| 135 |
|
$content = drupal_render($element[$key]); |
| 136 |
|
|
| 137 |
$rows[] = array( |
$rows[] = array( |
| 138 |
'data' => array(drupal_render($element[$key])), |
'data' => array($content, $weight), |
| 139 |
'class' => 'draggable', |
'class' => 'draggable', |
| 140 |
); |
); |
| 141 |
} |
} |
| 142 |
|
|
| 143 |
drupal_add_tabledrag($id, 'order', 'sibling', $id .'-weight'); |
drupal_add_tabledrag($id, 'order', 'sibling', $weight); |
| 144 |
|
|
| 145 |
$output = theme('table', array(), $rows, array('id' => $id)); |
$output = theme('table', array(), $rows, array('id' => $id)); |
| 146 |
return $output; |
return $output; |