| 1 |
<?php |
<?php |
| 2 |
// $Id: nd.module,v 1.1.2.116 2009/10/18 18:26:20 swentel Exp $ |
// $Id: nd.module,v 1.1.2.117 2009/10/20 16:09:13 swentel Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 70 |
$nd_display_settings = variable_get('nd_display_settings_'. $node->type, array()); |
$nd_display_settings = variable_get('nd_display_settings_'. $node->type, array()); |
| 71 |
|
|
| 72 |
// Get all fields. |
// Get all fields. |
| 73 |
$fields = ds_get_fields($node->type, $node->has_body, $node->build_mode, 'nd'); |
$extra = array('has_body' => $node->has_body); |
| 74 |
|
$fields = ds_get_fields('nd', $node->type, $node->build_mode, $extra); |
| 75 |
if (!empty($fields)) { |
if (!empty($fields)) { |
| 76 |
foreach ($fields as $key => $field) { |
foreach ($fields as $key => $field) { |
| 77 |
|
|
| 99 |
// on the $node object, the field name and the complete field array. |
// on the $node object, the field name and the complete field array. |
| 100 |
switch ($field['type']) { |
switch ($field['type']) { |
| 101 |
case DS_FIELD_PREPROCESS: |
case DS_FIELD_PREPROCESS: |
| 102 |
case ND_FIELD_IGNORE: |
case DS_FIELD_IGNORE: |
| 103 |
break; |
break; |
| 104 |
case DS_FIELD_CUSTOM: |
case DS_FIELD_CUSTOM: |
| 105 |
case DS_FIELD_OVERRIDABLE: |
case DS_FIELD_OVERRIDABLE: |
| 106 |
case DS_FIELD_OVERRIDDEN: |
case DS_FIELD_OVERRIDDEN: |
| 107 |
ds_eval_code($key, $field, $node); |
ds_eval_code($key, $field, $node, 'node'); |
| 108 |
break; |
break; |
| 109 |
case DS_FIELD_BLOCK: |
case DS_FIELD_BLOCK: |
| 110 |
ds_eval_block($key, $field, $node); |
ds_eval_block($key, $field, $node, 'node'); |
| 111 |
break; |
break; |
| 112 |
case DS_FIELD_FUNCTION: |
case DS_FIELD_FUNCTION: |
| 113 |
if (isset($field['file'])) { |
if (isset($field['file'])) { |
| 232 |
$node_display->region_classes = $region_classes; |
$node_display->region_classes = $region_classes; |
| 233 |
|
|
| 234 |
// Plugins. |
// Plugins. |
| 235 |
ds_plugins_process($vars, $node_display, $nd_display_settings, 'nd'); |
ds_plugins_process('nd', 'node', $nd_display_settings, $vars, $node_display); |
| 236 |
|
|
| 237 |
// Add classes based on node regions. |
// Add classes based on node regions. |
| 238 |
$nd_middle_classes = 'no-sidebars'; |
$nd_middle_classes = 'no-sidebars'; |
| 320 |
} |
} |
| 321 |
|
|
| 322 |
/** |
/** |
| 323 |
* Implementation of hook_nd_fields(). |
* Implementation of hook_ds_fields(). |
| 324 |
*/ |
*/ |
| 325 |
function nd_nd_fields($node_type, $has_body, $build_mode) { |
function nd_ds_fields($type_name, $build_mode, $extra) { |
| 326 |
|
|
| 327 |
$fields = array( |
$fields = array( |
| 328 |
'title' => array( |
'title' => array( |
| 364 |
); |
); |
| 365 |
|
|
| 366 |
// Check for body. |
// Check for body. |
| 367 |
if ($has_body == TRUE) { |
if ($extra['has_body'] == TRUE) { |
| 368 |
$fields['body'] = array( |
$fields['body'] = array( |
| 369 |
'title' => t('Core body'), |
'title' => t('Core body'), |
| 370 |
'formatters' => array( |
'formatters' => array( |
| 382 |
); |
); |
| 383 |
} |
} |
| 384 |
|
|
| 385 |
if (module_exists('upload') && $build_mode != 'teaser' && variable_get("upload_$node_type", 1)) { |
if (module_exists('upload') && $build_mode != 'teaser' && variable_get("upload_$type_name", 1)) { |
| 386 |
$fields['files'] = array( |
$fields['files'] = array( |
| 387 |
'title' => t('Core upload'), |
'title' => t('Core upload'), |
| 388 |
'type' => DS_FIELD_IGNORE, |
'type' => DS_FIELD_IGNORE, |