| @@ 1594-1616 (lines=23) @@ | ||
| 1591 | ||
| 1592 | foreach ($content as $key => $enreg) { |
|
| 1593 | $enreg = explode(';', trim($enreg)); |
|
| 1594 | if ($key) { |
|
| 1595 | foreach ($tag_names as $tag_key => $tag_name) { |
|
| 1596 | if (isset($enreg[$tag_key])) { |
|
| 1597 | $sessions[$key - 1][$tag_name] = $enreg[$tag_key]; |
|
| 1598 | } |
|
| 1599 | } |
|
| 1600 | } else { |
|
| 1601 | foreach ($enreg as $tag_name) { |
|
| 1602 | $tag_names[] = api_preg_replace( |
|
| 1603 | '/[^a-zA-Z0-9_\-]/', |
|
| 1604 | '', |
|
| 1605 | $tag_name |
|
| 1606 | ); |
|
| 1607 | } |
|
| 1608 | if (!in_array('SessionName', $tag_names) || |
|
| 1609 | !in_array('DateStart',$tag_names) || !in_array('DateEnd', $tag_names) |
|
| 1610 | ) { |
|
| 1611 | $error_message = get_lang('NoNeededData'); |
|
| 1612 | break; |
|
| 1613 | } |
|
| 1614 | } |
|
| 1615 | } |
|
| 1616 | ||
| 1617 | ||
| 1618 | if (!empty($sessions)) { |
|
| 1619 | // Looping the sessions. |
|
| @@ 4289-4306 (lines=18) @@ | ||
| 4286 | ||
| 4287 | foreach ($content as $key => $enreg) { |
|
| 4288 | $enreg = explode(';', trim($enreg)); |
|
| 4289 | if ($key) { |
|
| 4290 | foreach ($tag_names as $tag_key => $tag_name) { |
|
| 4291 | if (isset($enreg[$tag_key])) { |
|
| 4292 | $sessions[$key - 1][$tag_name] = $enreg[$tag_key]; |
|
| 4293 | } |
|
| 4294 | } |
|
| 4295 | } else { |
|
| 4296 | foreach ($enreg as $tag_name) { |
|
| 4297 | $tag_names[] = api_preg_replace('/[^a-zA-Z0-9_\-]/', '', $tag_name); |
|
| 4298 | } |
|
| 4299 | if (!in_array('SessionName', $tag_names) || |
|
| 4300 | !in_array('DateStart', $tag_names) || |
|
| 4301 | !in_array('DateEnd', $tag_names) |
|
| 4302 | ) { |
|
| 4303 | $error_message = get_lang('NoNeededData'); |
|
| 4304 | break; |
|
| 4305 | } |
|
| 4306 | } |
|
| 4307 | } |
|
| 4308 | ||
| 4309 | $sessionList = array(); |
|