@@ 1221-1244 (lines=24) @@ | ||
1218 | } else { |
|
1219 | $tag_names = array(); |
|
1220 | ||
1221 | foreach ($content as $key => $enreg) { |
|
1222 | $enreg = explode(';', trim($enreg)); |
|
1223 | if ($key) { |
|
1224 | foreach ($tag_names as $tag_key => $tag_name) { |
|
1225 | $sessions[$key - 1][$tag_name] = $enreg[$tag_key]; |
|
1226 | } |
|
1227 | } else { |
|
1228 | foreach ($enreg as $tag_name) { |
|
1229 | $tag_names[] = api_preg_replace( |
|
1230 | '/[^a-zA-Z0-9_\-]/', |
|
1231 | '', |
|
1232 | $tag_name |
|
1233 | ); |
|
1234 | } |
|
1235 | if (!in_array('SessionName', $tag_names) || !in_array( |
|
1236 | 'DateStart', |
|
1237 | $tag_names |
|
1238 | ) || !in_array('DateEnd', $tag_names) |
|
1239 | ) { |
|
1240 | $error_message = get_lang('NoNeededData'); |
|
1241 | break; |
|
1242 | } |
|
1243 | } |
|
1244 | } |
|
1245 | } |
|
1246 | ||
1247 | if (!empty($sessions)) { |
@@ 4103-4121 (lines=19) @@ | ||
4100 | } else { |
|
4101 | $tag_names = array(); |
|
4102 | ||
4103 | foreach ($content as $key => $enreg) { |
|
4104 | $enreg = explode(';', trim($enreg)); |
|
4105 | if ($key) { |
|
4106 | foreach ($tag_names as $tag_key => $tag_name) { |
|
4107 | $sessions[$key - 1][$tag_name] = $enreg[$tag_key]; |
|
4108 | } |
|
4109 | } else { |
|
4110 | foreach ($enreg as $tag_name) { |
|
4111 | $tag_names[] = api_preg_replace('/[^a-zA-Z0-9_\-]/', '', $tag_name); |
|
4112 | } |
|
4113 | if (!in_array('SessionName', $tag_names) || |
|
4114 | !in_array('DateStart', $tag_names) || |
|
4115 | !in_array('DateEnd', $tag_names) |
|
4116 | ) { |
|
4117 | $error_message = get_lang('NoNeededData'); |
|
4118 | break; |
|
4119 | } |
|
4120 | } |
|
4121 | } |
|
4122 | ||
4123 | $sessionList = array(); |
|
4124 | // Looping the sessions. |