Revision 6e3ce7c2
Added by Assos Assos over 3 years ago
drupal7/sites/all/modules/ctools/includes/export.inc | ||
---|---|---|
637 | 637 |
} |
638 | 638 |
|
639 | 639 |
/** |
640 |
* Get export object defaults. |
|
641 |
* |
|
640 | 642 |
* Call the hook to get all default objects of the given type from the |
641 | 643 |
* export. If configured properly, this could include loading up an API |
642 | 644 |
* to get default objects. |
645 |
* |
|
646 |
* @param string $table |
|
647 |
* The name of the table to be loaded. Data is expected to be in the |
|
648 |
* schema to make all this work. |
|
649 |
* @param array $export |
|
650 |
* The export definition from the table's hook_schema() definition. |
|
643 | 651 |
*/ |
644 |
function _ctools_export_get_defaults($table, $export) { |
|
652 |
function _ctools_export_get_defaults($table, array $export) {
|
|
645 | 653 |
$cache = &drupal_static(__FUNCTION__, array()); |
646 | 654 |
|
647 | 655 |
// If defaults may be cached, first see if we can load from cache. |
... | ... | |
684 | 692 |
$cache[$table][$name] = $object; |
685 | 693 |
} |
686 | 694 |
else { |
687 |
// If version checking is enabled, ensure that the object can be used. |
|
695 |
// If version checking is enabled, ensure that the object can be |
|
696 |
// used. |
|
688 | 697 |
if (isset($object->api_version) && |
689 | 698 |
version_compare($object->api_version, $export['api']['minimum_version']) >= 0 && |
690 | 699 |
version_compare($object->api_version, $export['api']['current_version']) <= 0) { |
... | ... | |
866 | 875 |
} |
867 | 876 |
else { |
868 | 877 |
$output = "array(\n"; |
878 |
ksort($var); |
|
869 | 879 |
foreach ($var as $key => $value) { |
870 | 880 |
$output .= $prefix . " " . ctools_var_export($key) . " => " . ctools_var_export($value, $prefix . ' ') . ",\n"; |
871 | 881 |
} |
Also available in: Unified diff
Weekly update of contrib modules