function patterns_load_string_xml in Patterns 6
Same name and namespace in other branches
- 6.2 patterns.module \patterns_load_string_xml()
1 call to patterns_load_string_xml()
File
- ./
patterns.module, line 1157 - Enables extremely simple adding/removing features to your site with minimal to no configuration
Code
function patterns_load_string_xml($source) {
$pattern = patterns_from_source($source);
if (empty($pattern) || $pattern['tag'] != 'pattern') {
return FALSE;
}
// Rearrange the data in a nice way for each component.
// Make sure actions are processed differently so order is preserved.
$pattern = patterns_rearrange_data($pattern);
foreach ($pattern as $key => $values) {
$pattern[$values['tag']] = $values;
unset($pattern[$values['tag']]['tag']);
unset($pattern[$key]);
}
if (!patterns_validate_pattern($pattern)) {
return FALSE;
}
return $pattern;
}