| @@ 4279-4296 (lines=18) @@ | ||
| 4276 | ||
| 4277 | foreach ($content as $key => $enreg) { |
|
| 4278 | $enreg = explode(';', trim($enreg)); |
|
| 4279 | if ($key) { |
|
| 4280 | foreach ($tag_names as $tag_key => $tag_name) { |
|
| 4281 | if (isset($enreg[$tag_key])) { |
|
| 4282 | $sessions[$key - 1][$tag_name] = $enreg[$tag_key]; |
|
| 4283 | } |
|
| 4284 | } |
|
| 4285 | } else { |
|
| 4286 | foreach ($enreg as $tag_name) { |
|
| 4287 | $tag_names[] = api_preg_replace('/[^a-zA-Z0-9_\-]/', '', $tag_name); |
|
| 4288 | } |
|
| 4289 | if (!in_array('SessionName', $tag_names) || |
|
| 4290 | !in_array('DateStart', $tag_names) || |
|
| 4291 | !in_array('DateEnd', $tag_names) |
|
| 4292 | ) { |
|
| 4293 | $error_message = get_lang('NoNeededData'); |
|
| 4294 | break; |
|
| 4295 | } |
|
| 4296 | } |
|
| 4297 | } |
|
| 4298 | ||
| 4299 | $sessionList = array(); |
|
| @@ 1590-1612 (lines=23) @@ | ||
| 1587 | ||
| 1588 | foreach ($content as $key => $enreg) { |
|
| 1589 | $enreg = explode(';', trim($enreg)); |
|
| 1590 | if ($key) { |
|
| 1591 | foreach ($tag_names as $tag_key => $tag_name) { |
|
| 1592 | if (isset($enreg[$tag_key])) { |
|
| 1593 | $sessions[$key - 1][$tag_name] = $enreg[$tag_key]; |
|
| 1594 | } |
|
| 1595 | } |
|
| 1596 | } else { |
|
| 1597 | foreach ($enreg as $tag_name) { |
|
| 1598 | $tag_names[] = api_preg_replace( |
|
| 1599 | '/[^a-zA-Z0-9_\-]/', |
|
| 1600 | '', |
|
| 1601 | $tag_name |
|
| 1602 | ); |
|
| 1603 | } |
|
| 1604 | if (!in_array('SessionName', $tag_names) || |
|
| 1605 | !in_array('DateStart',$tag_names) || !in_array('DateEnd', $tag_names) |
|
| 1606 | ) { |
|
| 1607 | $error_message = get_lang('NoNeededData'); |
|
| 1608 | break; |
|
| 1609 | } |
|
| 1610 | } |
|
| 1611 | } |
|
| 1612 | ||
| 1613 | ||
| 1614 | if (!empty($sessions)) { |
|
| 1615 | // Looping the sessions. |
|