Révision ed9a13f1
Ajouté par Assos Assos il y a plus de 3 ans
drupal7/sites/all/modules/feeds/plugins/FeedsParser.inc | ||
---|---|---|
46 | 46 |
public function currentItem() { |
47 | 47 |
return empty($this->current_item) ? NULL : $this->current_item; |
48 | 48 |
} |
49 |
|
|
49 | 50 |
} |
50 | 51 |
|
51 | 52 |
/** |
... | ... | |
70 | 71 |
* @param $fetcher_result |
71 | 72 |
* FeedsFetcherResult returned by fetcher. |
72 | 73 |
*/ |
73 |
public abstract function parse(FeedsSource $source, FeedsFetcherResult $fetcher_result);
|
|
74 |
abstract public function parse(FeedsSource $source, FeedsFetcherResult $fetcher_result);
|
|
74 | 75 |
|
75 | 76 |
/** |
76 | 77 |
* Clear all caches for results for given source. |
... | ... | |
89 | 90 |
* @return |
90 | 91 |
* An array of mapping sources, or FALSE if the sources can be defined by |
91 | 92 |
* typing a value in a text field. |
92 |
* |
|
93 |
* Example: |
|
94 | 93 |
* @code |
95 | 94 |
* array( |
96 | 95 |
* 'title' => t('Title'), |
... | ... | |
164 | 163 |
return $node->uid; |
165 | 164 |
} |
166 | 165 |
break; |
166 |
|
|
167 | 167 |
case 'parent:nid': |
168 | 168 |
return $source->feed_nid; |
169 | 169 |
} |
... | ... | |
185 | 185 |
public function providesSourceTitle() { |
186 | 186 |
return FALSE; |
187 | 187 |
} |
188 |
|
|
188 | 189 |
} |
189 | 190 |
|
190 | 191 |
/** |
... | ... | |
194 | 195 |
* @see FeedsEnclosure |
195 | 196 |
*/ |
196 | 197 |
class FeedsElement { |
197 |
// The standard value of this element. This value can contain be a simple type, |
|
198 |
// a FeedsElement or an array of either. |
|
198 |
|
|
199 |
/** |
|
200 |
* The standard value of this element. This value can contain be a simple |
|
201 |
* type, a FeedsElement or an array of either. |
|
202 |
*/ |
|
199 | 203 |
protected $value; |
200 | 204 |
|
201 | 205 |
/** |
... | ... | |
231 | 235 |
} |
232 | 236 |
return (string) $this->getValue(); |
233 | 237 |
} |
238 |
|
|
234 | 239 |
} |
235 | 240 |
|
236 | 241 |
/** |
... | ... | |
272 | 277 |
public function getValue() { |
273 | 278 |
return $this->name; |
274 | 279 |
} |
280 |
|
|
275 | 281 |
} |
276 | 282 |
|
277 | 283 |
/** |
... | ... | |
279 | 285 |
*/ |
280 | 286 |
class FeedsGeoTermElement extends FeedsTermElement { |
281 | 287 |
public $lat, $lon, $bound_top, $bound_right, $bound_bottom, $bound_left, $geometry; |
288 |
|
|
282 | 289 |
/** |
283 | 290 |
* @param $term |
284 | 291 |
* An array or a stdClass object that is a Drupal taxonomy term. Can include |
... | ... | |
287 | 294 |
public function __construct($term) { |
288 | 295 |
parent::__construct($term); |
289 | 296 |
} |
297 |
|
|
290 | 298 |
} |
291 | 299 |
|
292 | 300 |
/** |
... | ... | |
449 | 457 |
* expected. Don't use trailing slashes unless it's a streamwrapper scheme. |
450 | 458 |
* @param int $replace |
451 | 459 |
* Replace behavior when the destination file already exists. |
452 |
* @see file_save_data() |
|
453 | 460 |
* |
454 |
* @return stdClass|FALSE |
|
461 |
* @see file_save_data() |
|
462 |
* |
|
463 |
* @return object|false |
|
455 | 464 |
* A Drupal temporary file object of the enclosed resource or FALSE if the |
456 | 465 |
* value is empty. |
457 | 466 |
* |
... | ... | |
517 | 526 |
return $file; |
518 | 527 |
} |
519 | 528 |
} |
529 |
|
|
520 | 530 |
} |
521 | 531 |
|
522 | 532 |
/** |
... | ... | |
526 | 536 |
*/ |
527 | 537 |
class FeedsDateTimeElement extends FeedsElement { |
528 | 538 |
|
529 |
// Start date and end date. |
|
539 |
/** |
|
540 |
* Start date and end date. |
|
541 |
*/ |
|
530 | 542 |
public $start; |
531 | 543 |
public $end; |
532 | 544 |
|
... | ... | |
609 | 621 |
* |
610 | 622 |
* @param object $entity |
611 | 623 |
* The entity to build the date field on. |
612 |
* @param str $field_name |
|
624 |
* @param string $field_name
|
|
613 | 625 |
* The name of the field to build. |
614 | 626 |
* @param int $delta |
615 | 627 |
* The delta in the field. |
... | ... | |
623 | 635 |
$use_start = $oldfield->start; |
624 | 636 |
$use_end = $oldfield->end; |
625 | 637 |
|
626 |
// Set timezone if not already in the FeedsDateTime object |
|
638 |
// Set timezone if not already in the FeedsDateTime object.
|
|
627 | 639 |
$to_tz = date_get_timezone($info['settings']['tz_handling'], date_default_timezone()); |
628 | 640 |
$temp = new FeedsDateTime(NULL, new DateTimeZone($to_tz)); |
629 | 641 |
|
... | ... | |
673 | 685 |
$entity->{$field_name}[$language][$delta]['value2'] = $use_end->format(date_type_format($info['type'])); |
674 | 686 |
} |
675 | 687 |
} |
688 |
|
|
676 | 689 |
} |
677 | 690 |
|
678 | 691 |
/** |
... | ... | |
829 | 842 |
} |
830 | 843 |
|
831 | 844 |
if (!$this->hasTime() || !$this->hasGranularity('zone') || $force) { |
832 |
// this has no time or timezone granularity, so timezone doesn't mean much
|
|
833 |
// We set the timezone using the method, which will change the day/hour, but then we switch back |
|
845 |
// This has no time or timezone granularity, so timezone doesn't mean much
|
|
846 |
// We set the timezone using the method, which will change the day/hour, but then we switch back.
|
|
834 | 847 |
$arr = $this->toArray(); |
835 | 848 |
parent::setTimezone($tz); |
836 | 849 |
$this->setDate($arr['year'], $arr['month'], $arr['day']); |
... | ... | |
883 | 896 |
$temp = date_parse($time); |
884 | 897 |
// This PHP method currently doesn't have resolution down to seconds, so if |
885 | 898 |
// there is some time, all will be set. |
886 |
foreach (self::$allgranularity AS $g) {
|
|
899 |
foreach (self::$allgranularity as $g) {
|
|
887 | 900 |
if ((isset($temp[$g]) && is_numeric($temp[$g])) || ($g == 'zone' && (isset($temp['zone_type']) && $temp['zone_type'] > 0))) { |
888 | 901 |
$this->granularity[] = $g; |
889 | 902 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules