| @@ 1639-1661 (lines=23) @@ | ||
| 1636 | ||
| 1637 | foreach ($content as $key => $enreg) { |
|
| 1638 | $enreg = explode(';', trim($enreg)); |
|
| 1639 | if ($key) { |
|
| 1640 | foreach ($tag_names as $tag_key => $tag_name) { |
|
| 1641 | if (isset($enreg[$tag_key])) { |
|
| 1642 | $sessions[$key - 1][$tag_name] = $enreg[$tag_key]; |
|
| 1643 | } |
|
| 1644 | } |
|
| 1645 | } else { |
|
| 1646 | foreach ($enreg as $tag_name) { |
|
| 1647 | $tag_names[] = api_preg_replace( |
|
| 1648 | '/[^a-zA-Z0-9_\-]/', |
|
| 1649 | '', |
|
| 1650 | $tag_name |
|
| 1651 | ); |
|
| 1652 | } |
|
| 1653 | if (!in_array('SessionName', $tag_names) || |
|
| 1654 | !in_array('DateStart', $tag_names) || !in_array('DateEnd', $tag_names) |
|
| 1655 | ) { |
|
| 1656 | $error_message = get_lang('NoNeededData'); |
|
| 1657 | break; |
|
| 1658 | } |
|
| 1659 | } |
|
| 1660 | } |
|
| 1661 | ||
| 1662 | ||
| 1663 | if (!empty($sessions)) { |
|
| 1664 | // Looping the sessions. |
|
| @@ 4480-4497 (lines=18) @@ | ||
| 4477 | ||
| 4478 | foreach ($content as $key => $enreg) { |
|
| 4479 | $enreg = explode(';', trim($enreg)); |
|
| 4480 | if ($key) { |
|
| 4481 | foreach ($tag_names as $tag_key => $tag_name) { |
|
| 4482 | if (isset($enreg[$tag_key])) { |
|
| 4483 | $sessions[$key - 1][$tag_name] = $enreg[$tag_key]; |
|
| 4484 | } |
|
| 4485 | } |
|
| 4486 | } else { |
|
| 4487 | foreach ($enreg as $tag_name) { |
|
| 4488 | $tag_names[] = api_preg_replace('/[^a-zA-Z0-9_\-]/', '', $tag_name); |
|
| 4489 | } |
|
| 4490 | if (!in_array('SessionName', $tag_names) || |
|
| 4491 | !in_array('DateStart', $tag_names) || |
|
| 4492 | !in_array('DateEnd', $tag_names) |
|
| 4493 | ) { |
|
| 4494 | $error_message = get_lang('NoNeededData'); |
|
| 4495 | break; |
|
| 4496 | } |
|
| 4497 | } |
|
| 4498 | } |
|
| 4499 | ||
| 4500 | $sessionList = array(); |
|