/[drupal]/contributions/modules/nd/nd.module
ViewVC logotype

Diff of /contributions/modules/nd/nd.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.117, Tue Oct 20 16:09:13 2009 UTC revision 1.1.2.118, Tue Oct 20 18:41:48 2009 UTC
# Line 1  Line 1 
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
# Line 70  function _nd_nodeapi(&$node) { Line 70  function _nd_nodeapi(&$node) {
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    
# Line 98  function _nd_nodeapi(&$node) { Line 99  function _nd_nodeapi(&$node) {
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'])) {
# Line 231  function _nd_preprocess_node(&$vars, $ho Line 232  function _nd_preprocess_node(&$vars, $ho
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';
# Line 319  function nd_ds_buildmodes_alter(&$build_ Line 320  function nd_ds_buildmodes_alter(&$build_
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(
# Line 363  function nd_nd_fields($node_type, $has_b Line 364  function nd_nd_fields($node_type, $has_b
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(
# Line 381  function nd_nd_fields($node_type, $has_b Line 382  function nd_nd_fields($node_type, $has_b
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,

Legend:
Removed from v.1.1.2.117  
changed lines
  Added in v.1.1.2.118

  ViewVC Help
Powered by ViewVC 1.1.2