private function separate_property_group($properties)
{
if (is_array($this->sort_order[0])) {
// Если в настройках нет разбиения на группы, то выводим входной массив без изменений
foreach ($properties as $key => &$property) {
$property = preg_replace('@\\n\\s*?(\\n\\s*?)@ismx', '$1', $property);
$array = explode(':', $property);
$prop_name[$key] = trim($array[0]);
}
foreach ($this->sort_order as $group_num => $property_group) {
// Перебираем группы свойств
$intersect = array_intersect($prop_name, $property_group);
if (count($intersect) > 0) {
$num = array_keys($intersect);
$last_key = null;
foreach ($num as $n) {
$last_key = $n;
}
if ($properties[$last_key] !== end($properties)) {
$properties[$last_key] = $properties[$last_key] . "\n";
}
}
}
}
return $properties;
}