| 1 |
<?php |
<?php |
| 2 |
// $Id: weight.views.inc,v 1.7 2009/01/02 01:46:55 nancyw Exp $ |
// $Id: weight.views.inc,v 1.2.2.1 2009/01/26 00:28:54 nancyw Exp $ |
| 3 |
/** |
/** |
| 4 |
* @file |
* @file |
| 5 |
* Views2 support for Weight module. |
* Views2 support for Weight module. |
| 6 |
*/ |
*/ |
| 7 |
/** |
/** |
| 8 |
* Implementation of hook_views_data() |
* Implementation of hook_views_data(). |
| 9 |
*/ |
*/ |
| 10 |
function weight_views_data() { |
function weight_views_data() { |
| 11 |
$data['node_weight'] = array( |
$data['node_weight'] = array( |
| 58 |
'uses fields' => TRUE, |
'uses fields' => TRUE, |
| 59 |
'uses options' => TRUE, |
'uses options' => TRUE, |
| 60 |
'type' => 'normal', |
'type' => 'normal', |
| 61 |
), |
), |
| 62 |
), |
), |
| 63 |
); |
); |
| 64 |
} |
} |
| 65 |
|
|
| 66 |
/** |
/** |
| 69 |
function weight_views_handlers() { |
function weight_views_handlers() { |
| 70 |
return array( |
return array( |
| 71 |
'info' => array( |
'info' => array( |
| 72 |
'path' => drupal_get_path('module', 'weight') /*.'/handlers'*/, |
'path' => drupal_get_path('module', 'weight') /* .'/handlers' */, |
| 73 |
), |
), |
| 74 |
'handlers' => array( |
'handlers' => array( |
| 75 |
'weight_handler_field_sticky' => array( |
'weight_handler_field_sticky' => array( |
| 76 |
'parent' => 'views_handler_field_numeric', |
'parent' => 'views_handler_field_numeric', |
| 77 |
), |
), |
| 78 |
'weight_handler_sort' => array( |
'weight_handler_sort' => array( |
| 79 |
'parent' => 'views_handler_sort', |
'parent' => 'views_handler_sort', |
| 80 |
), |
), |
| 81 |
), |
), |
| 82 |
); |
); |
| 83 |
} |
} |
| 84 |
|
|
| 85 |
/** |
/** |
| 127 |
$header[$field] = l($label . $image, $_GET['q'], $link_options); |
$header[$field] = l($label . $image, $_GET['q'], $link_options); |
| 128 |
} |
} |
| 129 |
} |
} |
| 130 |
|
|
| 131 |
// Create a second variable so we can easily find what fields we have and what the |
// Create a second variable so we can easily find what fields we have and what the |
| 132 |
// CSS classes should be. |
// CSS classes should be. |
| 133 |
$weight_fields[$field] = views_css_safe($field); |
$weight_fields[$field] = views_css_safe($field); |
| 192 |
if (is_numeric($count)) { |
if (is_numeric($count)) { |
| 193 |
foreach ($row as $field => $content) { |
foreach ($row as $field => $content) { |
| 194 |
$nid = $row['nid_hidden']; |
$nid = $row['nid_hidden']; |
| 195 |
if (substr($field, 0, 6) == 'weight') { |
if (drupal_substr($field, 0, 6) == 'weight') { |
| 196 |
$form['rows'][$count][$field] = array( |
$form['rows'][$count][$field] = array( |
| 197 |
'#default_value' => $content, |
'#default_value' => $content, |
| 198 |
'#type' => 'weight', |
'#type' => 'weight', |