| @@ 1684-1707 (lines=24) @@ | ||
| 1681 | } |
|
| 1682 | } |
|
| 1683 | ||
| 1684 | if (!function_exists('propUpdate')) { |
|
| 1685 | /** |
|
| 1686 | * Property Update function |
|
| 1687 | * |
|
| 1688 | * @param string $new |
|
| 1689 | * @param string $old |
|
| 1690 | * @return string |
|
| 1691 | */ |
|
| 1692 | function propUpdate($new, $old) |
|
| 1693 | { |
|
| 1694 | $newArr = parseProperties($new); |
|
| 1695 | $oldArr = parseProperties($old); |
|
| 1696 | foreach ($oldArr as $k => $v) { |
|
| 1697 | if (isset($v['0']['options'])) { |
|
| 1698 | $oldArr[$k]['0']['options'] = $newArr[$k]['0']['options']; |
|
| 1699 | } |
|
| 1700 | } |
|
| 1701 | $return = $oldArr + $newArr; |
|
| 1702 | $return = json_encode($return, JSON_UNESCAPED_UNICODE); |
|
| 1703 | $return = ($return !== '[]') ? $return : ''; |
|
| 1704 | ||
| 1705 | return $return; |
|
| 1706 | } |
|
| 1707 | } |
|
| 1708 | ||
| 1709 | if (!function_exists('parseProperties')) { |
|
| 1710 | /** |
|
| @@ 571-594 (lines=24) @@ | ||
| 568 | } |
|
| 569 | } |
|
| 570 | ||
| 571 | if (!function_exists('propUpdate')) { |
|
| 572 | /** |
|
| 573 | * Property Update function |
|
| 574 | * |
|
| 575 | * @param string $new |
|
| 576 | * @param string $old |
|
| 577 | * @return string |
|
| 578 | */ |
|
| 579 | function propUpdate($new, $old) |
|
| 580 | { |
|
| 581 | $newArr = parseProperties($new); |
|
| 582 | $oldArr = parseProperties($old); |
|
| 583 | foreach ($oldArr as $k => $v) { |
|
| 584 | if (isset($v['0']['options'])) { |
|
| 585 | $oldArr[$k]['0']['options'] = $newArr[$k]['0']['options']; |
|
| 586 | } |
|
| 587 | } |
|
| 588 | $return = $oldArr + $newArr; |
|
| 589 | $return = json_encode($return, JSON_UNESCAPED_UNICODE); |
|
| 590 | $return = ($return !== '[]') ? $return : ''; |
|
| 591 | ||
| 592 | return $return; |
|
| 593 | } |
|
| 594 | } |
|
| 595 | ||
| 596 | if (!function_exists('parseProperties')) { |
|
| 597 | /** |
|