| @@ 4475-4492 (lines=18) @@ | ||
| 4472 | $tag_names = array(); |
|
| 4473 | foreach ($content as $key => $enreg) { |
|
| 4474 | $enreg = explode(';', trim($enreg)); |
|
| 4475 | if ($key) { |
|
| 4476 | foreach ($tag_names as $tag_key => $tag_name) { |
|
| 4477 | if (isset($enreg[$tag_key])) { |
|
| 4478 | $sessions[$key - 1][$tag_name] = $enreg[$tag_key]; |
|
| 4479 | } |
|
| 4480 | } |
|
| 4481 | } else { |
|
| 4482 | foreach ($enreg as $tag_name) { |
|
| 4483 | $tag_names[] = api_preg_replace('/[^a-zA-Z0-9_\-]/', '', $tag_name); |
|
| 4484 | } |
|
| 4485 | if (!in_array('SessionName', $tag_names) || |
|
| 4486 | !in_array('DateStart', $tag_names) || |
|
| 4487 | !in_array('DateEnd', $tag_names) |
|
| 4488 | ) { |
|
| 4489 | $error_message = get_lang('NoNeededData'); |
|
| 4490 | break; |
|
| 4491 | } |
|
| 4492 | } |
|
| 4493 | } |
|
| 4494 | ||
| 4495 | $sessionList = array(); |
|
| @@ 1686-1708 (lines=23) @@ | ||
| 1683 | ||
| 1684 | foreach ($content as $key => $enreg) { |
|
| 1685 | $enreg = explode(';', trim($enreg)); |
|
| 1686 | if ($key) { |
|
| 1687 | foreach ($tag_names as $tag_key => $tag_name) { |
|
| 1688 | if (isset($enreg[$tag_key])) { |
|
| 1689 | $sessions[$key - 1][$tag_name] = $enreg[$tag_key]; |
|
| 1690 | } |
|
| 1691 | } |
|
| 1692 | } else { |
|
| 1693 | foreach ($enreg as $tag_name) { |
|
| 1694 | $tag_names[] = api_preg_replace( |
|
| 1695 | '/[^a-zA-Z0-9_\-]/', |
|
| 1696 | '', |
|
| 1697 | $tag_name |
|
| 1698 | ); |
|
| 1699 | } |
|
| 1700 | if (!in_array('SessionName', $tag_names) || |
|
| 1701 | !in_array('DateStart', $tag_names) || !in_array('DateEnd', $tag_names) |
|
| 1702 | ) { |
|
| 1703 | $error_message = get_lang('NoNeededData'); |
|
| 1704 | break; |
|
| 1705 | } |
|
| 1706 | } |
|
| 1707 | } |
|
| 1708 | ||
| 1709 | ||
| 1710 | if (!empty($sessions)) { |
|
| 1711 | // Looping the sessions. |
|