function _themekey_properties_explode_conditions in ThemeKey 6.2
Same name and namespace in other branches
- 6.4 themekey.install \_themekey_properties_explode_conditions()
- 6 themekey_build.inc \_themekey_properties_explode_conditions()
- 6.3 themekey.install \_themekey_properties_explode_conditions()
- 7.3 themekey.install \_themekey_properties_explode_conditions()
- 7 themekey.install \_themekey_properties_explode_conditions()
- 7.2 themekey.install \_themekey_properties_explode_conditions()
Function _themekey_properties_explode_conditions() converts conditions formatted as string into an array. It was part of themekey_build.inc up to version 6.x-1.2. Now it's only required one more time to perform themekey_update_6200()
Parameters
$conditions: ThemeKey conditions as string
Return value
ThemeKey conditions as array
1 call to _themekey_properties_explode_conditions()
- themekey_update_6200 in ./
themekey.install - Implements hook_update_N().
File
- ./
themekey.install, line 235 - Database schema of @author Markus Kalkbrenner | Cocomore AG
Code
function _themekey_properties_explode_conditions($conditions) {
if (!is_array($conditions)) {
$parts = array_filter(explode(';', $conditions));
$conditions = array();
foreach ($parts as $part) {
$part = trim($part);
if (preg_match('/(.*?)([<>=!~])(.*)/', $part, $matches)) {
$conditions[] = array(
'property' => trim($matches[1]),
'operator' => trim($matches[2]),
'value' => trim($matches[3]),
);
}
}
}
return $conditions;
}