Projet

Général

Profil

Révision 599a39cd

Ajouté par Assos Assos il y a environ 3 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/date/date.migrate.inc
1 1
<?php
2

  
2 3
/**
3 4
 * @file
4 5
 * Support for migration into Date fields.
......
9 10
}
10 11

  
11 12
/**
12
 * Implements hook_migrate_api().
13
 * Support for migration into Date fields.
13 14
 */
14
function date_migrate_api() {
15
  $api = array(
16
    'api' => 2,
17
    'field handlers' => array('DateMigrateFieldHandler'),
18
  );
19
  return $api;
20
}
21

  
22 15
class DateMigrateFieldHandler extends MigrateFieldHandler {
23 16

  
24 17
  /**
......
112 105

  
113 106
      // Legacy support for JSON containing a set of properties - deprecated
114 107
      // now that we have subfields.
115
      if (!empty($from) && $from{0} == '{') {
108
      if (!empty($from) && $from[0] == '{') {
116 109
        $properties = drupal_json_decode($from);
117 110
        $from = $properties['from'];
118 111
        // Properties passed in with the date override any set via arguments.
......
127 120
        }
128 121
      }
129 122

  
130
      // Missing data? Create an empty value and return;
131
      // Don't try to turn the empty value into a bogus
132
      // timestamp for 'now'.
123
      // Missing data? Create an empty value and return; Don't try to turn the
124
      // empty value into a bogus timestamp for 'now'.
133 125
      if (empty($from)) {
134 126
        $return[$language][$delta]['value'] = NULL;
135 127
        $return[$language][$delta]['timezone'] = NULL;
......
171 163
            $to = format_date($to, 'custom', 'Y-m-d\TH:i:s', $timezone);
172 164
          }
173 165
          break;
174

  
175
        default:
176
          break;
177 166
      }
178 167

  
179 168
      // Handle repeats, coming in as RRULEs. Many field instances may be
......
212 201
      'to' => t('End date date'),
213 202
    );
214 203
  }
204

  
215 205
}

Formats disponibles : Unified diff