| @@ 1631-1653 (lines=23) @@ | ||
| 1628 | ||
| 1629 | foreach ($content as $key => $enreg) { |
|
| 1630 | $enreg = explode(';', trim($enreg)); |
|
| 1631 | if ($key) { |
|
| 1632 | foreach ($tag_names as $tag_key => $tag_name) { |
|
| 1633 | if (isset($enreg[$tag_key])) { |
|
| 1634 | $sessions[$key - 1][$tag_name] = $enreg[$tag_key]; |
|
| 1635 | } |
|
| 1636 | } |
|
| 1637 | } else { |
|
| 1638 | foreach ($enreg as $tag_name) { |
|
| 1639 | $tag_names[] = api_preg_replace( |
|
| 1640 | '/[^a-zA-Z0-9_\-]/', |
|
| 1641 | '', |
|
| 1642 | $tag_name |
|
| 1643 | ); |
|
| 1644 | } |
|
| 1645 | if (!in_array('SessionName', $tag_names) || |
|
| 1646 | !in_array('DateStart',$tag_names) || !in_array('DateEnd', $tag_names) |
|
| 1647 | ) { |
|
| 1648 | $error_message = get_lang('NoNeededData'); |
|
| 1649 | break; |
|
| 1650 | } |
|
| 1651 | } |
|
| 1652 | } |
|
| 1653 | ||
| 1654 | ||
| 1655 | if (!empty($sessions)) { |
|
| 1656 | // Looping the sessions. |
|
| @@ 4361-4378 (lines=18) @@ | ||
| 4358 | ||
| 4359 | foreach ($content as $key => $enreg) { |
|
| 4360 | $enreg = explode(';', trim($enreg)); |
|
| 4361 | if ($key) { |
|
| 4362 | foreach ($tag_names as $tag_key => $tag_name) { |
|
| 4363 | if (isset($enreg[$tag_key])) { |
|
| 4364 | $sessions[$key - 1][$tag_name] = $enreg[$tag_key]; |
|
| 4365 | } |
|
| 4366 | } |
|
| 4367 | } else { |
|
| 4368 | foreach ($enreg as $tag_name) { |
|
| 4369 | $tag_names[] = api_preg_replace('/[^a-zA-Z0-9_\-]/', '', $tag_name); |
|
| 4370 | } |
|
| 4371 | if (!in_array('SessionName', $tag_names) || |
|
| 4372 | !in_array('DateStart', $tag_names) || |
|
| 4373 | !in_array('DateEnd', $tag_names) |
|
| 4374 | ) { |
|
| 4375 | $error_message = get_lang('NoNeededData'); |
|
| 4376 | break; |
|
| 4377 | } |
|
| 4378 | } |
|
| 4379 | } |
|
| 4380 | ||
| 4381 | $sessionList = array(); |
|